ScummVM API documentation
Macs2::Script::ScriptExecutor Class Reference

#include <scriptexecutor.h>

Public Member Functions

void setIdle ()
 
bool skipToEndOfSkippableSection ()
 
uint16 getAreaAtPoint (uint16 x, uint16 y)
 
void setVariableValue (uint16 index, uint16 a, uint16 b)
 
void setVariableValue (uint16 index, uint32 value)
 
Common::Point getCharPosition ()
 
ExecutionResult executeOpcodes ()
 
void run (bool firstRun=false)
 
void setScript (Common::MemoryReadStream *stream)
 
void releaseObjectStream ()
 
void setCurrentSceneScriptAt (uint32 offset)
 
void tick ()
 
void startTimer (uint32 duration)
 
void endTimer ()
 
void startFrameWait (uint16 duration)
 
void endFrameWait ()
 
bool isScriptWaitDeferred () const
 
bool isExecuting () const
 
uint32 getScriptPosition () const
 
uint32 getDebugOpcodePosition () const
 
bool isWaitingForCallback () const
 
uint32 getScriptEndPosition () const
 
uint16 getExecutingObjectId () const
 
void setExecutingObjectId (uint16 id)
 
uint16 getFrameWaitCounter () const
 
void setFrameWaitCounter (uint16 val)
 
bool isFrameWaitActive () const
 
bool getRepeatRunFlag () const
 
void setRepeatRunFlag (bool val)
 
uint32 getVariableValue (int index) const
 
void debugLogActorWalkState (const char *context)
 
uint32 getSpecialValue (uint16 value)
 
bool canOpenSaveMenu () const
 
CharactergetOrCreateCharacter (uint16 objectID)
 
void saveWalkRuntime (const Character *c, GameObject *o)
 
void restoreWalkRuntime (Character *c, const GameObject *o)
 
void clearStoredWalkRuntime (GameObject *o)
 
void seedMoveToPositionState (GameObject *object, Character *c, const Common::Point &target, uint16 targetVerticalOffset)
 
void seedMotionState (GameObject *object, Character *c, uint16 targetVerticalOffset, uint16 verticalOffsetDelta, uint16 motionDistance)
 
void saveOpenInventoryScriptContext ()
 
void restoreOpenInventoryScriptContext ()
 
void setScriptError (uint16 code)
 
bool hasScriptError () const
 
void clearScriptError ()
 
uint16 getScriptErrorCode () const
 
void recordScriptErrorPosition ()
 
void beginSceneEntryInitPass ()
 
void finishSceneEntryRepeatPass (bool terminateOuterScript)
 
void runSceneEntryScriptPasses ()
 
void runSceneScriptPass (bool initRun, bool repeatRun)
 
void enterBlockingWaitCursor ()
 
void clearScriptUiWaitState ()
 
void rewind ()
 

Public Attributes

Common::Array< uint16 > _dialogueChoiceScriptIndices
 
Common::Array< Common::StringArray_dialogueChoices
 
uint32 _savedOpenInventoryScriptPos = 0
 
uint32 _savedOpenInventoryScriptEndPos = 0
 
uint16 _savedOpenInventoryExecutingObjectId = 0
 
uint32 _secondaryInventoryLocation = 0
 
bool _hasPendingExternalInventoryResume = false
 
uint16 _externalInventorySourceObjectID = 0
 
MouseMode _savedExternalInventoryMouseMode = MouseMode::Use
 
bool _pathWalkableResult = false
 
bool _isRepeatRun = false
 
int _chosenDialogueOption = 0
 
uint16 _dialogueSpeakerObjectID = 0
 
Common::Array< ScriptVariable_variables
 
MouseMode _cursorMode = MouseMode::Walk
 
MouseMode _cursorModeBeforeWait = MouseMode::Walk
 
bool _waitingForUiClick = false
 
uint16 _interactedObjectID = 0
 
uint16 _interactedInventoryItemId = 0
 
uint16 _walkTargetObjectIndex = 0
 
uint16 _scriptClickFlag = 0
 
uint16 _scriptClickX = 0
 
uint16 _scriptClickY = 0
 
uint16 _scriptClickResult = 0
 
uint16 _savedScriptClickFlag = 0
 
uint16 _savedScriptClickX = 0
 
uint16 _savedScriptClickY = 0
 
uint16 _savedScriptClickResult = 0
 
bool _inventoryCheckResult = false
 
bool _animBlobRangeTestResult = false
 
bool _soundEnabled = true
 
bool _scriptSkippable = false
 
bool _musicEnabled = true
 
bool _soundSystemActive = true
 
bool _overlayTextStageActive = false
 
bool _inventoryActionFlag = false
 
bool _inventoryCombineFlag = false
 
Common::Array< uint8 > _musicSlots [2]
 
uint16 _activeMusicSlot = 0
 
uint16 _musicControlMode = 0
 
uint16 _musicControlStep = 0
 
uint16 _musicControlVolume = 0
 
bool _waitForPcmSound = false
 
bool _waitForMusicControl = false
 
bool _waitForAdlibReady = false
 
bool _debugPaused = false
 
bool _pickupInProgress = false
 
uint16 _pickupActorObjectID = 0
 
uint16 _pickupTargetObjectID = 0
 
bool _isRunningScript = false
 
bool _isSkipping = false
 
Macs2::Macs2Engine_engine = nullptr
 
uint16 _scriptErrorCode = 0
 
uint32 _errorScriptPosition = 0
 
uint16 _errorScriptContext = 0
 

Detailed Description

Here is how the state of the script executor works We can have a scheduled run (which will execute the next tick) or we can run it right away A run can have the two global variables set on it, and therefore might require being run a second time A run can remain within one function call or it can have time-dependent phases during which execution is paused and we wait (e.g. a timed wait event) After the scene script, we iterate executingObjectId from 1 to 0x200, executing the script of each object that has runtime data allocated (confirmed from runScriptExecutor at 1008:e3e7).


The documentation for this class was generated from the following file: