Create an account

Commands - Script values

Upload: 23 Aug 2022, 09:22
Uploaded by: Aqxaro

WHAT COMMANDS TO WRITE IN THE SCRIPT
Β  Β  Β  Β 
WHAT THESE SCRIPTS MEAN

(script commands are given in alphabetical order)
At the very bottom is a list of commands without explanation, to make them easier to find and copy.
===========================

1. DIRECTLY TEAM
===========================

AskClient("SetCamera(2892,5228)");

Set the camera (space on the screen, which the player now sees) to such coordinates (we divide the necessary script coordinates by 1.4)
========

AddIronMan(117);

Forbid the computer to supply its unit with script number 117 (put the one you need)
========
Β 
ChangePlayer(100,0);

Unit with script number 100make ours - the second digit is 0, if the company (enemy) - the second digit is 1;
if neutral - put the second digit 2.
========

Cmd(iAction,iScriptID,params,params);
QCmd -next command

Give a command (team number, script unit number, coordinates)
========

DamageObject(iScriptID,0);

Destroy object (script number, 0)
If the second digit is 0 (zero) - the object is destroyed, If the second digit is negative, such as (-2), then the object is treated
========

DeleteReinforcement(1);

Remove units from the map
with script number 1 (or any other script number).
Don't let the word Reinforcement fool you, you can also remove a unit that was originally on the map.
========

DisplayTrace("");

In quotation marks, write any message, which will be displayed in the game in the upper left corner of the screen
========

DisableAviation(1.0); --scout
DisableAviation(1,1); --fighter
DisableAviation(1,2); --landing
DisableAviation(1.3); --bomber
DisableAviation(1.4); -- attack aircraft

Prohibit aviation for the company - the first digit is 1,
if the first digit is set to 0 (zero) - then for the player
========

EnableAviation(1,0); --scout
EnableAviation(1,1); --fighter
EnableAviation(1,2); --landing
EnableAviation(1,3); --bomber
EnableAviation(1,4); -- attack aircraft

Allow aviation for the computer - the first digit is 1, if the first digit is set to 0 (zero) - then for the player
========
========

GiveCommand(19,10000,1,GetScriptAreaParams("")); --bombers
GiveCommand(36,10000,1,GetScriptAreaParams("")); -- attack aircraft
GiveCommand(22,10000,1,GetScriptAreaParams("")); -- landing
GiveCommand(20,10000,1,GetScriptAreaParams("")); --fighters
GiveCommand(21,10000,1,GetScriptAreaParams("")); --scout
GiveCommand
GiveQCommand

This is a synonym for Cmd,
36, 22, 20 and 21 - aircraft type, GetScriptAreaParams("") is a variant of coordinates, in quotation marks indicate the name of the zone
========================
========================

GetObjCoord(iScriptID);

The game (program) determines the coordinates of the object (unit) with a specific script number.
By itself, this does not give the player anything, because is not displayed anywhere.
This spelling (command) is usually used
when to indicate the direction of attack

For example:
cmd(3,200,GetObjCoord(100));

What does it mean: command to attack unit number 200 to the point with coordinates where object (unit) No. 100 is located
========================

GetScriptAreaParams("Area");
The game (program) determines the coordinates of the zone (In quotes enter the name of the zone).
Similar to the previous command - by itself does not give the player anything, used to indicate the direction of attack or movement.

For example:
Cmd(3,200,GetScriptAreaParams("Area"));

What does it mean: command to attack unit number 200
in the direction of the coordinates of this zone.

========================

GetAviationState(iPlayer);

The program determines the type of the last aircraft called belligerent
(if 0 - then player, if 1 - comp, if 2 - neutral)
Not used on its own but as a condition.

For example:
if (GetAviationState(1)==3)then
EnableAviation(0,1);

What does it mean:
If comp (1) launched a bomber (==3), then make fighters available to the player
========================

GetNMinesInScriptArea("Name")

Program number of minutes
in the scenario area (indicate the name of the zone).
Again, used as a condition.

For example:
if (GetNMinesInScriptArea("selo")>50)then
Cmd(3,200,GetScriptAreaParams("selo"));

