User Tools

Site Tools


arma:scripting:pmc_logic1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
arma:scripting:pmc_logic1 [2007/07/13 06:20] – created pmc_logics1 initial page snakemanarma:scripting:pmc_logic1 [2024/08/01 10:43] (current) – links added. snakeman
Line 1: Line 1:
-====== Units on GameLogics ======+====== ArmA 1 Units On GameLogics ======
  
-**Units on GameLogics** by Snake Man+[[https://www.pmctactical.org/forum/viewforum.php?f=42|ArmA 1 Forum]], [[:arma|ArmA 1 Home]], [[arma:config|ArmA 1 Config]], [[arma:tools|ArmA 1 Tools]], [[arma:file_formats|ArmA 1 File Formats]], [[arma:missions|ArmA 1 Missions]], [[arma:modeling|ArmA 1 3D Modeling]], [[arma:terrain|ArmA 1 Terrain]], [[arma:texturing|ArmA 1 Texturing]], [[arma:scripting|ArmA 1 Scripting]] 
 + 
 +**ArmA 1** aka Armed Assault (ArmA) 
 + 
 +**Units On GameLogics** by Snake Man
  
 This was the very first script I put together, took a look Evolutions makeshilka function and adapted that. This will scan all **gameLogic**s named "**pmc_**?" where the **?** is a number digit ranging from **1** to **10** or more. Then if it finds a match, it runs the functions to create vehicle + soldiers in that gamelogic's grid coordinates position. This was the very first script I put together, took a look Evolutions makeshilka function and adapted that. This will scan all **gameLogic**s named "**pmc_**?" where the **?** is a number digit ranging from **1** to **10** or more. Then if it finds a match, it runs the functions to create vehicle + soldiers in that gamelogic's grid coordinates position.
  
-<code>+The whole point of this kind of method is that to create this mission, all you need to do is to place your unit/group and then what ever number of gamelogics. When you create gamelogic called "pmc" and then copy paste it around (CTRL-C and then CTRL-V) mission editor automatically creates the "pmc_1"... "pmc_2" and so on. 
 +<code cpp>
 _allvecA = ["UAZ_AGS30","UAZMG","BRDM2","BMP2","ZSU","T72"]; _allvecA = ["UAZ_AGS30","UAZMG","BRDM2","BMP2","ZSU","T72"];
 _allvecB = ["UralRepair","UralReammo","UralRefuel","Ural","UralOpen"]; _allvecB = ["UralRepair","UralReammo","UralRefuel","Ural","UralOpen"];
 _allvecC = ["Mi17","Mi17_mg"]; _allvecC = ["Mi17","Mi17_mg"];
  
- +_PMC_MakeTank =
-PMC_MakeTank =+
 { {
  _myVec = (_allvecA select round random (_maxA - 1));  _myVec = (_allvecA select round random (_maxA - 1));
  _vcl = _myVec createVehicle _respawnpoint;  _vcl = _myVec createVehicle _respawnpoint;
  _vcl setpos _respawnpoint;  _vcl setpos _respawnpoint;
- _grp=objNull;+ _grp = objNull;
  waitUntil {  waitUntil {
  _grp = createGroup (east);  _grp = createGroup (east);
  !(isNull _grp);  !(isNull _grp);
  };  };
- +
  "SoldierECrew" createUnit [_respawnpoint, _grp];  "SoldierECrew" createUnit [_respawnpoint, _grp];
  "SoldierECrew" createUnit [_respawnpoint, _grp];  "SoldierECrew" createUnit [_respawnpoint, _grp];
Line 48: Line 52:
 }; };
  
-PMC_MakeGuardInf =+_PMC_MakeGuardInf =
 { {
- _grp=objNull; + _grp = objNull; 
- waitUntil {+ waitUntil 
 +        {
  _grp = createGroup (east);  _grp = createGroup (east);
  !(isNull _grp);  !(isNull _grp);
  };  };
- +
  "SquadLeaderE" createUnit [_respawnpoint, _grp];  "SquadLeaderE" createUnit [_respawnpoint, _grp];
  "TeamLeaderE" createUnit [_respawnpoint, _grp];  "TeamLeaderE" createUnit [_respawnpoint, _grp];
Line 75: Line 80:
  
 // choose new digit for the gamelogic "pmc_*" // choose new digit for the gamelogic "pmc_*"
-_a=1;+_a = 1;
 _p = call compile format["pmc_%1",_a]; _p = call compile format["pmc_%1",_a];
  
Line 85: Line 90:
  
  // the position of our gamelogic  // the position of our gamelogic
- _respawnpoint = getpos _p; + _respawnpoint = getPos _p; 
- [] call PMC_MakeTank+ [] call _PMC_MakeTank
- [] call PMC_MakeGuardInf; + [] call _PMC_MakeGuardInf;
  
  // add one digit to our gamelogic name.  // add one digit to our gamelogic name.
- _a=_a+1;+ _a = _a + 1;
  _p = call compile format["pmc_%1",_a];  _p = call compile format["pmc_%1",_a];
 }; };
 </code> </code>
 +The vehicles come in random type, however soldiers are always the "basic squad" style.
  
-The vehicles come in random type, however soldiers are always the "basic squad" style. 
arma/scripting/pmc_logic1.1184307648.txt.gz · Last modified: 2007/07/13 06:20 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.