Jump to content

Making string variables show up in dialogue?


Fagahajakal

Recommended Posts

Is it possible to make a line of dialogue that works similar to when you put in %PCName but you have some custom string variable to appear?

 

I have had this idea to use this in a mod but I haven't been able to find anything about this on the GECK Wikis. Does anybody have a solution to make this work?

Link to comment
Share on other sites

Haven't tried this myself. I suspect this depends upon whether you are talking about using your variable in the "Topic" line or the "Response". I have no evidence, but strongly suspect the "Topic" line is not amenable to the use of variables, because you (in effect) hard code it when you create the topic. The "Response" line however is basically a string variable containing the "message" that gets displayed. As such, one would expect you could build that string variable using "string concatenation" functions just before the "ShowMessage" equivalent line, or perhaps in the "Result Script" of the previous line of dialog. As in:

set sVariableDefinedElsewhere to "string value to be displayed now"
set sMyMessage to "some text " + sVariableDefinedElsewhere + " remainder of text line"
ShowMessage sMyMessage

With NVSE you can use the "ToString(fSomeNonStringNumericVariable)" function in place of the "sVariableDefinedElsewhere".

 

Remember you can not define a variable in a "Result Script", but you can assign a value to one already defined.

 

Otherwise, only experimentation will tell you for sure.

 

-Dubious-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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