Cob Extensions - Calling scripts, shared data

Ext. ID Ext. Name Type Description
250 COB_QUERY_SCRIPT GET Calls script of other unit in query mode. You can pass 2 parameters. Returns modified Par1
Parameters: UnitID, ScriptID, Par1, Par2
251 COB_START_SCRIPT GET Calls script of other unit in "start-script" mode. You can pass 2 parameters. No return values are expected
Parameters: UnitID, ScriptID, Par1, Par2
ScriptID possible values:
Activate = 0
Deactivate = 1
Upgrade = 2
Reminder = 3
Cloak = 4
252 LOCAL_SHARED_DATA GET Can be used to share data between units, without need of calling their scripts. Array comes with predefined size of 1024 elements and is stored in game save files
Parameters: R/W (0 - read/1 - write), ElementId, NewValue (for writing)

Example for COB_QUERY_SCRIPT

Caller unit:

var rval
rval = get COB_QUERY_SCRIPT(TargetUnitID, 2, 10);
// rval now becomes 50

Target unit:

Upgrade(par1)
{
  // par1 is 10 at the moment
  // do something
  par1 = 50;
}