Replace (list:plist; index:integer; item:tvalue)
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

Insert(list:plist index:integer item:tvalue)
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

Delete(list:plist index:integer)
deletes item from list, returns result 
if index is out of list, then happens nothing

ExclusiveOn
stops all other threads of SAIL until ExclusiveOff is executed or this thread ends

ExclusiveOff
cancels effect of ExclusiveOn

DialogueOn
function, which: store tick, switch stop_action to true, set ExclusiveOn

DialogueOff
function, which: restore tick, switch stop_action to false, set ExclusiveOff

InGameOn
function, which: store tick, switch ingame_video to true, set ExclusiveOn

InGameOff
function, which: restore tick, switch ingame_video to false, set ExclusiveOff

Randomize
randomize SAIL random numbers

RandomizeAll
randomize all random numbers in game

Rand(min:integer max:integer)
random number in selected range returned

Prob(per:integer)
returns true on per percent (Rand(1,100)<=per)

MultiRand(min:integer max:integer n:integer)
random number in selected range, made by n Rand

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

RandHexXYRx: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

InitUc
Initializes unit create structure to default values

InitHc
Initializes human create structure to default values

InitVc
Initializes vehicle create structure to default values

InitBc
Initializes building create structure to default values

SaveForQuickRestart
use it after ingame videos and character selection - quick restart will start from this point

NewCharacter(ident:string)
Loads and create a new global character (which was never saved before), returns its handle

PrepareNewCharacter(ident:string)
Prepares hc_ and uc_ structures for a new global character (which was never saved before)

TestVariable(ident:string)
Returns true if there is a variable with specified ident in the save

TestCharacters(ident:string)
Returns true if there is a character or group of characters with specified ident in the save

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)

LoadVariable(ident:string default:tvalue)
Loads a variable with specified ident from the save (or default if ident is not found)

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

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

CreateCharacter(ident:string)
Shortcut for CreateOneCharacterFromSet(ident,1)

CreateCharacterWithClass(ident:string cl:integer)
Shortcut for CreateOneCharacterFromSetWithClass(ident,1,cl)

PrepareOneCharacterFromSet(ident:string index:integer)
Same as CreateOneCharacter, but character is only prepared (not created yet), returns true if succeeds

PrepareCharacter(ident:string)
Shortcut for PrepareOneCharacterFromSet(ident,1)

SaveCharacters(humlist:plist 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

SaveVariable(v:tvalue ident:string)
Saves variable to the save with specified ident

DeleteCharacters(ident:string)
Deletes character set from the save

DeleteVariable(ident:string)
Deletes a character from the save

CharacterSelection(ident:string min:integer max:integer units:plist classes:plist)
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])

RewardPeople(humans:plist)
gives mission reward to list of human characters (use before save)

CreateHuman
Creates human using uc_ and hc_ parameters

CreateVehicle
Creates vehicle using uc_ and vc_ parameters

CreateBuilding
Creates a building using uc_ and bc_ parameters

CreateAndPlaceBuildingXYD(x:integer y:integer direction:integer)
Creates a building using uc_ and bc_ parameters

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

PlaceUnitArea(un:integer area:integer materialisation:boolean)
Places unit into specified area, 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

PlaceUnitAnywhere(un:integer materialisation:boolean)
Places unit anywhere on map, returns true if succeedes
If materialisation is true, unit is materialised

PlaceHumanInUnit(hum:integer un:integer)
Places unplaced human into a placed or unplaced unit

LinkVehicleToHuman(veh:integer hum:integer)
Links vehicle to a human in Control tower

CreateCratesXY(amount:integer x:integer y:integer materialisation:boolean)
No Description.

CreateCratesArea(amount:integer area:integer materialisation:boolean)
No Description.

CreateCratesXYR(amount:integer x:integer y:integer r:integer materialisation:boolean)
No Description.

CreateCratesAnywhere(amount:integer materialisation:boolean)
No Description.

CreateResourcesXY(typ:integer amount:integer x:integer y:integer materialisation:boolean)
No Description.

CreateResourcesArea(typ:integer amount:integer area:integer materialisation:boolean)
No Description.

CreateResourcesXYR(typ:integer amount:integer x:integer y:integer r:integer materialisation:boolean)
No Description.

CreateResourcesAnywhere(typ:integer amount:integer materialisation:boolean)
No Description.

CreateDepositXY(x:integer y:integer typ:integer)
creates deposit of mat_siberite or mat_oil type on specified coordinates

RemoveDepositXY(x:integer y:integer)
removes deposit of any type on specified coordinates

RemoveUnit(un:integer)
Removes specified unit from map

DestroyUnit(un:integer)
Destroys specified unit (include removing, if placed)

KillUnit(un:integer)
Kills specified unit by setting its lives to zero

Wait(ticks:integer)
waits for specified number of ticks, ignores asynchronous mode

DWait(ticks:integer)
waits for specified number of ticks, for use when DialogOn

FilterAllUnits(filter:plist)
filters list of all units using filter

FilterUnitsInArea(area:integer filter:plist)
filters list of units in specified area using filter

FilterUnitsExceptArea(area:integer filter:plist)
filters list of units not in specified area using filter

UnitFilter(units:plist filter:plist)
filters list of unit using filter

NearestUnitToXY(units:plist x:integer y:integer)
Returns nearest unit from list units to position (x,y), or zero if units is empty

NearestUnitToUnit(units:plist un:integer)
Returns nearest unit from list units to unit un (ignoring un itself), or zero

