Skip to content
geckosoft edited this page Oct 7, 2010 · 13 revisions

The system is a mix of YAML definitions and (slightly modified) YJASL (Yet Just Another Scripting Language) scripts.

Scripting

YJASL (Yet Just Another Scripting Language)

Reference: http://yjasl.sourceforge.net/yjasl.php

By using a (currently) very buggy preprocessor, I have added support for 'object' function calls.

Aka, for example, it will convert Engine::Player->Name into Engine::Player.getName(Engine::Player)

Currently, make sure, when assigning, that you dont have " in the string afterwards (except to assign 1 non concat string) - Known bug!

Core namespaces / functions / methods / globals

Engine

void debug(message)

Prints 'message' to the debug log.

Player player

Stores a reference to the bot's Player object.

Actor actor

Stores a reference to the bot's PlayerActor object.

Player

The Actor namespace contains Player related functions

string getName(player)

string getRace(player)

Player[] getEnemies(player)

int getIndex(player)

int countActorsOwned(player, actorInfoName)

Actor

The Actor namespace contains Actor related functions

string getName(actor)

string getBuildQueue(actor)

int2 getLocation(actor)

Actor[] listOwned(actorName)

bool Move(actor, x, y)

Moves the specified (try) to location x, y.

  • Return 1 on success, otherwise 0

Brain

The Brain namespace contains Brain (Actor-specific AI) related functions

Actor getActor(brain)

void Clear(actor)

Clears the assigned Brain for the specified actor

ScriptedBrain Assign(actor, brain_id)

Assigns the given brain_id to the spcified actor. Make sure that the "Brains" namespace has the required mapped functions that you need.

  • Returns the created ScriptedBrain object

Order

The Order namespace contains Order related functions

Simple(Actor, orderString)

Subject(Actor, orderString, ActorSubject)

SubjectLocation(Actor, orderString, ActorSubject, x, y) -- NOT ADDED YET

Type

The Type (Type::*) namespace is a special case, meant to collect alot of utility functions (like Type::getX(int2) to get the X from an int2.

Should mostly not be called directly, but used (with for example: actor->Location->X)

Wrapped Objects

Usually OpenRA objects are 'wrapped' into a custom YJASL table. These are the 'possible' object 'types'

Player

Actor

Int2

Clone this wiki locally