General Discussion / Original Fantasy Script Commands
« on: February 06, 2008, 10:47:29 PM »There are a few types of script entries: actions, conditions, and assignments. Actions are simple things like "teleport to Corneria 35, 67" or "switch music to sadness theme." Conditions evaluate to true or false, and conditional expressions can combine multiple conditions using AND and OR logic operators. These may also include numeric expressions like "4 - Global.OrbsRestored" to determine how many orbs are remaining. Assignments assign values to variables, and can also include numeric expressions, such as "Global.OrbsRestored = Global.OrbsRestored + 1".
Regarding variables, each map will have its own namespace for organization, and the quest as a whole will have a global namespace. All variables from all maps in the quest will be loaded at runtime, so you can refer to variables in other namespaces using the syntax in the above example (Namespace.VariableName). Events will also have their own names and can be referred to in the same way.
High priority:
Numerical expression evaluation including +, -, *, /, %
Conditional expression evaluation including AND, OR, XOR, NOT, variable equalities and inequalities (=, !=, >, <, etc.)
Condition operator: Has Item
Assignment to variables
Control Flow:
Calling other scripts
If/Else branching
While loop
End of control block (to end an if-else-predicate or while loop)
Break, Continue (loop control)
Return from script
Action: Give/Take Items/Gold
Action: Teleport to Map, Location(x, y)
Action: Conversation(text)
Action: Enable/Disable Event
Action: Ship/Airship Appears at Map, Location(x, y)
Action: Add sprite at Location(x, y)
Action: Move sprite N/S/E/W
Action: Remove sprite
Action: Wait x seconds
Action: Fight Battle (domain d, battle b)
Action: Change map tile (x, y) to (tile data)
Lower priority:
Action: Start/Stop Music
Action: Play sound effect
Action: Perform graphics effects (mosaic, blur, whatever)
I'll keep updating this list as I think of stuff. Give me your suggestions and feedback please. :)