Difference between revisions of "Variables and Properties"

19 bytes added ,  04:50, 13 February 2012
imported>Evernewjoy
imported>Evernewjoy
Line 265: Line 265:
You need an instance of the script that has your variable that you want, in this case RamaJRMasterScript.
You need an instance of the script that has your variable that you want, in this case RamaJRMasterScript.


Once you create the object, could be an activator of any kind or an actor, or anything really, attach the RamaJRMasterScript script.
A. Once you create the object, could be an activator of any kind or an actor, or anything really, attach the RamaJRMasterScript script.


Name this object something clear, like "sampleReferenceWithScriptInstance"
B. Name this object something clear, like "sampleReferenceWithScriptInstance"


:)


Now make the switch object, I used a dwarven button, you can use any activator you want.
C. Now make the switch object, I used a dwarven button, you can use any activator you want.


Now attach the script RamaWorkingSCRIPT to the button/activator.
D. Now attach the script RamaWorkingSCRIPT to the button/activator.


'''Now set the properties of the button/activator:'''
E. '''Now set the properties of the button/activator:'''


msg = your sample message that you create that contains two %.f for use with the variables
msg = your sample message that you create that contains two %.f for use with the variables
Line 292: Line 291:
If you follow all these steps you will now be able to access and modify variables from one script in another script.
If you follow all these steps you will now be able to access and modify variables from one script in another script.


Example uses:


'''Example uses:
'''
1. keeping track of a total of enemies killed, where each enemy has a death script to increment a value in a master script
1. keeping track of a total of enemies killed, where each enemy has a death script to increment a value in a master script


Anonymous user