AllNearestUnitToUnit(units:plist un:integer)
Returns all nearest unit from list units to unit un (ignoring un itself), or zero

SortListByListAsc(items:tvalue values:tvalue)
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:tvalue values:tvalue)
Returns list items descending sorted by asociated integer list values.
If lists aren't the same size, only smaller length of list is used

WorstFromListByList(items:tvalue values:tvalue)
Returns SortListByListAsc(items,values)[1], or zero iv values is empty. Faster than SortListByListDesc

BestFromListByList(items:tvalue values:tvalue)
Returns SortListByListDesc(items,values)[1], or zero iv values is empty. Faster than SortListByListAsc

SetAttitude(fromside:integer toside:integer att:integer sym:boolean)
sets attitude to att (if sym then sets the symetric relation too)

GetAttitude(fromside:integer toside:integer)
returns attitude

SetAlliedVictory(side:integer state:boolean)
sets allied victory state for side

GetAlliedVictory(side:integer)
returns allied victory state of side

CenterOnXY(x:integer y:integer)
centers screen on specified coordinates with scrolling

CenterOnUnits(units:plist)
centers screen to specified group of units with scrolling

CenterNowOnXY(x:integer y:integer)
centers immediatelly screen on specified coordinates

CenterNowOnUnits(units:plist)
centers immediatelly screen to specified group of units

Say(un:integer ident:string)
Specified unit says sentence 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

ForceSay(un:integer ident:string)
Specified unit says sentence identified by ident even if it is dying (but not dead)

ForceSayNoName(un:integer ident:string)
Specified unit says sentence identified by ident even if it is dying, it's name doesn't appear

ForceSayNoFace(un:integer ident:string)
Specified unit says sentence identified by ident even if it is dying, it's face doesn't appear

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

SayEffect(ident:string)
Say effect identified by ident

Query(ident:string)
Displays query dialog defined in texts, returns number of answer (1..n)

SelectiveQuery(ident:string list:plist)
Displays query dialog defined in texts, returns number of answer (1..n)
List contains numbers of items which will be shown

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

GiveMedals(ident:string)
No Description.

YouWin
No Description.

YouLost(ident:string)
No Description.

YouDidSomethingExtraordinary
No Description.

YouWinInMultiplayer
No Description.

YouLostInMultiplayer
No Description.

MultiplayerSideAlive(side:integer)
returns true, if there is at least one player playing this side

SetTag(index:integer value:integer)
sets tag[index] to value

GetTag(index:integer)
gets value of tag[index]

ComMoveXY(units:plist x:integer y:integer)
set of units receives move command to specified coordinates

ComMoveUnit(units:plist un:integer)
set of units receives move command to specified unit

ComMoveToArea(units:plist area:integer)
set of units receives move command to specified area

ComAgressiveMove(units:plist x:integer y:integer)
set of units receives agressive move command to specified coordinates

ComAttackUnit(units:plist un:integer)
set of units receives attack command to specified unit

ComAttackPlace(units:plist x:integer y:integer)
set of units receives attack command to specified coordinates

ComCollect(units:plist x:integer y:integer)
set of units receives collect command to specified coordinates

ComTurnXY(units:plist x:integer y:integer)
set of units receives turn command to specified coordinates

ComTurnUnit(units:plist un:integer)|
set of units receives turn command to specified unit

ComEnterUnit(units:plist un:integer)
set of units receives enter specified unit command

ComExitVehicle(units:plist)
set of units receives exit vehicle command

ComExitBuilding(units:plist)
set of units receives exit building command

ComChangeProfession(units:plist new_prof:integer)
set of units receives change profession to new_prof command

ComResearch(units:plist techn:integer)
set of labs receives research technology techn command

ComConstruct(units:plist chassis:integer engine:integer control:integer weapon:integer)
set of factories receives construct vehicle with specified components command

ComPause(units:plist)
set of buildings receives pause research or construction command

ComCancel(units:plist)
set of buildings receives cancel research or construction command

ComHeal(units:plist un:integer)
set of units receives heal specified unit command

ComRepairVehicle(units:plist un:integer)
set of units receives repair specified vehicle command

ComRepairBuilding(units:plist un:integer)
set of units receives repair specified building command

ComTameXY(units:plist x:integer y:integer)
set of units receives tame command

ComPlaceDelayedCharge(units:plist x:integer y:integer un:integer)
set of units receives command for place explosives to [x,y] or near unit un

ComPlaceRemoteCharge(units:plist x:integer y:integer un:integer)
set of units receives command for place explosives to [x,y] or near unit un

ComFireExplosives(units:plist)
set of units receives fire remote controlled explosives command

ComLinkTo(units:plist hum:integer)
set of vehicles receives link to specified human command

ComUnlink(units:plist)
set of vehicles receives unlink command

ComCrawl(units:plist)
set of units receives crawl command

ComWalk(units:plist)
set of units receives walk command

ComFree(units:plist)
set of units receives free command

ComHold(units:plist)
set of units receives hold command

ComStop(units:plist)
set of units receives stop command

ComWait(units:plist time:integer)
set of units receives wait command

ComRemember(units:plist)
set of units receives remember command

ComReturn(units:plist)
set of units receives return command

ComBuild(units:plist bud:integer x:integer y:integer dir:integer)
set of units receives build command

ComUpgrade(units:plist)
list of units receives command upgrade

ComUpgradeLab(units:plist labtype:integer)
list of units receives command upgrade to specified laboratory

ComPlaceWeapon(units:plist weap:integer)
list of turrets and bunkers receives place specified weapon command

