Jump to content

Skyrim Scripting - Having a dialogue response add or subtract a value.


MagicalDude

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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