Editing Variables and Properties
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
==Description== | ==Description== | ||
Variables and Properties are similar things, they both "hold" values and objects. A variable is "private" meaning that only that script is aware of them, can set their contents, and get their contents. A Property is essentially a variable that other scripts can access, their contents can be set and get by a other scripts. | Variables and Properties are similar things, they both "hold" values and objects. A variable is "private" meaning that only that script is aware of them, can set their contents, and get their contents. A Property is essentially a variable that other scripts can access, their contents can be set and get by a other scripts. | ||
If a variable or property holds a numeric value, like an integer, get/set returns its value. If a variable or property holds an object, you can access that object's properties and functions. (This is analogous to a reference variable from the old scripting system.) | |||
==Declaring Variables== | ==Declaring Variables== | ||
Line 179: | Line 180: | ||
==Getting Properties From Any Other Script== | ==Getting Properties From Any Other Script== | ||
You can | You can use the above example regarding the Magic Effect script as a basis for your script. You must define a property in your script, with the "Type" of your object you are wishing to access. If your object has a custom script, define the type as your object's script name. Be careful not to declare it as the object's name. All objects can have multiple scripts, so you must specify the ''script name'' you want to access. | ||
' | |||
''' | |||
For a list of objects you can use as a type that are already within the game, visit the [[Script Objects]] page. | For a list of objects you can use as a type that are already within the game, visit the [[Script Objects]] page. | ||
==Warnings== | ==Warnings== | ||
Line 249: | Line 202: | ||
==Notes== | ==Notes== | ||
*The list of properties in properties dialog is only updated after adding a new property or after compiling the script with the build-in editor. | *The list of properties in properties dialog is only updated after adding a new property or after compiling the script with the build-in editor. | ||
==See Also== | ==See Also== | ||
*[[Property Reference]] | *[[Property Reference]] | ||
[[Category: Papyrus]] | [[Category: Papyrus]] | ||
[[Category: Papyrus Tutorials]] | [[Category: Papyrus Tutorials]] | ||
{{Languages}} | {{Languages}} |