AddComFree
(
units : liste)
set of units receives free command
AddComGet
(
units : liste,
x : integer,
y : integer)
list of units receives simple get cargo command
AddComGive
(
units : liste,
un : integer)
list of units receives simple give cargo command
AddComHack
(
units : liste,
un : integer)
list of units receives hack command
AddComHeal
(
units : liste,
un : integer)
set of units receives heal specified unit command
AddComHiddenCamera
(
units : liste,
x : integer,
y : integer)
list of units receives place hidden camera
AddComHold
(
units : liste)
set of units receives hold command
AddComInvisible
(
units : liste)
list of units receives invisible command
AddComLinkTo
(
units : liste,
hum : integer)
set of vehicles receives link to specified human command
AddComLinkToBase
(
units : liste,
un : integer)
depot or warehouse receives command to link building un to the base
AddComMoveToArea
(
units : liste,
area : integer)
set of units receives move command to specified area
AddComMoveUnit
(
units : liste,
un : integer)
set of units receives move command to specified unit
AddComMoveXY
(
units : liste,
x : integer,
y : integer)
set of units receives move command to specified coordinates
AddComPause
(
units : liste)
set of buildings receives pause research or construction command
AddComPlaceDelayedCharge
(
units : liste,
x : integer,
y : integer,
un : integer)
set of units receives command for place explosives to [x,y] or near unit un
AddComPlaceRemoteCharge
(
units : liste,
x : integer,
y : integer,
un : integer)
set of units receives command for place explosives to [x,y] or near unit un
AddComPlaceWeapon
(
units : liste,
weap : integer)
list of turrets and bunkers receives place specified weapon command
AddComRecycle
(
units : liste,
un : integer)
list of vehicles receives command to recycle in building un
AddComRefuel
(
units : liste,
un : integer)
list of units receives refuel command
AddComRemember
(
units : liste)
set of units receives remember command
AddComRepairBuilding
(
units : liste,
un : integer)
set of units receives repair specified building command
AddComRepairVehicle
(
units : liste,
un : integer)
set of units receives repair specified vehicle command
AddComResearch
(
units : liste,
techn : integer)
set of labs receives research technology techn command
AddComReturn
(
units : liste)
set of units receives return command
AddComSabre
(
units : liste)
list of sheiks receives SabreOn command
AddComSailEvent
(
units : liste,
num : integer)
unit raises generic event SailEvent(num)
AddComSpaceShift
(
units : liste,
x : integer,
y : integer)
list of units receives command to use spaceshifting grenade
AddComStand
(
units : liste)
set of units receives stand command
AddComStop
(
units : liste)
set of units receives stop command
AddComTameXY
(
units : liste,
x : integer,
y : integer)
set of units receives tame command
AddComTeleportExit
(
units : liste,
x : integer,
y : integer,
un : integer)
list of units receives command for place exit of teleport un to [x,y]
AddComTimeShift
(
units : liste,
x : integer,
y : integer)
list of units receives command to use timeshifting grenade
AddComTransport
(
units : liste,
un : integer,
mattype : integer)
list of units receives transport command
AddComTurnUnit
(
units : liste,
un : integer)
set of units receives turn command to specified unit
AddComTurnXY
(
units : liste,
x : integer,
y : integer)
set of units receives turn command to specified coordinates
AddComUnlink
(
units : liste)
set of vehicles receives unlink command
AddComUnload
(
units : liste)
list of units receives cargo unload command
AddComUpgrade
(
units : liste)
list of units receives command upgrade
AddComUpgradeLab
(
units : liste,
labtype : integer)
list of units receives command upgrade to specified laboratory
AddComWait
(
units : liste,
time : integer)
set of units receives wait command
AddComWalk
(
units : liste)
set of units receives walk command
AddCopyTasks
(
un_dest : integer,
un_source : integer)
copy tasks from unit un_source to unit_dest (adding, no patrol)
AddExperience
(
hum : integer,
sk : integer,
points : integer)
adds experience points in skill sk to human hum
AddMcUnits
(
mcid : integer,
units : liste)
changes list of units of the macro mcid; returns true if succesfull
AddMcUnitsSpec
(
mcid : integer,
units : liste,
spec : integer)
changes spec list of units of the macro mcid; returns true if succesfull
AddMedal
(
ident : string,
number : integer)
if number>0 then adds [ident,number] item to gained_medals if number<0 then adds [ident,-number] item to missing_medals
AddMusic
(
ident : string)
after current music track stops the new is played
AddResourceType
(
base : integer,
mattype : integer,
amount : integer)
adds resource of specified type to the specified base
AddTaskList
(
un : integer,
list : liste)
adds tasks from tasklist (GetTaskList format) - use carefully!
AllNearestUnitToUnit
(
units : liste,
un : integer)
Returns all nearest unit from list units to unit un (ignoring un itself), or zero
AreaToMatrix
(
area : integer)
creates a matrix from the area
ArtContamination
(
x : integer,
y : integer,
percentage : integer)
makes contaminated area (percentage of siberite rocket contamination)
Attacks
(
un : integer)
returns number of unit which is curently attacked by unit un (aiming counts as attack), or zero
AvailableChassisList
(
un : integer)
returns list of available components (chassis) - factory, workshop
AvailableControlList
(
un : integer)
returns list of available components (controls) - factory, workshop
AvailableEngineList
(
un : integer)
returns list of available components (engines) - factory, workshop
AvailableWeaponList
(
un : integer)
returns list of available components (weapons) - factory, workshop, turret
BestFromListByList
(
items : variable,
values : variable)
Returns SortListByListDesc(items,values)[1], or zero iv values is empty. Faster than SortListByListAsc
BuildingsInProgress
(
side : integer)
returns true if construction of any buildings of specified side isn't finish
BuildingStatus
(
un : integer)
returns building status (bs_???)
BuildQuery
(
q : string,
al : liste)
Displays query dialog with question q and list of answers al
CanBeConstructed
(
factory : integer,
chassis : integer,
engine : integer,
control : integer,
weapon : integer)
returns if vehicle can be constructed in factory
CanBeResearched
(
labor : integer,
tech : integer)
returns if tech can be researched in lab (if tech is already researched, returns false)
CanCarry
(
un : integer)
returns true if unit is engineer or cargo holder
CanCarryHowMuch
(
un : integer)
returns how much material can unit still carry
CanCarryNext
(
un : integer)
returns true if unit is not full
Carry
(
un : integer)
returns true if unit carries something
CenterNowOnUnits
(
units : liste)
centers immediatelly screen to specified group of units
CenterNowOnXY
(
x : integer,
y : integer)
centers immediatelly screen on specified coordinates
CenterOnUnits
(
units : liste)
centers screen to specified group of units with scrolling
CenterOnXY
(
x : integer,
y : integer)
centers screen on specified coordinates with scrolling
ChangeBattleFlagSide
(
flagid : integer,
side : integer)
changes side of existing battleflag
ChangeMap
(
ident : string,
fname : string)
changes map, ident identifies text while loading, fname is name of the map in the same directory (without path)
ChangeMissionObjectives
(
ident : string)
change mission objectives, s is ident in Texts.txt
ChangeResourceAmountXY
(
x : integer,
y : integer,
n : integer)
changes amount of existing resources on specified hex
ChangeSideFog
(
side : integer,
fognumber : integer)
set fog of specified side to specified fognumber
CharacterSelection
(
ident : string,
min : integer,
max : integer,
units : liste,
classes : liste)
Displays Character selection menu and returns list of characters selected by player - ident is identifier of caption from Texts.txt - min and max are minimum and maximum number of hired character to close dialog - units is list of units, which can contain special commands which affects all following units: sel_hired - following character are hired at start (default) sel_not_hired - following character are not hired at start sel_changeable - player can fire/hire following characters sel_not_changeable - player cannot fire/hire following characters (default) sel_change_class - player can change class of following characters sel_dont_change_class - player cannot change class of following characters (default) sel_ignore_class_nation - following characters can be changed to class indepedning its nation sel_dont_ignore_class_nation - following characters can be changed only to classes of its nation (default) - classes is list of posibly classes to which can be units changed. Every items may be in two formats: class_number - this class can be used without limitations [class_number,min] - you must select at least min characters with this class [class_number,min,max] - you must select min to max characters with this class Example1 (select up to five mechanic and soldiers from gamma2 and gamma3): CharacterSelection('S1',1,6, [JMM, sel_not_hired, sel_changeable] ^ gamma2 ^ gamma3, [class_soldier, class_mechanic]); Example2 (select up to five men from gamma2 to help John and Tim build a base) CharacterSelection('S2',3,7, [sel_changeable, JMM, sel_not_changeable, Tim, sel_not_hired, sel_changeable] ^ gamma2, [class_soldier, class_mechanic, [class_engineer,1], class_scientistic]);
CheckCharacterSet
(
ident : string)
Returns number of characters in character set from the save (if there is an empty set in the save, CheckCharacterSet returns 0, but TestCharacter returns true)
ClearMcUnits
(
mcid : integer)
clears list of units of the macro mcid; returns true if succesfull
ClearMcUnitsSpec
(
mcid : integer,
spec : integer)
clears spec list of units of the macro mcid; returns true if succesfull
ComAgressiveMove
(
units : liste,
x : integer,
y : integer)
set of units receives agressive move command to specified coordinates
ComAnim
(
units : liste,
atype : integer)
list of units receives do specified animation command
ComAttackPlace
(
units : liste,
x : integer,
y : integer)
set of units receives attack command to specified coordinates
ComAttackSoporific
(
units : liste,
un : integer)
attack unit un with soporific amunition
ComAttackUnit
(
units : liste,
un : integer)
set of units receives attack command to specified unit
ComBuild
(
units : liste,
bud : integer,
x : integer,
y : integer,
dir : integer)
set of units receives build command
ComBuildBehemoth
(
units : liste,
bud : integer,
x : integer,
y : integer,
dir : integer)
set of units receives build behemoth command
ComCancel
(
units : liste)
set of buildings receives cancel research or construction command
ComCarabine
(
units : liste)
list of sheiks receives CarabineOn command
ComChangeProfession
(
units : liste,
new_prof : integer)
set of units receives change profession to new_prof command
ComCollect
(
units : liste,
x : integer,
y : integer)
set of units receives collect command to specified coordinates
ComConstruct
(
units : liste,
chassis : integer,
engine : integer,
control : integer,
weapon : integer)
set of factories receives construct vehicle with specified components command
ComContaminate
(
units : liste,
x : integer,
y : integer)
list of units receives contaminate siberite deposit
ComCrawl
(
units : liste)
set of units receives crawl command
ComDismantle
(
units : liste,
un : integer)
list of units receives command to dismantle building un
ComEnterUnit
(
units : liste,
un : integer)
set of units receives enter specified unit command
ComExitBuilding
(
units : liste)
set of units receives exit building command
ComExitVehicle
(
units : liste)
set of units receives exit vehicle command
ComFireExplosives
(
units : liste)
set of units receives fire remote controlled explosives command
ComForceInvisible
(
units : liste)
list of units receives invisible command
ComFree
(
units : liste)
set of units receives free command
ComGet
(
units : liste,
x : integer,
y : integer)
list of units receives simple get cargo command
ComGive
(
units : liste,
un : integer)
list of units receives simple give cargo command
ComHack
(
units : liste,
un : integer)
list of units receives hack command
ComHeal
(
units : liste,
un : integer)
set of units receives heal specified unit command
ComHiddenCamera
(
units : liste,
x : integer,
y : integer)
list of units receives place hidden camera
ComHold
(
units : liste)
set of units receives hold command
ComInvisible
(
units : liste)
list of units receives invisible command
ComLinkTo
(
units : liste,
hum : integer)
set of vehicles receives link to specified human command
ComLinkToBase
(
units : liste,
un : integer)
depot or warehouse receives command to link building un to the base
ComMoveToArea
(
units : liste,
area : integer)
set of units receives move command to specified area
ComMoveUnit
(
units : liste,
un : integer)
set of units receives move command to specified unit
ComMoveXY
(
units : liste,
x : integer,
y : integer)
set of units receives move command to specified coordinates
ComPause
(
units : liste)
set of buildings receives pause research or construction command
ComPlaceDelayedCharge
(
units : liste,
x : integer,
y : integer,
un : integer)
set of units receives command for place explosives to [x,y] or near unit un
ComPlaceRemoteCharge
(
units : liste,
x : integer,
y : integer,
un : integer)
set of units receives command for place explosives to [x,y] or near unit un
ComPlaceWeapon
(
units : liste,
weap : integer)
list of turrets and bunkers receives place specified weapon command
ComRecycle
(
units : liste,
un : integer)
list of vehicles receives command to recycle in building un
ComRefuel
(
units : liste,
un : integer)
list of units receives refuel command
ComRemember
(
units : liste)
set of units receives remember command
ComRepairBuilding
(
units : liste,
un : integer)
set of units receives repair specified building command
ComRepairVehicle
(
units : liste,
un : integer)
set of units receives repair specified vehicle command
ComResearch
(
units : liste,
techn : integer)
set of labs receives research technology techn command
ComReturn
(
units : liste)
set of units receives return command
ComSabre
(
units : liste)
list of sheiks receives SabreOn command
ComSailEvent
(
units : liste,
num : integer)
unit raises generic event SailEvent(num)
ComSpaceShift
(
units : liste,
x : integer,
y : integer)
list of units receives command to use spaceshifting grenade
ComStand
(
units : liste)
set of units receives stand command
ComStop
(
units : liste)
set of units receives stop command
ComTameXY
(
units : liste,
x : integer,
y : integer)
set of units receives tame command
ComTeleportExit
(
units : liste,
x : integer,
y : integer,
un : integer)
list of units receives command for place exit of teleport un to [x,y]
ComTimeShift
(
units : liste,
x : integer,
y : integer)
list of units receives command to use timeshifting grenade
ComTransport
(
units : liste,
un : integer,
mattype : integer)
list of units receives transport command
ComTurnUnit
(
units : liste,
un : integer)
set of units receives turn command to specified unit
ComTurnXY
(
units : liste,
x : integer,
y : integer)
set of units receives turn command to specified coordinates
ComUnlink
(
units : liste)
set of vehicles receives unlink command
ComUnload
(
units : liste)
list of units receives cargo unload command
ComUpgrade
(
units : liste)
list of units receives command upgrade
ComUpgradeLab
(
units : liste,
labtype : integer)
list of units receives command upgrade to specified laboratory
ComWait
(
units : liste,
time : integer)
set of units receives wait command
ComWalk
(
units : liste)
set of units receives walk command
Constructable
(
chas : integer,
eng : integer,
con : integer,
weap : integer)
returns true, if vehicle constructable
ContactTime
(
sides : liste)
time from last contact (parameter: side, or [side1,side2])
Contaminate
(
side : integer,
x : integer,
y : integer)
immediatelly contaminates siberite deposit; if succesfull, (raises event and) returns true
CopySkills
(
un1 : integer,
un2 : integer)
copies skills between units (un1->un2)
CopyTasks
(
un_dest : integer,
un_source : integer)
copy tasks from unit un_source to unit_dest (replacing, no patrol)
CostOfBuilding
(
kind : integer,
nation : integer)
returns cost in list [cans,oil,sib]
CostOfVehicle
(
chassis : integer,
engine : integer,
control : integer,
weapon : integer)
returns cost in list [cans,oil,sib]
CostOfWeapon
(
weapon : integer)
returns cost in list [cans,oil,sib]
Crawls
(
units : liste)
returns number of crawling units in list (0=false)
CreateAndPlaceBuildingXYD
(
x : integer,
y : integer,
direction : integer)
Creates a building using uc_ and bc_ parameters
CreateBuilding
()
Creates a building using uc_ and bc_ parameters
CreateCharacter
(
ident : string)
Shortcut for CreateOneCharacterFromSet(ident,1)
CreateCharacterSet
(
ident : string)
Loads a set of characters with specified ident from the save Creates people from it (except dead characters) using some uc_side and returns set of its handles
CreateCratesXY
(
amount : integer,
x : integer,
y : integer,
materialisation : boolean)
CreateCratesXYR
(
amount : integer,
x : integer,
y : integer,
r : integer,
materialisation : boolean)
CreateDepositXY
(
x : integer,
y : integer,
typ : integer)
creates deposit of mat_siberite or mat_oil type on specified coordinates
CreateHuman
()
Creates human using uc_ and hc_ parameters
CreateOneCharacterFromSet
(
ident : string,
index : integer)
Same as CreateCharacterSet, but only one unit is created (the one with specified index in the set)
CreateOneCharacterFromSetWithClass
(
ident : string,
index : integer,
cl : integer)
Same as CreatePeopleFromCharacterSet, but character gets specified class
GetAttr
(
units : liste,
attr : integer)
returns average attribute attr of specified human units
GetBase
(
un : integer)
returns base of specified building (or zero, if it is not building)
GetBattleFlagSide
(
flagid : integer)
returns side of existing battleflag
GetBLevel
(
un : integer)
returns level of building, if un is not a building, returns -1
GetBType
(
un : integer)
returns type of building, if un is not a building, returns -1
GetBuildingTechReq
(
kind : integer,
nation : integer)
returns technology required to building of kind, nation (0 - free; -1 - not available to nation)
GetBuildList
(
base_or_list : variable)
creates BuildList from whole base or list of units (buildings)
GetBWeapon
(
un : integer)
returns type of weapon (in case of turret or bunker, zero otherwise)
GetCargo
(
units : liste,
mattype : integer)
returns (total) amount of mattype
GetCargoType
(
units : liste)
returns type of cargo (mat_none, mat_cans, mat_oil, mat_siberite, mat_multi)
GetChassis
(
un : integer)
returns type of vehicle chassis
GetClass
(
un : integer)
returns class of specified human unit
GetControl
(
un : integer)
returns type of vehicle control
GetCustomRate
(
basicrate : integer,
tab : integer,
skill : integer)
returns basicrate bonused (or penalized) by skill (-10..50) using skilltable tab (0..6) Usually used skills are 0..10. Table 0 gives no bonus, table 6 gives biggest bonus. e.g. scientist's research rate is GetCustomRate(zaklad,4,GetSkill(human,skill_scentistic))
GetDir
(
un : integer)
returns direction of a unit
GetDistUnitArea
(
un : integer,
area : integer)
returns distance of a unit and the closest hex in the area (0 if it is in area)
GetDistUnits
(
un1 : integer,
un2 : integer)
returns distance of two units, 99999 if one or both of them aren't on the map
GetDistUnitXY
(
un1 : integer,
x : integer,
y : integer)
returns distance of a unit and a hex, 99999 if unit isn't on the map
GetDistXY
(
x1 : integer,
y1 : integer,
x2 : integer,
y2 : integer)
returns distance of two hexes
GetEnergy
(
base : integer)
returns list of power values: [need,needmax,prod,prodmax]
GetEngine
(
un : integer)
returns type of vehicle engine
GetExtPositions
(
un : integer)
returns list of factory extensions positions [[x,y],[x,y],[x,y],[x,y],[x,y]]
GetFreeMode
(
un : integer)
returns true if unit is in free mode
GetFuel
(
units : liste)
returns average fuel of specified combustion or solar vehicles list
InGameOff
()
function, which: restore tick, switch ingame_video to false, set ExclusiveOff
InGameOn
()
function, which: store tick, switch ingame_video to true, set ExclusiveOn
InitBc
()
Initializes building create structure to default values
InitHc
()
Initializes human create structure to default values
InitUc
()
Initializes unit create structure to default values
InitVc
()
Initializes vehicle create structure to default values
Insert
(
list : liste,
index : integer,
item : variable)
inserts item to list at specified position (1 - before first, n - before n-th), returns result if index>n+1 (n=length of list), then positions n+2 to index-1 are filled by undef value
InsertMusic
(
ident : string)
stops current music and play new, then starts current again
IsAt
(
un : integer,
x : integer,
y : integer)
returns true if unit is at specified coordinates
IsBusy
(
un : integer)
returns true if unit has a tasks (even its own)
IsConstructed
(
build : integer)
returns nonzero number, if build is building under construction or if it is upgraded
IsControledBy
(
veh : integer)
returns number of driver of a remote controlled vehicle, zero otherwise
IsDead
(
un : integer)
returns true if unit is dead (lives on zero or totally destroyed)
IsDrivenBy
(
veh : integer)
returns number of driver of a human controlled vehicle, zero otherwise
IsDying
(
un : integer)
returns true if unit is on map and dying
IsEnvironment
(
x : integer,
y : integer)
returns true if there is an environment on x, y
IsIdle
(
un : integer)
returns true if unit does nothing
IsInArea
(
un : integer,
area : integer)
returns true if unit is in specified area (it can be driving or inside)
IsInUnit
(
hum : integer)
returns number of unit in which a unit is or zero
IsLive
(
un : integer)
returns true if unit is on map and not dead
IsOK
(
un : integer)
returns true if unit is on map and not dying
IsPlaced
(
un : integer)
returns true if unit un is placed
IsSelected
(
units : liste)
returns true if selected
IsTamedBy
(
un : integer)
returns number of tamer of this animal, zero otherwise
KillBattleFlag
(
flagid : integer)
removes battle flag flagid (returns true if succesfull)
KillMc
(
mcid : integer)
if macro mcid exists, closes macro and returns true; otherwise returns false
KillUnit
(
un : integer)
Kills specified unit by setting its lives to zero
LaunchMine
(
number : integer)
explosion of remote mine, that was placed by PlaceMine Rumun: DO NOT USE number, it changes
LaunchMineAtPos
(
x : integer,
y : integer,
side : integer)
launch mine at pos x, y, that was placed by PlaceMine
LinkVehicleToHuman
(
veh : integer,
hum : integer)
Links vehicle to a human in Control tower
ListEnvironmentArea
(
area : integer)
returns list of environments in area; [[x,y,envset,num],...]
LoadVariable
(
ident : string,
default : variable)
Loads a variable with specified ident from the save (or default if ident is not found)
McAttack
(
prior : integer,
regid : integer,
units : liste,
options : liste)
runs McAttack macro and returns mcid There must be running McRegistry macro to start McAttack - enemies are registred by this McRegistry. McAttack starts after each registration of this McRegistry.
McBase
(
prior : integer,
units : liste,
build : liste,
research : liste,
construct : liste,
options : liste)
runs macro and returns mcid build must be BuildList, researchs - list of techs, construct - not implemented
McCustom
(
prior : integer,
units : liste)
runs void macro and returns mcid
McDefend
(
prior : integer,
regid : integer,
units : liste,
options : liste)
runs McDefend macro and returns mcid There must be running McRegistry macro to start McDefend - enemies are registred by this McRegistry. McDefend starts after each registration of this McRegistry. Parameters: [mc_def_advantage, percent] ... how great advantage over enemy is enough (default 200, twice) [mc_area_dont_leave, defarea] ... area where must all defenders be (default none) (-)mc_change_to_soldiers ... set here if McDefend can switch people to soldiers (-)mc_change_to_mechanics... set here if McDefend can switch people to mechanics
McMove
(
prior : integer,
units : liste,
waypoints : liste,
options : liste)
runs macro and returns mcid informace u Pedra
McPatrol
(
prior : integer,
regid : integer,
units : liste,
options : liste)
runs McPatrol macro and returns mcid There must be running McRegistry macro to start McPatrol - enemies are registred by this McRegistry. McPatrol starts after each registration of this McRegistry.
McRegistrationResultChanges
(
mcid : integer,
count : integer,
strength : integer)
Value of strength has no real meaning, use it only for comparation with another result of macro or for comparation with zero. Posible options (note that defarea can be given in two formats, as 'areanumber' or as '[x,y,r]'):
[mc_reg_refresh_time, ticks] ... interval between two registrations (default 0$1)
[mc_reg_area_to_guard, defarea] ... registries enemies in defined area (default none)
[mc_reg_area_to_protect, defarea] ... registries enemies attacking units in specified area (default none)
[mc_reg_units_to_protect, listofunits] ... registries enemies attackign specified units (default none)
[mc_reg_units_to_guard, listofunits] ... registries specified enemies (default none)
[mc_reg_expire_stops_to_attack, ticks] ... how long after enemy stops to attack the registration expires (default 0$3)
[mc_reg_expire_leaves_area, ticks] ... how long after enemy leaves area the registration expires (default 0$2)
(-)mc_reg_ignore_fog ... ignores fog so you can see all enemies in area (default false)
(-)mc_reg_only_important ... doesn't raise event if result changes from nonzero value to another nonzero value (default false)
McRegistry
(
side : integer,
options : liste)
Runs macro for automatic registration of enemies of side in specified intervals and returns mcid. Every registration gives count and strength of all registered units as its result. If registration returns different result than a previous (or nonzero in first registration), it raises event: McRegistrationResultChanges(mcid,count,strength). Value of strength has no real meaning, use it only for comparation with another result of macro or for comparation with zero. Posible options (note that defarea can be given in two formats, as 'areanumber' or as '[x,y,r]'): [mc_reg_refresh_time, ticks]... interval between two registrations (default 0$1) [mc_reg_area_to_guard, defarea]... registries enemies in defined area (default none) [mc_reg_area_to_protect, defarea] ... registries enemies attacking units in specified area (default none) [mc_reg_units_to_protect, listofunits] ... registries enemies attackign specified units (default none) [mc_reg_units_to_guard, listofunits] ... registries specified enemies (default none) [mc_reg_expire_stops_to_attack, ticks] ... how long after enemy stops to attack the registration expires (default 0$3) [mc_reg_expire_leaves_area, ticks]... how long after enemy leaves area the registration expires (default 0$2) (-)mc_reg_ignore_fog ... ignores fog so you can see all enemies in area (default false) (-)mc_reg_only_important ... doesn't raise event if result changes from nonzero value to another nonzero value (default false)
McRegistryChangeOptions
(
mcid : integer,
options : liste)
changes options of McRegistry with ident mcid
McRepair
(
prior : integer,
units : liste,
others : liste,
options : liste)
runs McRepair macro and returns mcid units will be maintain others (and extras from McWithdraw); options - [[mcr_hum_area, area], [mcr_veh_area, area], (-)mcr_area_only, [mcr_safety, 7], [mcr_hum_limit, 600], [mcr_veh_limit, 1000], [mcr_bui_limit, 1000], [mcr_repv_area, area], [mcr_capv_area, area], [mcr_repb_area, area], [mcr_capb_area, area]]
McSAddFortification
(
mcid : integer,
kinds : liste,
weapons : liste)
create new fortification definition for McSkirmish mcid, returns number of definition
McSAddVehicles
(
mcid : integer,
weapons : liste,
chassis : liste,
engines : liste,
controls : liste,
parkingarea : integer)
creates new vehicle definition for McSkirmish mcid, returns number of group
McSChangeFortification
(
mcid : integer,
number : integer,
kinds : liste,
weapons : liste)
updates fortification definition for McSkirmish mcid, definition number
McSChangeVehicles
(
mcid : integer,
number : integer,
weapons : liste,
chassis : liste,
engines : liste,
controls : liste,
parkingarea : integer)
updates vehicle definition for McSkirmish mcid, group number
McSConditionalStrategyFilter
(
str : liste)
filters conditional strategy to strategy without conditions (main strategy list)
McSGetVehList
(
mcid : integer,
number : integer)
returns list of vehicles in group number
McSParking
(
mcid : integer,
veh : liste,
park : boolean)
changes list of parking vehicles; veh will be added (park=true) or removed (park=false)
McSSetPosList
(
mcid : integer,
list : liste)
sets building position list for McSkirmish mcid
McSSetStrategy
(
mcid : integer,
list : liste)
sets main strategy list for McSkirmish mcid
McWithdraw
(
prior : integer,
repid : integer,
units : liste,
options : liste)
runs McWithdraw macro and returns mcid; there should be running McRepair first options - [[mcw_hum_lo, 400], [mcw_hum_hi, 800], [mcw_veh_lo, 400], [mcw_veh_hi, 1000], [mcw_hum_area, defarea], [mcw_veh_area, defarea], [mcw_corpse_area, defarea]] areas will be copied from McRepair of repid before evaluating this options
MineAtPos
(
x : integer,
y : integer)
returns true, if it is mine at pos x, y; otherwise false
MineExplosion
(
x : integer,
y : integer,
wound : integer)
explosion of mine at x, y
MineOfUnit
(
un : integer)
returns [x,y], if unit has placed remote charge; otherwise returns false
MoveAreaXY
(
area : integer,
x : integer,
y : integer)
moves area, left upper corner of deltoid is at specified coordinates
Msg
(
m : string)
Shortcut to BuildQuery(m,['OK']);
MultiplayerCRC
()
sends a multiplayer control message (vlada)
MultiplayerSideAlive
(
side : integer)
returns true, if there is at least one player playing this side
MultiRand
(
min : integer,
max : integer,
n : integer)
random number in selected range, made by n Rand
MusicIsPlaying
(
res : variable)
returns true if music is playing
NearestUnitToUnit
(
units : liste,
un : integer)
Returns nearest unit from list units to unit un (ignoring un itself), or zero
NearestUnitToXY
(
units : liste,
x : integer,
y : integer)
Returns nearest unit from list units to position (x,y), or zero if units is empty
NewCharacter
(
ident : string)
Loads and create a new global character (which was never saved before), returns its handle
NormalAttack
(
side : integer,
un : integer)
zruseni speciality pro stranu side na jednotku un
OpenCampaignFile
(
fname : string)
opens campaign file fname.txt in mission directory and loads data (use only for debuging)
PlaceEnvironment
(
x : integer,
y : integer,
envset : integer,
num : integer)
creates environment num from set envset on x, y
PlaceEnvironmentList
(
list : liste)
creates environments; [[x,y,envset,num],[x,y,envset]...]; num may not be defined
PlaceHumanInUnit
(
hum : integer,
un : integer)
Places unplaced human into a placed or unplaced unit
PlaceMine
(
x : integer,
y : integer,
side : integer,
typ : integer)
place mine at pos x, y. typ=0 - remote mine (result number of mine), typ>0 (timed mine - time in tick (1..100))
PlaceRandEnvironment
(
x : integer,
y : integer,
envset : integer)
creates random environment from set envset on x, y
PlaceSeeing
(
x : integer,
y : integer,
side : integer,
range : integer)
places area of seeing (negative range for radar seeing)
PlaceTreesToArea
(
area : integer,
sets : liste,
count : integer,
trials : integer,
dist : integer)
creates count trees in area, set selects randomly from list of sets for each tree makes some amount of trials and selects the one with less other trees within dist note than tree in distance 1 is twice worse than tree in distance 2 etc.
PlaceUnitAnywhere
(
un : integer,
materialisation : boolean)
Places unit anywhere on map, returns true if succeedes If materialisation is true, unit is materialised
PlaceUnitArea
(
un : integer,
area : integer,
materialisation : boolean)
Places unit into specified area, returns true if succeedes If materialisation is true, unit is materialised
PlaceUnitXY
(
un : integer,
x : integer,
y : integer,
materialisation : boolean)
Places unit at specified coordinates, returns true if succeedes If materialisation is true, unit is materialised
PlaceUnitXYR
(
un : integer,
x : integer,
y : integer,
r : integer,
materialisation : boolean)
Places unit near specified coordinates (max. dist is r), returns true if succeedes If materialisation is true, unit is materialised
PlaceWeaponTurret
(
un : integer,
bc_weapon : integer)
place bc_weapon on turet or bunker un
PlayMusic
(
ident : string)
stops current music and play new
PlayMusicNoLoop
(
ident : string)
stops current music and play new, no other is played after this new ends
PlaySoundXY
(
x : integer,
y : integer,
ident : string)
plays sound with ident from coordinates x, y
PrepareAttr
(
sex : integer)
prepares random attributes for specified sex (or common, if zero)
PrepareCharacter
(
ident : string)
Shortcut for PrepareOneCharacterFromSet(ident,1)
PrepareClassSkills
(
cl : integer,
level : integer)
prepares skills for human with class cl (this skill is near specified level) negative level means that this human is specialist
PrepareCustomSkills
(
list : liste)
prepares randomly skills for human creating, give list of four levels as a parameter: if one of parameters is negative, then this skill counts as basic
PrepareEngineer
(
sex : integer,
lev : integer)
prepares parameters for a engineer with specified sex and level (0=random for sex)
PrepareEngineerSkills
(
level : integer)
prepares skills for engineer, main skill is near specified level (uses PrepareClass)
PrepareHuman
(
sex : integer,
cl : integer,
lev : integer)
prepares parameters for a human with specified sex, class and level (0=random for sex or class) negative level means that this human is specialist
PrepareMechanic
(
sex : integer,
lev : integer)
prepares parameters for a mechanic with specified sex and level (0=random for sex)
PrepareMechanicSkills
(
level : integer)
prepares skills for mechanic, main skill is near specified level (uses PrepareClass)
PrepareNewCharacter
(
ident : string)
Prepares hc_ and uc_ structures for a new global character (which was never saved before)
PrepareOneCharacterFromSet
(
ident : string,
index : integer)
Same as CreateOneCharacter, but character is only prepared (not created yet), returns true if succeeds
PrepareScientist
(
sex : integer,
lev : integer)
prepares parameters for a scientist with specified sex and level (0=random for sex)
PrepareScientistSkills
(
level : integer)
prepares skills for scientist, main skill is near specified level (uses PrepareClass)
PrepareSoldier
(
sex : integer,
lev : integer)
prepares parameters for a soldier with specified sex and level (0=random for sex)
PrepareSoldierSkills
(
level : integer)
prepares skills for soldier, main skill is near specified level (uses PrepareClass)
PriorityAttack
(
side : integer,
un : integer)
prioritni utok strany side na jednotku un
Prob
(
per : integer)
returns true on per percent (Rand(1,100)<=per)
Query
(
ident : string)
Displays query dialog defined in texts, returns number of answer (1..n)
RaiseSailEvent
(
num : integer)
raises immediately generic event SailEvent(num)
Rand
(
min : integer,
max : integer)
random number in selected range
RandHex
(
border : boolean)
returns coordinate of random hex anywhere on map in format [x,y] if border is true, then bordering hexes can be included
RandHexArea
(
area : integer,
border : boolean)
returns coordinate of random hex in specified area in format [x,y] (or 0 if fails) if border is true, then bordering hexes can be included
RandHexXYR
(
x : integer,
y : integer,
r : integer,
border : boolean)
returns coordinate of random not invalid hex near to xy (max. dist is R) in format [x,y] (or 0 if fails) if border is true, then bordering hexes can be included
RemoveEnvironmentWithoutRebuild
(
x : integer,
y : integer)
removes environment on x, y, don't count parameters, use only if normal RemoveEnviroment follows
RemoveMcUnits
(
mcid : integer,
units : liste)
changes list of units of the macro mcid; returns true if succesfull
RemoveMcUnitsSpec
(
mcid : integer,
units : liste,
spec : integer)
changes spec list of units of the macro mcid; returns true if succesfull
RemoveMineOfUnit
(
un : integer)
removes placed remote charge of unit, if exists
RemoveSeeing
(
x : integer,
y : integer,
side : integer)
removes area of seeing (all matching areas)
RemoveTasks
(
units : liste)
removes all tasks of units
RemoveUnit
(
un : integer)
Removes specified unit from map
Replace
(
list : liste,
index : integer,
item : variable)
replaces item of list with specified index with another, returns result if index>n (n=length of list), then positions n+1 to index-1 are filled by undef value
ReplaceEnvironment
(
x : integer,
y : integer,
envset : integer,
num : integer)
replaces environment on x, y by element num from set
Researched
(
side : integer,
tech : integer)
returns true if tech is researched (obsolete)
ResetFog
(
res : variable)
resets fog of war of all sides to black
ResetMultiScore
(
res : variable)
resets multiplayer score for all sides
RevealFogArea
(
side : integer,
area : integer)
reveals fog for specified side in specified area
RewardPeople
(
humans : liste)
gives mission reward to list of human characters (use before save)
SaveCampaignFile
(
fname : string)
saves actualised campaign file to fname.txt in mission directory (use only for debuging)
SaveCharacters
(
humlist : liste,
ident : string)
Saves set of human characters to the output save and gives it specified ident For special characters use: SaveCharacters(handle,name) in one mission and handle:=CreateCharacter(name) in the next mission For survived people from previous mission use SaveCharacters(set,name) in one mission and set:=CreateCharacterSet(name) in the next mission
SaveForQuickRestart
()
use it after ingame videos and character selection - quick restart will start from this point
SaveVariable
(
v : variable,
ident : string)
Saves variable to the save with specified ident
Say
(
un : integer,
ident : string)
Specified unit says sentence identified by ident
SayEffect
(
ident : string)
Say effect identified by ident
SayNoFace
(
un : integer,
ident : string)
Specified unit says sentence identified by ident, it's face not appears
SayNoName
(
un : integer,
ident : string)
Specified unit says sentence identified by ident, it's name doesn't appear - use for enemies
SayRadio
(
un : integer,
ident : string)
Specified unit says over radio sentence identified by ident, use for off map units
SayRadioNoName
(
un : integer,
ident : string)
Specified unit says over radio sentence identified by ident, it's name doesn't appear
See
(
side : integer,
un : integer)
returns true if side sees specified unit
SeeArea
(
side : integer,
area : integer)
returns how much hexes of specified area side sees
SeeGreyArea
(
side : integer,
area : integer)
returns how much hexes of specified area side sees + gray hexes
SeeXY
(
side : integer,
x : integer,
y : integer)
returns how good side sees specified hex
SelectiveQuery
(
ident : string,
list : liste)
Displays query dialog defined in texts, returns number of answer (1..n) List contains numbers of items which will be shown
SelectUnits
(
units : liste)
add selection to units
SendSiberiteRocket
(
x : integer,
y : integer)
siberite rocket will explode at hex x,y
SetAlliedVictory
(
side : integer,
state : boolean)
sets allied victory state for side
SetAreaMapShow
(
area : integer,
id : integer)
shows area on map and/or minimap
SetArtifactRes
(
side : integer,
state : boolean)
allows researching of artifact technology
SetArtifactUse
(
side : integer,
number : integer,
state : integer,
lab : integer)
allows use of artifact icon in labs of side... number - art_use_?; state - art_?; lab - unit number, negative kind, or zero for all labs
SetAttitude
(
fromside : integer,
toside : integer,
att : integer,
sym : boolean)
sets attitude to att (if sym then sets the symetric relation too)
SetAttr
(
units : liste,
attr : integer,
value : integer)
set attribute attr of specified human units to value
SetBattleFlag
(
side : integer,
x : integer,
y : integer,
options : liste)
sets battle flag for specified side to specified coordinates and returns flagid effect of flag depends on its options, default options: [[bfo_defend_bonus_human,80],[bfo_defend_bonus_vehicle,40],[bfo_defend_bonus_building,0],[bfo_range,17],[bfo_height,100]] distance: 0..range: full effect; range+1..range*2: decreasing effect
SetBLevel
(
units : liste,
blevel : integer)
sets basic level of building(s)
SetGraphicsGamma
(
gamma : integer)
sets gamma correction of display
SetLastMission
(
humans : liste,
number : integer)
changes last mission in which characters humans was present (nepouzivat)
SetLives
(
units : liste,
value : integer)
set lives of specified units to value
SetMark
(
units : liste,
mark : integer)
sets mark of units (masha flag)
SetMultiScore
(
side : integer,
score : integer)
sets multiplayer score of specified side
SetNoActivity
(
un : integer)
resets activity of (laboratory) un; use VERY carefully!
SetRememberedX
(
un : integer,
value : integer)
sets ComReturn x coordinate of a unit
SetRememberedY
(
un : integer,
value : integer)
sets ComReturn y coordinate of a unit
SetResourceType
(
base : integer,
mattype : integer,
amount : integer)
sets resource of specified type to the specified base
SetResourceVisibility
(
x : integer,
y : integer,
side : integer)
sets deposit at pos x, y visible for side
SetRestrict
(
btype : integer,
side : integer,
state : boolean)
sets restriction btype for side
SetSide
(
units : liste,
value : integer)
set side of specified units to value
SetSideBase
(
base : integer,
value : integer)
set side of complete base
SetSkill
(
units : liste,
sk : integer,
value : integer)
set skill sk of specified human units to value
SetSpecResearch
(
un : integer,
time : integer,
auto : boolean)
sets (laboratory) un to SpecResearch; auto mode; time - length; use carefully!
SetTag
(
index : integer,
value : integer)
sets tag[index] to value
SetTaskList
(
un : integer,
list : liste)
sets tasks from tasklist (GetTaskList format) - use carefully!
SetTech
(
tech : integer,
side : integer,
state : integer)
sets state of technology for side
SetTechProgress
(
tech : integer,
side : integer,
percentage : integer)
sets progress of technology research for side
SetUnitDisplayNumber
(
un : integer,
num : integer)
displays number num over the unit un (even in final Original War)... zero means display nothing
SetWorkingProgress
(
units : liste,
percentage : integer)
sets progress of action of unit(s) - construction, etc. (not research!)
ShiftX
(
x : integer,
dir : integer,
dist : integer)
returns x coordinate shifted by dist hexes in direction dir
ShiftY
(
y : integer,
dir : integer,
dist : integer)
returns x coordinate shifted by dist hexes in direction dir
ShowArea
(
side : integer,
area : integer)
reveal an area hiden by HideArea
SiberiteExplosion
(
x : integer,
y : integer)
create siberite explosion
SiberiteRocket
(
x : integer,
y : integer,
n : integer,
list : variable)
emulates n-th phase of siberite rocket explosion on list of units
SideShoot
(
un : integer)
returns side, that last shoot unit un
SortListByListAsc
(
items : variable,
values : variable)
Returns list items ascending sorted by asociated integer list values If lists aren't the same size, only smaller length of list is used
SortListByListDesc
(
items : variable,
values : variable)
Returns list items descending sorted by asociated integer list values. If lists aren't the same size, only smaller length of list is used
TechNationAvailable
(
tech : integer,
nation : integer)
returns true if tech is available to nation
TeleportExit
(
un : integer,
x : integer,
y : integer)
creates exit on [x,y] for teleport un
TeleportUnit
(
un : integer,
x : integer,
y : integer,
range : integer,
sound : boolean)
try to teleport unit un to [x,y]. Uses warp effect. Sound optionally. Returns true, if succeed. Only for outside units. Use range to auto-find other destination if [x,y] unusable.
TestCharacters
(
ident : string)
Returns true if there is a character or group of characters with specified ident in the save
TestVariable
(
ident : string)
Returns true if there is a variable with specified ident in the save
UnitFilter
(
units : liste,
filter : liste)
filters list of unit using filter
UnitShoot
(
un : integer)
returns unit, that last shoot unit un
UnitsInside
(
un : integer)
returns list of units inside building (or vehicle) un
UnitsLinked
(
un : integer)
returns number of linked vehicles on unit
ValidHex
(
x : integer,
y : integer)
{true if hex x,y is valid;} 0 - invalid, 1 - bordering, 2 - normal.
ViewMineAtPos
(
x : integer,
y : integer,
side : integer)
reveal mine at pos x, y for side_fog[side]
Wait
(
ticks : integer)
waits for specified number of ticks, ignores asynchronous mode
WaitForMc
(
mcid : integer)
waits for finishing of macro mcid
WantsToAttack
(
un : integer)
returns number of unit which is target of attack command of unit un, or zero
WaypointsFromMatrix
(
matrix : liste,
areas : liste)
creates waypoints through areas using matrix. Areas is a list: [[x,y,r],...] and there must be at least one item in this list. The way is randomly created: random points in the areas are selected, then one of the best ways through these points is randomly selected.
WorstFromListByList
(
items : variable,
values : variable)
Returns SortListByListAsc(items,values)[1], or zero iv values is empty. Faster than SortListByListDesc