Difference between revisions of "Differences from Previous Scripting"
Jump to navigation
Jump to search
Differences from Previous Scripting (edit)
Revision as of 10:33, 26 January 2012
, 10:33, 26 January 2012→Properties: about auto-fill
imported>Dragoonwraith (→Object References require Properties: added new section) |
imported>Dragoonwraith (→Properties: about auto-fill) |
||
Line 181: | Line 181: | ||
int property NumShots auto | int property NumShots auto | ||
</source> | </source> | ||
This is an example of how to declare a property in script. NumShots is the property name, it is an integer, and the "auto" modifier is simply a quick way of defining a property. "Auto" will let you see and change the value from outside of the script, and you can set it from inside of the editor by going to the Reference Window-> Scripts Tab-> Script Name-> Properties, and you'll see the property and be able to put any int you want in there. | This is an example of how to declare a property in script. NumShots is the property name, it is an integer, and the "auto" modifier is simply a quick way of defining a property. "Auto" will let you see and change the value from outside of the script, and you can set it from inside of the editor by going to the Reference Window-> Scripts Tab-> Script Name-> Properties, and you'll see the property and be able to put any int you want in there. You can also bring up this Property Manager window by double-clicking on any script attached to an object, or by right-clicking it and choosing Edit Properties. | ||
If you have an object-type Property, and you name it the same as a particular object within the CK, the CK will automatically fill it in for you when you attach the script to an object. If you add the object later, you can always have the CK fill it in for you by clicking the Auto-Fill button in the Property Manager. | |||
There's a longer way to declare properties as well, and this can come in handy if you want to do specific things, such as let other scripts see the property but not set it, or set some bounds on valid input, or even call some piece of script when a value gets read or written. | There's a longer way to declare properties as well, and this can come in handy if you want to do specific things, such as let other scripts see the property but not set it, or set some bounds on valid input, or even call some piece of script when a value gets read or written. | ||
<source lang="papyrus"> | <source lang="papyrus"> |