What does it mean:
If we set more than 50 minutes in the "selo" zone, then command "attack" to units with number 200 to the coordinates of this "village".

========================

KillScript("");

Kill (remove from scripts)
function "" - specify the name of the function, i.e.
this function will no longer work.
Used, any commands in the prescribed function no longer needed.
========================

Land Reinforcement();

Land reinforcements with #100
(the number of reinforcement numbers is indicated in brackets)
========================

local x,y =

Set local variable.
Please note that there is only one "equal" sign, it means "to assign".
Double (x,y) variable name is used usually for two parameters, such as coordinates.
If this is a single number, then the word must be one.

ATTENTION
Variable must not be a number
and denoted only by letters (word).
========================

Objecti

veChanged(1,0);

Highlight task number 1.
The second digit means:
0 - issuing a task,
1 - task completed,
2 - task not completed.
========================

+RandomInt(n)

Random number.
The program generates a random number ranging from 0(zero) to n-1 (minus one)
The number in parentheses must be falls within this range.
========================

RunScript("",5000);

Function initiation is required.
In quotation marks in Latin, the name of the function, the number means after what time it will work
The number is written in milliseconds, in this case it is 5 seconds.
========================

SwitchWeather(0);

Set good weather
========================

SwitchWeatherAutomatic(0);

prevent computer from changing weather
========================

suicide();
mandatory spelling at the end of most functions "Kills" the function if it has already run, so that her commands are not endlessly repeated.

end; --end condition
(if it is in the function), if not, then do not

end; -- end of function (required)
========================

loose(0);

Displays the "You lost" window)
========================

Win(0);

Displays the "Victory" window)

========================

ViewZone("", 1); - at 1-see
Β  Β  Β  Β  Β  Β  Β  Β  Β  Β at 0-hide
Enter the name of the zone in quotation marks.
ATTENTION
Works only for round zones.
========================

------Set Global Variable-------------
SetIGlobalVar("variable name", integer parameter);
SetFGlobalVar("variable name", floating point parameter);
SetSGlobalVar("variable name", string parameter);
------Get (define) a global variable-------------
GetIGlobalVar("variable name", parameter);
GetFGlobalVar("variable name", parameter);
GetSGlobalVar("variable name", parameter);

ABOUT GLOBAL VARIABLES.
Their names can be written in any word, most importantly in Latin.
The name should not be identical to the name of the function, zone.
Its value works for all scripts, i.e. throughout the mission.

It is usually used as a fixed parameter for
some events.
For example:

ObjectiveChanged(1,0);
SetIGlobalVar("temp.pervoezadanie", 0);
--------When in one of the functions we give the player a task,
then set the global variable "pervoezadanie",
zero.
Prefix temp. in GZM is mandatory, the stable operation of the mission depends on it.

Then, when the player completes this task, we'll give it a value of 1.
ObjectiveChanged(1,1);
SetIGlobalVar("temp.pervoezadanie", 1); -set variable value 1

When the player completes this task, we do not know.
But we need to do something after that.
Therefore, we write a condition in another function:

if (GetIGlobalVar("temp.pervoezadanie", 0)==1)then
cmd(3,200, 2500,3200);

What does it mean:
If the value of the global variable "pervoezadanie"
with primary value 0 becomes equal to 1 (i.e. the player will complete the first task), command unit #200 to attack (command 3) to coordinates x = 2500, y = 3200.

========================
========================

2. CONDITIONS
==========
==========
if (GetNUnitsInArea(iParty,"Area")>0)then

If the number of units in the party (0-player, 1-computer) is greater than zero (infantry counts by platoon)
=========================

if (GetNScriptUnitsInArea(iScriptID,"Area")>=0)then

If the number of units in the zone (should be done in map editor) is greater than or equal to zero. In brackets: script unit number, "zone name".
=========================

if (GetNUnitsInArea(iPlayer,"Area")>=0)then

If the number of units in the zone is greater than or equal to zero, in brackets: 1-computer, 0-player, "zone name".
=========================

if (GetNUnitsInScriptGroup(iScriptID,iParty)==0)then

If the number of units from script number iScriptID(number, dowry in the map editor unit-to-units), belonging to iParty(0-player, 1-computer) is equal to zero (infantry is counted by the number of soldiers, not platoons)
=========================

