MagicalDude Posted October 7, 2014 Share Posted October 7, 2014 I know that it is possible to have a dialogue change a bool variable to a true or false as a fragment code. For example: (GetOwningQuest() as QuestName).Variable = true or false But I am trying to expand on an NPC to where I can make the variable an integer instead of a bool. That way I can use that number to dynamically change the person's future responses to the player. So I am wondering if this I use this code: Scriptname QuestName extends Quest Conditional Int Property Variable = 0 Auto Conditional And have dialogue choices add or subtract the default value throughout the game. To be honest, I am still learning on papyrus scripting so I don't know if something like this is possible with this engine. So I don't know if using the declared variable from, for example: (GetOwningQuest() as QuestName).Variable = 5 Is valid (which I am assuming it is). Ultimately, what I am aiming for is having the GetOwningQuest() to be able to add the value or subtract the value (ala add assignment/subtract assignment) so that: (GetOwningQuest() as QuestName).Variable += 5 or (GetOwningQuest() as QuestName).Variable -= 5 I know that it is a rather silly question to ask, but better safe to ask than not (especially since the Creation Kit's wiki can be vague at times). Â Lastly, does the condition functions of the Creation Kit able to handle negative numbers, if the above code works. For example: GetVMQuestVariable Quest: 'QuestName,' ::Variable == -5.00 AND Link to comment
Heromaster Posted October 7, 2014 Share Posted October 7, 2014 Yep, this works exactly as you would expect. With your snippet Variable would be increased/decreased by 5. And yes, the CK can handle negative numbers too. Link to comment
MagicalDude Posted October 7, 2014 Author Share Posted October 7, 2014 Oh excellent! That is what I was hoping for. Just to prevent issues with syntax, are the three lines valid when putting any of the three into the dialogue fragment: (GetOwningQuest() as QuestName).Variable = 5 (GetOwningQuest() as QuestName).Variable += 5 (GetOwningQuest() as QuestName).Variable -= 5 Â Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.