Jump to content

set a variable in object script from a Topic


Agnot2006

Recommended Posts

Please, what is the way to set a variable in an object script from the Topic script result box and Place it in an AI Packages as a condition?

I have looked at other peoples mods and tried to copy what they have done but I keep getting the error the variable does not exist.

I.e “set scriptname.variablename to value” in Topic script result box.

I want to set the variable depending on the player choices in a topic.

This is so I can use it as a condition to run AI Packages.

Link to comment
Share on other sites

Please, what is the way to set a variable in an object script from the Topic script result box and Place it in an AI Packages as a condition?

Must it be an object script?

 

Would you consider making it a quest script instead? You can even create a quest that does nothing more than act as a placeholder for a script that provides variables. Then you can set those variables from dialogue topic result scripts, use them as conditions for dialogue and AI packages, and call them from other scripts.

Link to comment
Share on other sites

Please, what is the way to set a variable in an object script from the Topic script result box and Place it in an AI Packages as a condition?

Must it be an object script?

 

Would you consider making it a quest script instead? You can even create a quest that does nothing more than act as a placeholder for a script that provides variables. Then you can set those variables from dialogue topic result scripts, use them as conditions for dialogue and AI packages, and call them from other scripts.

 

I tried changing it to a quest script, then other pieces in the script didn’t work when I tried to reference the script in the topic script box the error was

“Scripts: Script 'MyScript', line 9 Reference function requires explicit reference in quest script” the script works fine as an object and adds and removes items of clothing, but I don’t know how to make them explicit.

 

Maybe I should split the script into 2 scripts and make one a quest the other the object?

Link to comment
Share on other sites

If an object script is attached to a persistent reference with a unique EditorRefID, then you can remotely access its variables in the same manner as with quest scripts:
EditorRefID.VariableName

When creating non-quest conditions, you can access the variables via GetScriptVariable.

 

Cipscis

 

Inside the script I just do a “Short variable” I thought then I just needed to do a

set Scriptname.VariableName to Value inside the topic script result box.

That’s what it looks like in other mods I have looked at.

Do I have to define the variable anywhere else?

All I get is variable not known

Link to comment
Share on other sites

  • Recently Browsing   0 members

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