Guest Messenjah Posted July 4, 2012 Share Posted July 4, 2012 Ok, this is really holding me back so I'm going to restate my question as simply as I can: How do you change a property value within quest script with a dialogue response end script? Link to comment Share on other sites More sharing options...
David Brasher Posted July 4, 2012 Share Posted July 4, 2012 I would say that you never change properties in a script. Properties are set in the CK and never change. Are you talking about trying to change the value of a variable or global variable? Link to comment Share on other sites More sharing options...
Guest Messenjah Posted July 5, 2012 Share Posted July 5, 2012 I don't want to change a property.... I want to change the variable of that value or property. To explain better: I have a quest, it has a quest script. When an NPC speaks, I want an end script fragment to run that changes the variable of this value. For example an integer. Let's say that the integer property is called npcaction. It is set by default to a value of 0. I want this integer to change to a 1. In Fallout New Vegas, this was a very simple task. It would go something like this.... set MyQuestName.MyIntProperty to 1 It should now return a 1 instead of a 0 when it is called upon. Then, within an AI package, I need to call the value again as a condition. If it is a 0 or not != 1, it will not start but if it is equal to 1 or == 1, the AI package will run. The condition would be something along the lines of: getquestvariable questvariable == 1 However, when calling on an int property on my script, with this condition, I do not see a list of any of the integer variables. I also can't seem to find a normal way to change the value of the integer from 0 to 1 via the end script fragment. :\ This allows more precise control over events/npc behaviour without using quest stages. In my particular case, I have 4 npcs that perform the same exact behaviour and use the exact same dialogue but I do not want their AI packages to converge and cause them to all move to the same location and perform the same actions. Only one of them at a time should do this. So I need two things, a way to change the value of the integer within a script fragment and to be able to call on it to get the value within an AI Package condition. Link to comment Share on other sites More sharing options...
Guest MobMessenjah Posted July 5, 2012 Share Posted July 5, 2012 (edited) Here, this might help: My quest name is: MyCoolQuest (just calling it this for now.) Scriptname MyCoolQuestSript extends Quest Conditional Int npcstart=0 Conditional Now, how do I make a script fragment to change the value of npcstart from 0 to 1? Edited July 5, 2012 by MobMessenjah Link to comment Share on other sites More sharing options...
flobalob Posted July 5, 2012 Share Posted July 5, 2012 I'm not sure about quests but in normal scripts the variables are NOT visible outside of them, you have to make them properties. e.g. Scriptname MyCoolQuestSript extends Quest Conditional Int Property npcstart=0 Conditional Link to comment Share on other sites More sharing options...
Guest MobMessenjah Posted July 5, 2012 Share Posted July 5, 2012 (edited) Not true, I just found out that so long as I mark the variable as conditional.... I can set a condition that will see the variable but won't see a property. To my knowledge, it is quite the opposite because your not supposed to change properties, you are supposed to change variables. Thus, calling on a property would be a bit pointless where calling on a variable would be quite useful, in the case of changing or effecting that variable. Just re-affirmed it. If you use GetVMQuestVariable condition with my script, you can see that it should work, so long as it the integer is a variable and not a property. But I can not find a way to call it via script so that I can change the value of the variable. Edited July 5, 2012 by MobMessenjah Link to comment Share on other sites More sharing options...
Guest MobMessenjah Posted July 5, 2012 Share Posted July 5, 2012 Bump. I still need help. Link to comment Share on other sites More sharing options...
steve40 Posted July 6, 2012 Share Posted July 6, 2012 (edited) I think you would do it something like this: Firstly, in the script "MyQuestName" that will hold the property, you need to declare your property thus: Int Property MyIntProperty auto Now to manipulate this property from another script or fragment, you need to: 1) pass the script "MyQuestName" to your script or fragment via a "Property. Usually the property will be of type Quest or "my quest script name" 2) now you can get or set the property value like thus: ScriptName SomeOtherScript extends Whatever conditional MyQuestName Property MyQuestRef auto conditional ......... MyQuestRef.MyIntProperty = 5 ; to set MyIntProperty to "5", where MyIntProperty is in the script that MyQuestRef points at. int i = MyQuestRef.MyIntProperty ; "i" will have the value of 5 note that if you have Property kmyQuest set to point at your MyQuestName quest, then you should do this: kmyQuest.MyIntProperty = 5 ; to set MyIntProperty to "5", where MyIntProperty is in the script that kmyQuest points at. int i = kmyQuest.MyIntProperty ; "i" will have the value of 5 Edit: edited a little for clarification. More info here. Edited July 6, 2012 by steve40 Link to comment Share on other sites More sharing options...
steve40 Posted July 6, 2012 Share Posted July 6, 2012 (edited) I'm not sure about quests but in normal scripts the variables are NOT visible outside of them, you have to make them properties. e.g. Scriptname MyCoolQuestSript extends Quest Conditional Int Property npcstart=0 Conditional Only auto properties can be declared conditional: Scriptname MyCoolQuestSript extends Quest Conditional Int Property npcstart=0 Auto Conditional Edited July 6, 2012 by steve40 Link to comment Share on other sites More sharing options...
Recommended Posts