if (GetNUnitsInParty(iParty)<=1) then

If the number of units on the map
iParty - 1 if enemy, 0 - if player is less than or equal to 1
=========================

if (GetNUnitsOfType("iType",iParty) ==0) then

If quantity
unit type ("type here", here 1-comp or 0-player)
zero

Β  Β  Spelling of unit types
(see their type in file 1.xml of the unit
in cursive: <Type>trn_support</Type>)

arm_super --super heavy tank
arm_heavy -- heavy tank
arm_medium --medium tank
arm_light -- light tank

spg_antitank --p/t self-propelled guns
spg_assault --self-propelled guns
spg_super --super self-propelled guns

trn_support -- repair vehicle
trn_carrier --carrier resupplying truck
transport_tractor --tractor
trn_medicine --medical vehicle

art-howitzer --howitzer
art_mortar --mortar
art_gun --p/t gun
art_heavy_gun -- heavy gun, type A-19 and ML-20
art_aagun -- anti-aircraft gun
art_heavy_mg -- heavy machine gun (like maxim or DShK)

soldier - infantry
engineer - sapper, artilleryman
officer
sniper

avia_fighter -- fighter
avia_bomber --bomber
avia_attack --sh

turmovik
avia_lander -- landing
avia_scout -- scout

=========================

if (GetNUnitsInCircle(iPlayer,x,y,Radius)> 0)then