ComAnim(units:plist atype:integer)
list of units receives do specified animation command

ComRefuel(units:plist un:integer)
list of units receives refuel command

ComTransport(units:plist un:integer mattype:integer)
list of units receives transport command

ComInvisible(units:plist)
list of units receives invisible command

ComSpaceShift(units:plist x:integer y:integer)
list of units receives command to use spaceshifting grenade

ComTimeShift(units:plist x:integer y:integer)
list of units receives command to use timeshifting grenade

ComHack(units:plist un:integer)
list of units receives hack command

ComTeleportExit(units:plist x:integer y:integer un:integer)
list of units receives command for place exit of teleport un to [x,y]

ComHiddenCamera(units:plist x:integer y:integer)
list of units receives place hidden camera

ComContaminate(units:plist x:integer y:integer)
list of units receives contaminate siberite deposit

ComUnload(units:plist)
list of units receives cargo unload command

ComGet(units:plist x:integer y:integer)
list of units receives simple get cargo command

ComGive(units:plist un:integer)
list of units receives simple give cargo command

ComCarabine(units:plist)
list of sheiks receives CarabineOn command

ComSabre(units:plist)
list of sheiks receives SabreOn command

ComSailEvent(units:plist num:integer)
unit raises generic event SailEvent(num)

ComStand(units:plist)
set of units receives stand command

ComAttackSoporific(units:plist un:integer)
attack unit un with soporific amunition

ComDismantle(units:plist un:integer)
list of units receives command to dismantle building un

ComRecycle(units:plist un:integer)
list of vehicles receives command to recycle in building un

ComLinkToBase(units:plist un:integer)
depot or warehouse receives command to link building un to the base

ComBuildBehemoth(units:plist bud:integer x:integer y:integer dir:integer)
set of units receives build behemoth command

AddComMoveXY(units:plist x:integer y:integer)
set of units receives move command to specified coordinates

AddComMoveUnit(units:plist un:integer)
set of units receives move command to specified unit

AddComMoveToArea(units:plist area:integer)
set of units receives move command to specified area

AddComAgressiveMove(units:plist x:integer y:integer)
set of units receives agressive move command to specified coordinates

AddComAttackUnit(units:plist un:integer)
set of units receives attack command to specified unit

AddComAttackPlace(units:plist x:integer y:integer)
set of units receives attack command to specified coordinates

AddComCollect(units:plist x:integer y:integer)
set of units receives collect command to specified coordinates

AddComTurnXY(units:plist x:integer y:integer)
set of units receives turn command to specified coordinates

AddComTurnUnit(units:plist un:integer)
set of units receives turn command to specified unit

AddComEnterUnit(units:plist un:integer)
set of units receives enter specified unit command

AddComExitVehicle(units:plist)
set of units receives exit vehicle command

AddComExitBuilding(units:plist)
set of units receives exit building command

AddComChangeProfession(units:plist new_prof:integer)
set of units receives change profession to new_prof command

AddComResearch(units:plist techn:integer)
set of labs receives research technology techn command

AddComConstruct(units:plist chassis:integer engine:integer control:integer weapon:integer)
set of factories receives construct vehicle with specified components command

AddComPause(units:plist)
set of buildings receives pause research or construction command

AddComCancel(units:plist)
set of buildings receives cancel research or construction command

AddComHeal(units:plist un:integer)
set of units receives heal specified unit command

AddComRepairVehicle(units:plist un:integer)
set of units receives repair specified vehicle command

AddComRepairBuilding(units:plist un:integer)
set of units receives repair specified building command

AddComTameXY(units:plist x:integer y:integer)
set of units receives tame command

AddComPlaceDelayedCharge(units:plist x:integer y:integer un:integer)
set of units receives command for place explosives to [x,y] or near unit un

AddComPlaceRemoteCharge(units:plist x:integer y:integer un:integer)
set of units receives command for place explosives to [x,y] or near unit un

AddComFireExplosives(units:plist)
set of units receives fire remote controlled explosives command

AddComLinkTo(units:plist hum:integer)
set of vehicles receives link to specified human command

AddComUnlink(units:plist)
set of vehicles receives unlink command

AddComCrawl(units:plist)
set of units receives crawl command

AddComWalk(units:plist)
set of units receives walk command

AddComFree(units:plist)
set of units receives free command

AddComHold(units:plist)
set of units receives hold command

AddComStop(units:plist)
set of units receives stop command

AddComWait(units:plist time:integer)
set of units receives wait command

AddComRemember(units:plist)
set of units receives remember command

AddComReturn(units:plist)
set of units receives return command

AddComBuild(units:plist bud:integer x:integer y:integer dir:integer)
set of units receives build command

AddComUpgrade(units:plist)
list of units receives command upgrade

AddComUpgradeLab(units:plist labtype:integer)
list of units receives command upgrade to specified laboratory

AddComPlaceWeapon(units:plist weap:integer)
list of turrets and bunkers receives place specified weapon command

AddComAnim(units:plist atype:integer)
list of units receives do specified animation command

AddComRefuel(units:plist un:integer)
list of units receives refuel command

AddComTransport(units:plist un:integer mattype:integer)
list of units receives transport command

AddComInvisible(units:plist)
list of units receives invisible command

AddComSpaceShift(units:plist x:integer y:integer)
list of units receives command to use spaceshifting grenade

AddComTimeShift(units:plist x:integer y:integer)
list of units receives command to use timeshifting grenade

AddComHack(units:plist un:integer)
list of units receives hack command

