|
Post by Dova on Jan 16, 2014 19:21:26 GMT
I am writing a dialogue with several choices in response to a same decision, thus I want the dialogue choice to alter some int variables that I could access later after the dialogue ended. But it seems that Topic Info fragments doesn't hold onto variables...is there a way to do this?
|
|
|
Post by Wolf on Jan 16, 2014 19:59:04 GMT
I am writing a dialogue with several choices in response to a same decision, thus I want the dialogue choice to alter some int variables that I could access later after the dialogue ended. But it seems that Topic Info fragments doesn't hold onto variables...is there a way to do this? The best way to do it is to use conditional (read and write) variables in an Actor or ObjectReference script. For example create an Actor script on an NPC (it's also possible to use an ObjectReference). The script must be conditional to be able to access the variable int Property YourVariable Auto Conditional Let's suppose the Actor Reference has the name NPC and your conditional script has the name NPCScript, then you can write this variable from a topic info fragment for example with: (NPC as NPCScript).YourVariable = 1 (you have to set the actor property of NPC of course.) In a condition it would like this: if (NPC as NPCScript).YourVariable == 1 ..... endif I hope this helps
|
|
|
Post by Dova on Jan 17, 2014 19:27:15 GMT
Thanks Wolf, I see what you are saying with GetVMQuestVariable, and then my quest script should be able to call this variable in the conditional script as getting properties from a different script?
|
|
|
Post by Wolf on Jan 17, 2014 20:43:10 GMT
In my example the variables are stored inside an actor or objectreference script. In this case the topic condition command would be "GetVMScriptVariable" and not "GetVMQuestVariable". But of course you can do everything also in a questscript that is flagged as conditional.
In this case you can access your quest script variable from another script or topic info fragment with (YourQuest as YourQuestScript).YourVariable = 1 and the quest property YourQuest.
The problem with questscripts is only if the quest is started and the script has already been run in a savegame, any later changes of the script won't have an effect. You have to start the quest anew so that changes will be executed.
So it's better to store conditional variables not in quest scripts.
|
|
|
Post by Dova on Jan 18, 2014 23:32:58 GMT
aha! you have just answered my biggest confusion! Thanks!
|
|