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]
snakeman created pmc_logics1 initial page
arma:scripting:pmc_logic1 [2009-04-10 00:59] (current)
Line 5: Line 5:
 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);
Line 48: Line 48:
 }; };
  
-PMC_MakeGuardInf ​=+_PMC_MakeGuardInf ​=
 { {
- _grp=objNull;​ + _grp = objNull; 
- waitUntil {+ waitUntil 
 +        ​{
  _grp = createGroup (east);  _grp = createGroup (east);
  !(isNull _grp);  !(isNull _grp);
Line 75: Line 76:
  
 // 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 86:
  
  // 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