#include <script.h>
Classes | |
| class | Provider |
Public Types | |
| enum | ReturnCode { RET_OK , RET_REDIRECTED , RET_STOP } |
| enum | State { STATE_UNLOADED , STATE_NORMAL , STATE_DONE , STATE_INPUT } |
| enum | InputType { INPUT_CHOICE , INPUT_NUMBER , INPUT_STRING , INPUT_DIRECTION , INPUT_PLAYER , INPUT_KEYPRESS } |
| enum | Action { ACTION_SET_CONTEXT , ACTION_UNSET_CONTEXT , ACTION_END , ACTION_REDIRECT , ACTION_WAIT_FOR_KEY , ACTION_WAIT , ACTION_STOP , ACTION_INCLUDE , ACTION_FOR_LOOP , ACTION_RANDOM , ACTION_MOVE , ACTION_SLEEP , ACTION_CURSOR , ACTION_PAY , ACTION_IF , ACTION_INPUT , ACTION_ADD , ACTION_LOSE , ACTION_HEAL , ACTION_CAST_SPELL , ACTION_DAMAGE , ACTION_KARMA , ACTION_MUSIC , ACTION_SET_VARIABLE , ACTION_ZTATS } |
Public Member Functions | |
| Script () | |
| void | addProvider (const Common::String &name, Provider *p) |
| bool | load (const Common::String &filename, const Common::String &baseId, const Common::String &subNodeName="", const Common::String &subNodeId="") |
| void | unload () |
| void | run (const Common::String &script) |
| ReturnCode | execute (Shared::XMLNode *script, Shared::XMLNode *currentItem=nullptr, Common::String *output=nullptr) |
| void | _continue () |
| void | resetState () |
| void | setState (State state) |
| State | getState () |
| void | setTarget (const Common::String &val) |
| void | setChoices (const Common::String &val) |
| void | setVar (const Common::String &name, const Common::String &val) |
| void | setVar (const Common::String &name, int val) |
| void | unsetVar (const Common::String &name) |
| Common::String | getTarget () |
| InputType | getInputType () |
| Common::String | getInputName () |
| Common::String | getChoices () |
| int | getInputMaxLen () |
An xml-scripting class. It loads and runs xml scripts that take information and interact with the game environment itself. Currently, it is mainly useful for writing vendor code; however, it should be possible to write scripts for other parts of the game.
A script return code
The current state of the script
The type of input the script is requesting
The action that the script is taking
| Ultima::Ultima4::Script::Script | ( | ) |
Constructs a script object
| void Ultima::Ultima4::Script::addProvider | ( | const Common::String & | name, |
| Provider * | p | ||
| ) |
Adds an information provider for the script
| bool Ultima::Ultima4::Script::load | ( | const Common::String & | filename, |
| const Common::String & | baseId, | ||
| const Common::String & | subNodeName = "", |
||
| const Common::String & | subNodeId = "" |
||
| ) |
Loads the vendor script
| void Ultima::Ultima4::Script::unload | ( | ) |
Unloads the script
| void Ultima::Ultima4::Script::run | ( | const Common::String & | script | ) |
Runs a script after it's been loaded
| ReturnCode Ultima::Ultima4::Script::execute | ( | Shared::XMLNode * | script, |
| Shared::XMLNode * | currentItem = nullptr, |
||
| Common::String * | output = nullptr |
||
| ) |
Executes the subscript 'script' of the main script
| void Ultima::Ultima4::Script::_continue | ( | ) |
Continues the script from where it left off, or where the last script indicated
| void Ultima::Ultima4::Script::resetState | ( | ) |
Set and retrieve property values