Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
no edit summary
imported>LukeH
imported>MoopusMaximus
No edit summary
Line 15: Line 15:


==Scripts==
==Scripts==
== Creating a simple Toggle ==
<source lang="papyrus">
Scriptname SimpleToggle Extends ObjectReference
ObjectReference Property HouseProperty Auto
Int Toggle = 0 ; The toggle variable. Initial value is 0.
Event OnActivate(ObjectReference akActionRef)
    If Toggle == 0 ;If Toggle is 0 (which it initially is) the...
          HouseProperty.Enable() ;Enable your house!
          Toggle = 1 ;Set Toggle to 1 to prevent miss-fires.
    Endif
    If Toggle == 1 ;If Toggle is 1 (which it gets set to after you activate it the first time) then...
          HouseProperty.Disable() ;Disable your house!
          Toggle = 0 ;Set Toggle to 0 to prevent miss-fires.
    Endif
EndEvent
</source>


===A Quest item you can drop and pick up again and set or reset objectives and Stages.===
===A Quest item you can drop and pick up again and set or reset objectives and Stages.===

Navigation menu