Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScriptName JasperSwitchStatic Extends ObjectReference
- ; v0.2 https://www.reddit.com/r/skyrimmods/comments/4eto2z/better_papyrusscripting_can_you_help/
- ObjectReference[] Property References Auto
- int Property Position
- int Function Get()
- return Current + 1
- EndFunction
- EndProperty
- int Current = -1
- Event OnActivate(ObjectReference akActionRef)
- If(References != none)
- int len = References.Length
- If(Position >= len)
- Current = -1
- EndIf
- Current += 1
- EnableSingle(References, Current)
- EndIf
- Endevent
- Function EnableSingle(ObjectReference[] akReferences, int aiElement) Global
- If(akReferences != none && aiElement >= 0)
- int len = akReferences.Length
- int idx = -1
- While((idx + 1) < len)
- idx += 1
- If(idx == aiElement)
- akReferences[idx].Enable()
- Else
- akReferences[idx].Disable()
- EndIf
- EndWhile
- EndIf
- EndFunction
Add Comment
Please, Sign In to add comment