Papyrus (Bethesda RPG Scripting)

Created on 2023-08-22T14:20:14-05:00

Return to the Index

This card pertains to a resource available on the internet.

This card can also be read via Gemini.

It's a form of BASIC, extended to handle a subset of game objects that appear in those engines.

State machines

There is also state machine syntax sugar.

 Auto State AtRest
    Event OnActivate(ObjectReference akActionRef)
      GoToState("Busy")

      ;DO STUFF HERE
      ;play animations, etc. - left vague for illustrative purposes
      ;Done doing stuff

      GoToState("AtRest")
    EndEvent
 EndState

 State Busy
    Event OnActivate(ObjectReference akActionRef)
       debug.trace("I'm busy, so not doing anything.")
    EndEvent
 EndState