Difference between revisions of "Papyrus Introduction"

Jump to navigation Jump to search
10 bytes added ,  11:15, 8 February 2012
imported>Jduvall
imported>SLiesegang
Line 22: Line 22:
[[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.


It's also important to remember that papyrus scripts run in response to the game and other scripts. There for all of your code needs to live inside an '''[[Event]]''' block, or inside a '''[[#Fragments |Script Fragments]]''' such as a quest stage fragment, or topic info fragment.
It's also important to remember that papyrus scripts '''only''' run in response to the game and other scripts. Therefor all of your code needs to live inside an '''[[Event]]''' block, or inside a '''[[#Fragments |Script Fragments]]''' such as a quest stage fragment, or topic info fragment.


=How do you write a papyrus script?=
=How do you write a papyrus script?=
Anonymous user

Navigation menu