AddComTeleportExit(units:plist x:integer y:integer un:integer)
list of units receives command for place exit of teleport un to [x,y]

AddComHiddenCamera(units:plist x:integer y:integer)
list of units receives place hidden camera

AddComContaminate(units:plist x:integer y:integer)
list of units receives contaminate siberite deposit

AddComUnload(units:plist)
list of units receives cargo unload command

AddComGet(units:plist x:integer y:integer)
list of units receives simple get cargo command

AddComGive(units:plist un:integer)
list of units receives simple give cargo command

AddComCarabine(units:plist)
list of sheiks receives CarabineOn command

AddComSabre(units:plist)
list of sheiks receives SabreOn command

AddComSailEvent(units:plist num:integer)
unit raises generic event SailEvent(num)

AddComStand(units:plist)
set of units receives stand command

AddComAttackSoporific(units:plist un:integer)
attack unit un with soporific amunition

AddComDismantle(units:plist un:integer)
list of units receives command to dismantle building un

AddComRecycle(units:plist un:integer)
list of vehicles receives command to recycle in building un

AddComLinkToBase(units:plist un:integer)
depot or warehouse receives command to link building un to the base

AddComBuildBehemoth(units:plist bud:integer x:integer y:integer dir:integer)
set of units receives build behemoth command

SetRememberedX(un:integer value:integer)
sets ComReturn x coordinate of a unit

SetRememberedY(un:integer value:integer)
sets ComReturn y coordinate of a unit

SetDir(un:integer dir:integer)
sets direction to an unplaced unit

SetLives(units:plist value:integer)
set lives of specified units to value

SetSide(units:plist value:integer)
set side of specified units to value

SetSideBase(base:integer value:integer)
//set side of complete base

SetSkill(units:plist sk:integer value:integer)
set skill sk of specified human units to value

GiveSkillBonus(units:plist sk:integer value:integer)
increases basic skill sk of units by value

SetAttr(units:plist attr:integer value:integer)
set attribute attr of specified human units to value

SetFuel(units:plist percent:integer)
sets fuel of specified combustion or solar vehicles list

SetBLevel(units:plist blevel:integer)
sets basic level of building(s)

SetMark(units:plist mark:integer)
sets mark of units (masha flag)

TeleportExit(un:integer x:integer y:integer)
creates exit on [x,y] for teleport un

HiddenCamera(x:integer y:integer side:integer)
creates hidden camera

SetLastMission(humans:plist number:integer)
changes last mission in which characters humans was present (nepouzivat)

GiveMissionExperience(humans:plist number:integer)
gives default experience for mission number to characters humans (nepouzivat)

GetType(un:integer)
returns type of unit (unit_human, unit_vehicle, unit_building)

GetNation(un:integer)
//returns nation of unit

GetIdent(un:integer)
returns ident of specified unit (for debuging listings etc.)

GetX(un:integer)
returns x coordinate of a unit

GetY(un:integer)
returns y coordinate of a unit

GetRememberedX(un:integer)
returns ComReturn x coordinate of a unit

GetRememberedY(un:integer)
returns ComReturn y coordinate of a unit

GetDir(un:integer)
returns direction of a unit

GetSide(un:integer)
returns side of a unit

GetLives(units:plist)
returns average lives of specified units

GetClass(un:integer)
returns class of specified human unit

GetSex(un:integer)
returns sex of specified human unit

GetSkill(units:plist sk:integer)
returns average skill sk of specified human units

GetAttr(units:plist attr:integer)
returns average attribute attr of specified human units

GetFuel(units:plist)
returns average fuel of specified combustion or solar vehicles list

GetEngine(un:integer)
returns type of vehicle engine

GetControl(un:integer)
returns type of vehicle control

GetWeapon(un:integer)
returns type of vehicle weapon

GetChassis(un:integer)
returns type of vehicle chassis

GetBType(un:integer)
returns type of building, if un is not a building, returns -1

GetBLevel(un:integer)
returns level of building, if un is not a building, returns -1

GetLabKind(un:integer which:integer)
return kind of laboratory, which is 1 or 2

GetBWeapon(un:integer)
returns type of weapon (in case of turret or bunker, zero otherwise)

GetExtPositions(un:integer)
returns list of factory extensions positions [[x,y],[x,y],[x,y],[x,y],[x,y]]

GetMark(un:integer)
returns value of mark of unit un (masha flag)

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

GetBase(un:integer)
returns base of specified building (or zero, if it is not building)

GetResourceType(base:integer mattype:integer)
returns amount of material of specified type in specified base

AddResourceType(base:integer mattype:integer amount:integer)
adds resource of specified type to the specified base

SetResourceType(base:integer mattype:integer amount:integer)
sets resource of specified type to the specified base

GetEnergy(base:integer)
returns list of power values: [need,needmax,prod,prodmax]

GetResources(base:integer)
returns list of base resources: [cans,oil,sib]

CanCarry(un:integer)
returns true if unit is engineer or cargo holder

Carry(un:integer)
returns true if unit carries something

CanCarryNext(un:integer)
returns true if unit is not full

GetResourceTypeXY(x:integer y:integer)
returns resource type on specified hex or zero

GetResourceAmountXY(x:integer y:integer)
returns amount of resources on specified hex

ChangeResourceAmountXY(x:integer y:integer n:integer)
changes amount of existing resources on specified hex

EraseResourceArea(ar:integer typ:integer)
erases all resources in of specified type in specified area

GetResourceArea(ar:integer typ:integer)
returns all resources in of specified type in specified area

