Jump to content

Need Script help: Need to convert the current value of an int property


Guest Messenjah

Recommended Posts

Guest Messenjah

So, I've got a bit of a scripting problem as usual. I have figured out how to call on another script's script property with a script end fragment (dialogue related) and change it's value. However, I have another problem. I need to detect the changed value of that property with a condition on an AI package, called: GetVMQuestVariable. The problem is that this condition and any other conditions that I can find for AI packages only call on variables instead of properties or they just don't work at all. Even though it will see my properties within the condition, GetVMQuestVariable tries to rename them with a "_var". It also doesn't seem to detect the value itself at all because the AI package does not activate. Yet, if I create a variable with a value of 1 (default value is 0), GetVMQuestVariable will detect the variable correctly and the AI package works fine.

 

So, what I need to know is, how, within a script, can I convert a property to a variable? In other words, how can I, on an Event using an if statement, detect the value of said property as being set to 1 and then set the value of the variable to 1 immediately when the value of the property is changed?

 

Since variables are contained only within a script and a property can be called upon outside of that script, I need a way of converting it within the quest script that I am calling on, into a variable.

 

In other words:

 

<code>int property ncpstart=0 auto conditional</code>

 

Needs to be converted within the script to:

 

<code>int npcrun conditional</code>

Edited by Messenjah
Link to comment
Share on other sites

Guest Messenjah

I actually tried writing my own get/set functions but failed for some reason. Not sure it failed exactly. It went something along the lines of:

 

<code>Event OnUpdateGameTime

If myProperty == 1

myVariable = 1

else

Return

Endif

 

EndEvent</code>

 

This was after the variables and properties were already declared and the script was named of course. Since the variable and property are contained within the script itself, the if statement should be able to set the value of the variable without using any conditions or properties pointing to the same quest/script you would think. Anyway, it wouldn't compile for some reason.

 

 

However, on the bright side, I did solve my problem. Apparently, GetVMQuestVariable does see conditional properties just fine, and uses them just fine. I just forgot to assign my quest script to the quest script property. :\ *Slams head into desk repeatedly*.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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