Difference between revisions of "Cross Script Variables"
Jump to navigation
Jump to search
→The Basics
imported>Bruneauinfo |
imported>Bruneauinfo |
||
Line 7: | Line 7: | ||
A scenario for creating and testing this type of functionality includes at least three features: | A scenario for creating and testing this type of functionality includes at least three features: | ||
1 - A | 1 - A script that acts as the database for storing values. (One might want to read over the article [[Quest scripts]] to get familiar with the source of this idea.) | ||
2 - A script that writes a value to one of the variables in the "database" Quest script when it is activated. | 2 - A script that writes a value to one of the variables in the "database" Quest script when it is activated. | ||
Line 45: | Line 45: | ||
====Notes==== | ====Notes==== | ||
* | *If you assign starting values to your variables in the "database" script use a doOnce variable to keep the variables from being reset to their initial values on every frame refresh. Setting values within this script's Begin-End block without a doOnce will essentially "lock in" the values to their initial setting. | ||
*The variable names listed in the script can be named whatever you like - preferably something meaningful to their purpose. | *The variable names listed in the script can be named whatever you like - preferably something meaningful to their purpose. | ||
Line 122: | Line 122: | ||
</pre> | </pre> | ||
If you use this script exactly as written the message box will show the name of your reference rather than the reference. See [[MessageBoxEx]] for more. But the reference value is there and ready to use. | If you use this script exactly as written the message box will show the name of your reference rather than the reference. See [[MessageBoxEx]] for more. But the reference value is there and ready to use. | ||
== Practical Applications == | == Practical Applications == |