GetCargoType(units:plist)
returns type of cargo (mat_none, mat_cans, mat_oil, mat_siberite, mat_multi)

GetCargo(units:plist mattype:integer)
returns (total) amount of mattype

SetCargo(units:plist mattype:integer amount:integer)
sets amount of mattype (each unit in list) returns true if (all) succeed

AddCargo(units:plist mattype:integer amount:integer)
adds amount of mattype (each unit in list) returns true if (all) succeed

See(side:integer un:integer)
returns true if side sees specified unit

SeeXY(side:integer x:integer y:integer)
returns how good side sees specified hex

SeeArea(side:integer area:integer)
returns how much hexes of specified area side sees

GetFreeMode(un:integer)
returns true if unit is in free mode

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

GetDistUnitArea(un:integer area:integer)
returns distance of a unit and the closest hex in the area (0 if it is in area)

IsLive(un:integer)
returns true if unit is on map and not dead

IsDead(un:integer)
returns true if unit is dead (lives on zero or totally destroyed)

IsOK(un:integer)
returns true if unit is on map and not dying

IsDying(un:integer)
returns true if unit is on map and dying

IsConstructed(build:integer)
returns nonzero number, if build is building under construction or if it is upgraded

IsPlaced(un:integer)
returns true if unit un is placed

IsSelected(units:plist)
returns true if selected

IsAt(un:integer x:integer y:integer)
returns true if unit is at specified coordinates

IsInArea(un:integer area:integer)
returns true if unit is in specified area (it can be driving or inside)

InArea(x:integer y:integer area:integer)
returns true if [X,Y] is in specified area

IsInUnit(hum:integer)
returns number of unit in which a unit is or zero

IsDrivenBy(veh:integer)
returns number of driver of a human controlled vehicle, zero otherwise

IsControledBy(veh:integer)
returns number of driver of a remote controlled vehicle, zero otherwise

UnitsInside(un:integer)
returns list of units inside building (or vehicle) un

HasTask(un:integer)
returns true if unit has a tasks from player or SAIL

IsBusy(un:integer)
returns true if unit has a tasks (even its own)

IsIdle(un:integer)
returns true if unit does nothing

IsTamedBy(un:integer)
returns number of tamer of this animal, zero otherwise

Crawls(units:plist)
returns number of crawling units in list (0=false)

WantsToAttack(un:integer)
returns number of unit which is target of attack command of unit un, or zero

Attacks(un:integer)
returns number of unit which is curently attacked by unit un (aiming counts as attack), or zero

GetTech(tech:integer side:integer)
returns state of technology for side

SetTech(tech:integer side:integer state:integer)
sets state of technology for side

GetRestrict(btype:integer side:integer)
returns restriction btype for side

SetRestrict(btype:integer side:integer state:boolean)
sets restriction btype for side

Researched(side:integer tech:integer)
returns true if tech is researched (obsolete)

GetTechProgress(tech:integer side:integer)
returns progress of technology research for side

SetTechProgress(tech:integer side:integer percentage:integer)
sets progress of technology research for side

GetWorkingProgress(units:plist)
returns (average) progress of action of unit(s) - construction, etc.

SetWorkingProgress(units:plist percentage:integer)
sets progress of action of unit(s) - construction, etc. (not research!)

PlaceSeeing(x:integer y:integer side:integer range:integer)
places area of seeing (negative range for radar seeing)

RemoveSeeing(x:integer y:integer side:integer)
removes area of seeing (all matching areas)

RevealFogArea(side:integer area:integer)
reveals fog for specified side in specified area

HideArea(side:integer area:integer)
sets specified area invisible for specified side

ShowArea(side:integer area:integer)
reveal an area hiden by HideArea

ResetFog(var res:tvalue)
resets fog of war of all sides to black

SetClass(units:plist value:integer)
sets immediatelly class of units to value

ChangeMissionObjectives(ident:string)
change mission objectives, s is ident in Texts.txt

HintSpec(ident:string kind:integer)
adds hint (kind: 0-hint, 1-info, 2-error, 3-first)

Hint(ident:string)
adds hint

ChangeMap(ident:string fname:string)
changes map, ident identifies text while loading, fname is name of the map in the same directory (without path)

ExitGame(var res:tvalue)
exits game (debug)

GetSideFog(side:integer)
returns number of fog of specified side

ChangeSideFog(side:integer fognumber:integer)
set fog of specified side to specified fog number

FogOff(sw:integer)
if sw is true, fog is off

BuildingsInProgress(side:integer)
returns true if construction of any buildings of specified side isn't finish

ReplaceEnvironment(x:integer y:integer envset:integer num:integer)
replaces environment on x, y by element num from set

RemoveEnvironment(x:integer y:integer)
removes environment on x, y

RemoveEnvironmentWithoutRebuild(x:integer y:integer)
removes environment on x, y, don't count parameters, use only if normal RemoveEnviroment follows
PlaceEnvironment(x:integer y:integer envset:integer num:integer)
creates environment num from set envset on x, y

PlaceRandEnvironment(x:integer y:integer envset:integer)
creates random environment from set envset on x, y

IsEnvironment(x:integer y:integer)
returns true if there is an environment on x, y

