How do I pass an integer to a new script?
vxicepickxv
Member Posts: 6
I want to pass an integer to a new script.
I converted it into a string for the purpose of using SetScriptParam, but I don't know how to set that part up before I execute the next script. It says I need to set it up via SetScriptParam(string, string) but there isn't a proper sample on nwnlexicon for setting the strings.
When I have it in a way I think it would work, I get an Unknown State in Compiler error for the SetScriptParam line.
I converted it into a string for the purpose of using SetScriptParam, but I don't know how to set that part up before I execute the next script. It says I need to set it up via SetScriptParam(string, string) but there isn't a proper sample on nwnlexicon for setting the strings.
When I have it in a way I think it would work, I get an Unknown State in Compiler error for the SetScriptParam line.
0
Comments
You might not need to: And then in the next script you call:
Call the script using ExecuteScript or ExecuteScriptChunk.
Inside the script you are calling, use GetScriptParam with the name you assigned to the parameter in order to access it and assign it to a variable. You can then manipulate that variable like any other.
But the error you're getting sounds like you've forgotten to terminate the previous command with the semi-colon, not a problem with the SetScriptParam command.
Some script fragments may help. First, the calling script:
How to get that number back inside "calledscript":
I hope this helps.
My error was much simpler than previous command termination. I didn't have my variable in quotation marks.