Difference between revisions of "Papyrus Introduction"

Jump to navigation Jump to search
No change in size ,  16:54, 19 March 2012
m
imported>Cipscis
m (Added missing space character and normalised apostrophe characters)
imported>Udun
Line 18: Line 18:
A script can also have '''[[Variables and Properties|Variables]]'''. A variable is a value that can be modified and reference by the game and scripts. For example, you might want to store the number you get from a [[GetActorValue_-_Actor|GetActorValue()]]. With variables you can store this information, and use it later.
A script can also have '''[[Variables and Properties|Variables]]'''. A variable is a value that can be modified and reference by the game and scripts. For example, you might want to store the number you get from a [[GetActorValue_-_Actor|GetActorValue()]]. With variables you can store this information, and use it later.


A script can also have '''[[Variables and Properties|Properties]]''', which function almost identically to variables, except that ''other'' scripts can ask about and set them.  Properties can also be modified in the editor. (''Note: In reality properties are more a bit complex than simply a “variable that you can get/set externally,” but for practical purposes, that's a fine way to think of them'').  
A script can also have '''[[Variables and Properties|Properties]]''', which function almost identically to variables, except that ''other'' scripts can ask about and set them.  Properties can also be modified in the editor. (''Note: In reality properties are a bit more complex than simply a “variable that you can get/set externally,” but for practical purposes, that's a fine way to think of them'').  


[[Variables and Properties]] can be defined to be simple structures like a [[Literals_Reference#Boolean_Literals|Boolean, an Integer, a Float, etc.]] But their real power lies in that they can be defined as and hold '''any''' [[:Category:Script_Objects|Object Type]]. A Quest script, for instance, can have a property that holds a pointer to an Actor. Once you have a pointer to an object in a script property, that script can run functions on that property and thus on the object in it. For example, a quest script holding a property pointing to an Actor, can call Kill() on that property and it will kill that actor. Properties can be set by the script at run time, or can be set by pointing to objects in the editor.
[[Variables and Properties]] can be defined to be simple structures like a [[Literals_Reference#Boolean_Literals|Boolean, an Integer, a Float, etc.]] But their real power lies in that they can be defined as and hold '''any''' [[:Category:Script_Objects|Object Type]]. A Quest script, for instance, can have a property that holds a pointer to an Actor. Once you have a pointer to an object in a script property, that script can run functions on that property and thus on the object in it. For example, a quest script holding a property pointing to an Actor, can call Kill() on that property and it will kill that actor. Properties can be set by the script at run time, or can be set by pointing to objects in the editor.
Anonymous user

Navigation menu