Jump to content

Scripting question: String variables in messages


CarlCorey

Recommended Posts

Is there any way to get a string into a message? I'm using FOSE and I tried to use "%n" in the message and passing in an object ref to an object whose name is the value I want to display. The script compiles fine but it crashes and burns when I try to run it.

 

To clarify what I tried:

 

  1. Created several Misc Objects with their names set to the values I want
  2. Created a FormList and put those objects in it
  3. Created a Message with the message "name is %n"
  4. In the script I get an object ref using "set nameRef to ListGetNthForm nameList nameIndex" and then" ShowMessage myMsg nameRef"
  5. printc "name is %n" nameRef prints the expected string to the console but the ShowMessage crashes the game

 

So that clearly doesn't work. I haven't seen anything else that's likely to work so I despair that it may be impossible.

Edited by CarlCorey
Link to comment
Share on other sites

Thanks for the heads-up. I had indeed been using FOSE 1.2. Unfortunately, MessageEx and MessageBoxEx do not seem to have been back ported in 1.3 and "%n" still crashes the game when used with ShowMessage.

 

I found a thread from a couple years ago on this very same topic. "%a" also doesn't work in exactly the same manner as discussed in that thread. The ShowMessage documentation must have been written by a NVSE user who just assumed that it worked the same in FOSE.

 

It looks like my options are down to having a different version of the Message for each variation with the value hardcoded. How very elegant. At least I only have 16 variations in this version.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...