Difference between revisions of "Differences from Previous Scripting"

Jump to navigation Jump to search
→‎Properties: about auto-fill
imported>Dragoonwraith
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.<BR><BR>
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">

Navigation menu