larryrathbun Posted September 3, 2012 Share Posted September 3, 2012 I am working on a mystery mod where there is a lot of evidence to find. Basically this means there are a lot of activators, some of which enable other objects (searching for evidence) if checks are passed. As a result, I anticipate a LOT of messages. For example, searching a file cabinet has three possible results: 1) The player passes a skill/attribute check and finds some item. "You notice... blah blah blah." 2) The player passes a check based on a dialog result earlier and finds the item. "Suspicious because Bob told you about the files, you search and find.. blah blah." 3) The player passes neither and does not find the item. "The drawer is filled with papers, none of which seem important to you." The player can try again later. I want each result to display a message for the player, and I want all of them, even items that will never have anything useful to appear equally important, so all must be in the same format. Does that mean I have to create a message object and use ShowMessage for every possible outcome on every item? That means over 100 message objects. Can I write the messages into a script and have it display a message window without making a message object? I have seen a few messages which are sent a variable (achievement messages), can I feed a string of text into a message as a variable? If yes to either (or both) can someone provide me the name of a script in the game that works in this way so I can see how it works? Link to comment Share on other sites More sharing options...
luthienanarion Posted September 4, 2012 Share Posted September 4, 2012 (edited) You can use the MessageEx function in NVSE to generate messages without creating message objects. You can also pass variables to ShowMessage if the message object has variable placeholders in the message.Details: ShowMessage Edit: stupid BBcode Edited September 4, 2012 by luthienanarion Link to comment Share on other sites More sharing options...
larryrathbun Posted September 4, 2012 Author Share Posted September 4, 2012 Great: MessageEX sounds like what I am looking for. Followup Question: Is there any benefit to doing this versus using message objects. i.e. performance better one way versus the other? Of course the mod would require NVSE if I used it, but then so does everything. Link to comment Share on other sites More sharing options...
luthienanarion Posted September 4, 2012 Share Posted September 4, 2012 Really, the only difference is that you can't have a title for a message box created using MessageBoxEx. Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted September 5, 2012 Share Posted September 5, 2012 Using MessageBoxEX also opens you up to use the new Format Specifiers that NVSE adds. Things like %n, which can be replaced with the name of a ref. So you pass in say, a weapon or Misc object and the name gets put into the message.set rItem to pencil MessageBoxEX "You have found a %n." rItemWould print "Pencil" in place of the %n. Obviously that's not very useful, but you could have a single script that runs on a bunch of objects, checking the base form and altering accordingly. Or a quest variable set from any number of objects that can then be displayed. Another good one is actually undocumented on the FOSE site, but is in the NVSE whats_new.txt file. It's the %c specifier. It can be used for a bunch of things (I think), but what I found it useful for, and what it's documented as doing, is getting the name, short name, and abbreviation from ammo form types. My use for it is as a string holder for boolean information (Yes, No). Toggled from a single variable. It could be used in a situation likeMessageBoxEX "There's a fingerprint on the handle, %c enough to get a lead." rItem"Where rItem is an ammo form type, passed in as a reference variable (that's key), where the Name and Short Name fields are "there seems to be" and "there doesn't seem to be". That would fill in the sentence based on a boolean value of 0 or 1. So you wouldn't need as MANY messages either, since the ones you have can pull double duty. Of course, this way you're having to make other references, which isn't as good, but that same ammo form could be used in a dozen messages based on a similar sentence structure. Also, in the first example, the %n can be used for NPC names as well, so you could fill it in with the name of NPCs who might or might not have done it, or need further questioning, etc. Take a look at the NVSE Format Specifiers for more ideas and info. Link to comment Share on other sites More sharing options...
luthienanarion Posted September 5, 2012 Share Posted September 5, 2012 Where rItem is an ammo form type, passed in as a reference variable (that's key), where the Name and Short Name fields are "there seems to be" and "there doesn't seem to be". You have no idea how happy you've made me with this little bit of info, Gribbleshnibit8. I've tried using %c with faction/spell ranks as in OBSE, and figured that the specifier didn't make it into FOSE/NVSE. Link to comment Share on other sites More sharing options...
Recommended Posts