PlaceTreesToArea(area:integer sets:plist 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.

ListEnvironmentArea(area:integer)
returns list of environments in area [[x,y,envset,num],...]

PlaceEnvironmentList(list:plist)
creates environments [[x,y,envset,num],[x,y,envset]...] num may not be defined

RemoveEnvironmentArea(area:integer)
removes all environment in area

SiberiteRocket(x:integer y:integer n:integer list:tvalue)
emulates n-th phase of siberite rocket explosion on list of units

PrepareSiberiteRocket(var res:tvalue)
prepares siberite rocket explosion

SiberiteExplosion(x:integer y:integer)
create siberite explosion

GetGraphicsGamma(var res:tvalue)
returns gamma correction from setting

SetGraphicsGamma(gamma:integer)
sets gamma correction of display

GetGraphicsBrightness(var res:tvalue)
returns gamma correction from setting

SetGraphicsBrightness(brightness:integer)
sets brightness of display

PlaySoundXY(x:integer y:integer ident:string)
plays sound with ident from coordinates x, y

MusicIsPlaying(var res:tvalue)
returns true if music is playing

PrepareAttr(sex:integer)
prepares random attributes for specified sex (or common, if zero)

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

PrepareSoldierSkills(level:integer)
prepares skills for soldier, main skill is near specified level (uses PrepareClass)

PrepareEngineerSkills(level:integer)
prepares skills for engineer, main skill is near specified level (uses PrepareClass)

PrepareMechanicSkills(level:integer)
prepares skills for mechanic, main skill is near specified level (uses PrepareClass)

PrepareScientistSkills(level:integer)
prepares skills for scientist, main skill is near specified level (uses PrepareClass)

PrepareCustomSkills(list:plist)
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

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

PrepareSoldier(sex:integer lev:integer)
prepares parameters for a soldier with specified sex and level (0=random for sex)

PrepareEngineer(sex:integer lev:integer)
prepares parameters for a engineer with specified sex and level (0=random for sex)

PrepareMechanic(sex:integer lev:integer)
prepares parameters for a mechanic with specified sex and level (0=random for sex)

PrepareScientist(sex:integer lev:integer)
prepares parameters for a scientist with specified sex and level (0=random for sex)

WaitForMc(mcid:integer)
waits for finishing of macro mcid

ExistMc(mcid:integer)
if macro mcid exists, returns true, otherwise false

KillMc(mcid:integer)
if macro mcid exists, closes macro and returns true otherwise returns false

GetUnitMc(un:integer)
returns mcid of macro which uses unit un returns zero if not used

GetMcUnits(mcid:integer)
returns list of units of the macro mcid

AddMcUnits(mcid:integer units:plist)
changes list of units of the macro mcid returns true if succesfull

RemoveMcUnits(mcid:integer units:plist)
changes list of units of the macro mcid returns true if succesfull

ClearMcUnits(mcid:integer)
clears list of units of the macro mcid returns true if succesfull

GetMcUnitsSpec(mcid:integer spec:integer)
returns spec list of units of the macro mcid

AddMcUnitsSpec(mcid:integer units:plist spec:integer)
changes spec list of units of the macro mcid returns true if succesfull

RemoveMcUnitsSpec(mcid:integer units:plist spec:integer)
changes spec 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

McBase(prior:integer units:plist build:plist research:plist construct:plist options:plist)
runs macro and returns mcid
build must be BuildList, researchs - list of techs, construct - not implemented

McMove(prior:integer units:plist waypoints:plist options:plist)
runs macro and returns mcid
units - list of units, what else...
waypoints - as expected...
options as follows:
 mc_move_wait - wait for each other after 4 hexes, can take a distance in hexes as parameter
 mc_move_through - really walk THROUGH the waypoints, default is coming 6 hexes to them
 mc_move_waitwp - wait on waypoints for the rest of units
 mc_move_dontshoot - dont shoot at unfriendly obcstacles
 mc_move_dontcapture - dont capture vehicles
 mc_move_agressive - be !!#$#$% AGGRESSIVE !!!
 mc_move_ownstuck - don't timeout with obstacles of own side at nervosity 100, just do it FOREVER...

McRegistry(side:integer options:plist)
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:plist)
changes options of McRegistry with ident mcid
McDefend(prior:integer regid:integer units:plist options:plist)
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

McAttack(prior:integer regid:integer units:plist options:plist)
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.
regid - registry id - the units watch the area_to_guard from mc_registry
units - list of units obeying your commands, o designer master...
options:
[-]mc_no_stop                     ... crawling throug the registered area forever
[-]mc_murder                      ... kill the DAMNED bastards lying on the ground !
[mc_area_dont_leave, defarea]     ... dont leave this area (default none)
[mc_retreat_lives_people,lives]   ... retreat to retreat_area_people when (wo)man's hitpoints get under lives
[mc_retreat_lives_vehicles,lives] ... retreat to retreat_area_vehicle when vehicle's hitpoints get under lives
[mc_retreat_area_people, defarea]
[mc_retreat_area_vehicle, defarea]
[mc_out_of_fuel, level]           ... throw an event when fuel lowers under level

Behaviour in Czech - sorry you english-only guys (ang girls):
Chovani McAttacku:
 