If the number of player units (then set 0 (zero),
if the company - put 1 (one),
in a circle with center x,y (here we put the script coordinates of the point, see in the map editor) and radius(for example 1200)
- this is the number approximately in the maximum visibility radius of units

ATTENTION: CENTER COORDINATES (AS IN OTHER SIMILAR
CASES CAN BE SET THROUGH A LOCAL VARIABLE:

local x,y = GetObjCoord(iScriptID);

This means that the coordinates are the location of the object (or unit) with a specific script number iScriptID, e.g. GetObjCoord(200)

=========================

if (GetNAmmo(iScriptID)>0)then

If the number of shells for a unit with a script number (put the number of the number)
Above zero
The number of shells (cartridges) see in file 1.xml of the unit
=========================

if (GetObjectHPs(iScriptID)>0)then

If the amount of life is HPs (hit points)
(if zero, then the object is destroyed) object (but not a unit! - does not work on a unit) greater than zero, then...
=========================

if (GetUnitState(iScriptID)==1) then

If the state of the unit (what it is currently doing)
with script number
(indicate specific unit number) is 1, then...

Β  Β  Β  UNITS STATES (WHAT THEY DO)
Infantry
1 - nothing
3 - sit on a tank or in a car
5 - run to get on a tank or in a car
6 - run into the building
7 - run into the trench
8 - sitting in the building
9 - sitting in a trench
11 - run with an attack
13 - run to attack the target
15 - hid
21 - shoot at the target
27 - fly with a parachute
32 - go
33 - looking through binoculars
45 - capture the cannon

tank or car
0 - dug in
1 - nothing
2 - if infantry lands
4 - if landing infantry
11 - rides with an attack
15 - hid
21 - attacks the target
32 - rides
43 - turns

Howitzer
0 - digs in / clings to the cannon (?)
1 - just worth it
15 - hid
16 - aimed fire
21 - attacks a unit / suppresses enemy artillery
24 - attached to the car
34 - constant fire
43 - turns
========================
========================
THE END
========================
========================

AskClient("SetCamera(2892,5228)");
AddIronMan(117);
Β 
ChangePlayer(100,0);
Cmd(iAction,iScriptID,params,params);
Qcmd
DamageObject(iScriptID,0);
DeleteReinforcement(1);
DisplayTrace("");
DisableAviation(1.0); --scout
DisableAviation(1,1); --fighter
DisableAviation(1,2); --landing
DisableAviation(1.3); --bomber
DisableAviation(1.4); -- attack aircraft
EnableAviation(1,0); --scout
EnableAviation(1,1); --fighter
EnableAviation(1,2); --landing
EnableAviation(1,3); --bomber
EnableAviation(1,4); -- attack aircraft
GiveCommand(19,10000,1,GetScriptAreaParams("")); --bombers
GiveCommand(36,10000,1,GetScriptAreaParams("")); -- attack aircraft
GiveCommand(22,10000,1,GetScriptAreaParams("")); -- landing
GiveCommand(20,10000,1,GetScriptAreaParams("")); --fighters
GiveCommand(21,10000,1,GetScriptAreaParams("")); --scout
GiveCommand
GiveQCommand
GetObjCoord(iScriptID);
GetScriptAreaParams("Area");
GetAviationState(iPlayer);
GetNMinesInScriptArea("Name")
KillScript("");
Land Reinforcement();
local x,y =
ObjectiveChanged(1,0);
+RandomInt(n)
RunScript("", 3300);
SwitchWeather(0); --good weather
SwitchWeatherAutomatic(0); --prohibits weather changes
suicide();
end;
end;
loose(0);
Win(0);

ViewZone("", 1); - at 1-see
Β  Β  Β  Β  Β  Β  Β  Β  Β  Β at 0-hide
------Set Global Variable-------------
SetIGlobalVar("variable name", integer parameter);
SetFGlobalVar("variable name", floating point parameter);
SetSGlobalVar("variable name", string parameter);
------Get (define) a global variable-------------
GetIGlobalVar("variable name", parameter);
GetFGlobalVar("variable name", parameter);
GetSGlobalVar("variable name", parameter);
if (GetNUnitsInArea(iParty,"Area")>0)then
if (GetNScriptUnitsInArea(iScriptID,"Area")>=0)then
if (GetNUnitsInArea(iPlayer,"Area")>=0)then
if (GetNUnitsInScriptGroup(iScriptID,iParty)==0)then
if (GetNUnitsInParty(iParty)<=1) then
if (GetNUnitsOfType("iType",iParty) ==0) then

arm_super --super heavy tank
arm_heavy -- heavy tank
arm_medium --medium tank
arm_light -- light tank

spg_antitank --p/t self-propelled guns
spg_assault --self-propelled guns
spg_super --super self-propelled guns

trn_support -- repair vehicle
trn_carrier --carrier resupplying truck
transport_tractor --tractor
trn_medicine --medical vehicle

art-howitzer --howitzer
art_mortar --mortar
art_gun --p/t gun
art_heavy_gun -- heavy gun, type A-19 and ML-20
art_aagun -- anti-aircraft gun
art_heavy_mg -- heavy machine gun (like maxim or DShK)

soldier - infantry
engineer - sapper, artilleryman
officer
sniper

avia_fighter -- fighter
avia_bomber --bomber
avia_attack -- attack aircraft
avia_lander -- landing
avia_scout -- scout

if (GetNUnitsInCircle(iPlayer,x,y,Radius)> 0)then

if (GetNAmmo(iScriptID)>0)then

if (GetObjectHPs(iScriptID)>0)then

if (GetUnitState(iScriptID)==1) then

UNITS STATES (WHAT THEY DO)
Infantry
1 - nothing
3 - sit on a tank or in a car
5 - run to get on a tank or in a car
6 - run into the building
7 - run into the trench
8 - sitting in the building
9 - sitting in a trench
11 - run with an attack
13 - run to attack the target
15 - hid
21 - shoot at the target
27 - fly with a parachute
32 - go
33 - looking through binoculars
45 - capture the cannon

tank or car
0 - dug in
1 - nothing
2 - if infantry lands
4 - if landing infantry
11 - rides with an attack
15 - hid
21 - attacks the target
32 - rides
43 - turns

Howitzer
0 - digs in / clings to the cannon (?)
1 - just worth it
15 - hid
16 - aimed fire
21 - attacks a unit / suppresses enemy artillery
24 - attached to the car
34 - constant fire
43 - turns

CSLA mod 2.0 (EN) 882,9 MB

CSLA mod 2.0 (EN)

15 Mar 2024
0
332
0

CSLA mod's objective is to approximate to post-nuclear central European warfare during the 1980s. Everything should be real - numbers of troops, equipment, military tactic, period battle plans, battle maps according to real satellite maps etc.

Comments
The minimum comment length is 10 characters.