Chodi po zadane oblasti, dokud neuvidi nepratele.
Tem pak prirazuje Nevhodnost_cilu pro stranu McAttacku, nejmensi pro nejslabsi jednotky.
Nevhodnost je normalizovana hodnotou 100.
Jakmile je vsechny pobije a neuvidi zadne dalsi, skonci, pokud nema nastaveny flag no_stop.
Da se mu nastavit oblat, kterou nema opoustet a oblasti, kam se maji stahovat zranene jednotky.
Haze event u jednotek, kterym dochazi palivo.
Vytvari si seznam jednotek(cilu) na ktere prave utoci a pri pristim pruchodu jim nastavi nevhodnost cilu na -1.
tim se zajisti, ze nedorazi umirajici (kterym jinak zustane velmi prizniva Nevhodnost_cile).
Kdyz McAttack skonci, nastavi vsem jednotkam na ktere utocil nevhodnost -1.
Standardne McAttack nedorazi mrtve. Da se k tomu premluvit zapnutim prepinace Murder McAttack, kdy
prestane nastavovat nevhodnost umirajicim na -1 a ti pak maji nizkou nevyhodnost.
Po ukonceni McAttacku temto jednotkam zustane nastavena nevhodnost, takze je kdokoliv kolemjdouci patrici k
nasi strane dorazi.
Nenapada me jednoduchy zpusob jak toto vyresit (tj. aby i umirajici jednotky v tomto rezimu mely po skonceni
McAttack nevhodnost -1).
McAttack skonci, pokud jiz nema zadne jednotky, ktere by mohly utocit, nebo pokud nevidi zadne neumirajici
nepratelske jednotky.
Po skonceni McAttacku jednotky nemaji zadny ukol a tudiz dorazi vsechny nepratele, ktere vidi.

McPatrol(prior:integer regid:integer units:plist options:plist)
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.
units walk through an area and try to visit parts they havent seen for a long time and they do it FOREVER
(ie. McPatrol ends iif all units in it are dead
throws an event as soon as the units see an enemy
almost all options just like in McAttack, except mc_murder and mc_no_stop, which are missing. One more is:
[-]mc_pat_aggresive ... be agressive while patroling

McSkirmish(prior:integer units:plist options:plist)
runs McSkirmish macro and returns mcid
options - [[mcs_PosList, list], [mcs_Strategy, list], [mcs_Parking, parkingarea]]

McSSetPosList(mcid:integer list:plist)
sets building position list for McSkirmish mcid

McSAddVehicles(mcid:integer weapons:plist chassis:plist engines:plist controls:plist parkingarea:integer)
creates new vehicle definition for McSkirmish mcid, returns number of group

McSChangeVehicles(mcid:integer number:integer weapons:plist chassis:plist engines:plist controls:plist parkingarea:integer)
updates vehicle definition for McSkirmish mcid, group number

McSAddFortification(mcid:integer kinds:plist weapons:plist)
create new fortification definition for McSkirmish mcid, returns number of definition

McSChangeFortification(mcid:integer number:integer kinds:plist weapons:plist)
updates fortification definition for McSkirmish mcid, definition number

McSSetStrategy(mcid:integer list:plist)
sets main strategy list for McSkirmish mcid

McSGetVehList(mcid:integer number:integer)
returns list of vehicles in group number

McSParking(mcid:integer veh:plist park:boolean)
changes list of parking vehicles veh will be added (park=true) or removed (park=false)

McSConditionalStrategyFilter(str:plist)
filters conditional strategy to strategy without conditions (main strategy list)

McRepair(prior:integer units:plist others:plist options:plist)
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]]

McWithdraw(prior:integer repid:integer units:plist options:plist)
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
McCustom(prior:integer units:plist)
runs void macro and returns mcid

GetBuildList(base_or_list:tvalue)
creates BuildList from whole base or list of units (buildings)

SetBattleFlag(side:integer x:integer y:integer options:plist)
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

KillBattleFlag(flagid:integer)
removes battle flag flagid (returns true if succesfull)

FindBattleFlag(x:integer y:integer)
returns flagid of battle flag on [x,y], or -1

GetBattleFlagSide(flagid:integer)
returns side of existing battle flag

ChangeBattleFlagSide(flagid:integer side:integer)
changes side of existing battle flag

ChangeBattleFlagOptions(flagid:integer options:plist)
changes options of existing battle flag

SetAreaMapShow(area:integer id:integer)
shows area on map and/or minimap

MoveAreaXY(area:integer x:integer y:integer)
moves area, left upper corner of deltoid is at specified coordinates

GetMultiplayerSetting(index:integer)
returns value of multiplayer setting with specified index

RaiseSailEvent(num:integer)
raises immediately generic event SailEvent(num)

HexInfo(x:integer y:integer)
returns number of unit on hex, 0 for free and -1 for environment

SendSiberiteRocket(x:integer y:integer)
siberite rocket will explode at hex x,y

CanBeResearched(labor:integer tech:integer)
returns if tech can be researched in lab (if tech is already researched, returns false)

PlaceWeaponTurret(un:integer bc_weapon:integer)
place bc_weapon on turet or bunker un

UnitsLinked(un:integer)
returns number of linked vehicles on unit

FindMaxSkill(units:plist skill:integer)
returns unit with max skill from units
FindMaxSkill2(units:plist skill:integer)
returns unit with max skill from units (including nonplaced)  added by angry jam

GetListOfCratesInArea(area:integer)
returns list of crates positions in area

GetUnitActivity(un:integer)
returns units activity (constants in UDatStr.pas - cin...)

GetTaskList(un:integer)
returns list of lists [task,x,y,obj,par1,par2,patrol] siiiiib (UDatStr - ukol...)

GetUnitNumber(x:integer y:integer)
returns number of unit at pos x, y

FindNearestPoint(list_of_points:plist x:integer y:integer)
returns nearest point to x y from list_of_points

GetResourceVisibility(x:integer y:integer side:integer)
returns true, if deposit at pos x, y is visible for side

SetResourceVisibility(x:integer y:integer side:integer)
sets deposit at pos x, y visible for side

GetListOfResourcesInArea(area:integer)
returns list of deposits positions according to the type, [x,y,typ,...]

FindMinSkill(units:plist skill:integer)
returns unit with min skill from units

CopyTasks(un_dest:integer un_source:integer)
copy tasks from unit un_source to unit_dest (replacing, no patrol)

AddCopyTasks(un_dest:integer un_source:integer)
copy tasks from unit un_source to unit_dest (adding, no patrol)

SetTaskList(un:integer list:plist)
sets tasks from tasklist (GetTaskList format) - use carefully!

AddTaskList(un:integer list:plist)
adds tasks from tasklist (GetTaskList format) - use carefully!

CanBeConstructed(factory:integer chassis:integer engine:integer control:integer weapon:integer)
returns if vehicle can be constructed in factory

CostOfVehicle(chassis:integer engine:integer control:integer weapon:integer)
returns cost in list [cans,oil,sib]

CostOfBuilding(kind:integer nation:integer)
returns cost in list [cans,oil,sib]

CostOfWeapon(weapon:integer)
returns cost in list [cans,oil,sib]

SeeGreyArea(side:integer area:integer)
returns how much hexes of specified area side sees + gray hexes
MineExplosion(x:integer y:integer wound:integer)
explosion of mine at x, y

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))

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

ViewMineAtPos(x:integer y:integer side:integer)
reveal mine at pos x, y for side_fog[side]

MineAtPos(x:integer y:integer)
returns true, if it is mine at pos x, y otherwise false

MineOfUnit(un:integer)
returns [x,y], if unit has placed remote charge otherwise returns false

RemoveMineOfUnit(un:integer)
removes placed remote charge of unit, if exists

BuildingStatus(un:integer)
returns building status (bs_???)

ContactTime(sides:plist)
time from last contact (parameter: side, or [side1,side2])

InBattle(sides:plist)
battle detection (parameter: side, or [side1,side2])

GetProperties(un:integer)
return list of unit properties [speed, defend, sight, range, eff1, eff2, eff3]

ImagineProperties(vehb:integer human:integer cl:integer)
return list of unit properties for vehb with human inside (cl 0 means actual class)

CanCarryHowMuch(un:integer)
returns how much material can unit still carry

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

FindArtifact(size:integer)
finds artifact with size size and returns its position [x,y], or false

PriorityAttack(side:integer un:integer)
prioritni utok strany side na jednotku un

DoNotAttack(side:integer un:integer)
neutoceni pro stranu side na jednotku un

NormalAttack(side:integer un:integer)
zruseni speciality pro stranu side na jednotku un

EnableExclamations(var res:tvalue)
exclamations enabled

DisableExclamations(var res:tvalue)
exclamations disabled

AvailableChassisList(un:integer)
returns list of available components (chassis) - factory, workshop

AvailableEngineList(un:integer)
returns list of available components (engines) - factory, workshop

AvailableControlList(un:integer)
returns list of available components (controls) - factory, workshop

AvailableWeaponList(un:integer)
returns list of available components (weapons) - factory, workshop, turret

GetBuildingTechReq(kind:integer nation:integer)
returns technology required to building of kind, nation (0 - free -1 - not available to nation)

GetTechTechsReq(tech:integer)
returns list of technologies required to research tech

GetTechLab(tech:integer)
returns kind of lab required to research tech

TechNationAvailable(tech:integer nation:integer)
returns true if tech is available to nation

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.

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))

GetActResearch(un:integer)
returns technology actually researching in lab un 0 if no or spec research

SetSpecResearch(un:integer time:integer auto:boolean)
sets (laboratory) un to SpecResearch auto mode time - length use carefully!

SetNoActivity(un:integer)
resets activity of (laboratory) un use VERY carefully!

ValidHex(x:integer y:integer)
{true if hex x,y is valid} 0 - invalid, 1 - bordering, 2 - normal.

Contaminate(side:integer x:integer y:integer)
immediatelly contaminates siberite deposit if succesfull, (raises event and) returns true

SelectUnits(units:plist)
add selection to units

DeselectUnits(units:plist)
removes selection of units

AddExperience(hum:integer sk:integer points:integer)
adds experience points in skill sk to human hum

RemoveTasks(units:plist)
removes all tasks of units

EffectTeleport(x:integer y:integer)
makes effect on hex [x,y]

ArtContamination(x:integer y:integer percentage:integer)
makes contaminated area (percentage of siberite rocket contamination)

ComForceInvisible(units:plist)
list of units receives invisible command

AddComForceInvisible(units:plist)
list of units receives invisible command

EnableVideoExclamations(var res:tvalue)
video exclamations enabled

DisableVideoExclamations(var res:tvalue)
video exclamations disabled

SetBName(units:plist bname:string)
sets building's display string

AreaToMatrix(area:integer)
creates a matrix from the area

WaypointsFromMatrix(matrix:plist areas:plist)
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

SideShoot(un:integer)
returns side, that last shoot unit un

UnitShoot(un:integer)
returns unit, that last shoot unit un

SetUnitDisplayNumber(un:integer num:integer)
displays number num over the unit un (even in final Original War)... zero means display nothing

SetMultiScore(side:integer score:integer)
sets multiplayer score of specified side

GetMultiScore(side:integer)
gets multiplayer score of specified side

ResetMultiScore(var res:tvalue)
resets multiplayer score for all sides

Constructable(chas:integer eng:integer con:integer weap:integer)
returns true, if vehicle constructable

CopySkills(un1:integer un2:integer)
copies skills between units (un1->un2)