User Tools

Site Tools


arma:scripting:pmc_logic1

This is an old revision of the document!


Units on GameLogics

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 gameLogics 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.

_allvecA = ["UAZ_AGS30","UAZMG","BRDM2","BMP2","ZSU","T72"];
_allvecB = ["UralRepair","UralReammo","UralRefuel","Ural","UralOpen"];
_allvecC = ["Mi17","Mi17_mg"];


PMC_MakeTank =
{
	_myVec = (_allvecA select round random (_maxA - 1));
	_vcl = _myVec createVehicle _respawnpoint;
	_vcl setpos _respawnpoint;
	_grp=objNull;
	waitUntil {
		_grp = createGroup (east);
		!(isNull _grp);
	};
	
	"SoldierECrew" createUnit [_respawnpoint, _grp];
	"SoldierECrew" createUnit [_respawnpoint, _grp];
	"SoldierECrew" createUnit [_respawnpoint, _grp];
	(units _grp select 0) moveInCommander _vcl;
	(units _grp select 1) moveInGunner _vcl;
	(units _grp select 2) moveInDriver _vcl;

	"SquadLeaderE" createUnit [_respawnpoint, _grp];
	"TeamLeaderE" createUnit [_respawnpoint, _grp];
	"SoldierEG" createUnit [_respawnpoint, _grp];
	"SoldierEMG" createUnit [_respawnpoint, _grp];
	"SoldierEAT" createUnit [_respawnpoint, _grp];
	"TeamLeaderE" createUnit [_respawnpoint, _grp];
	"SoldierEG" createUnit [_respawnpoint, _grp];
	"SoldierEMG" createUnit [_respawnpoint, _grp];
	"SoldierESniper" createUnit [_respawnpoint, _grp];

	_grp addWaypoint [_respawnpoint, 200];
	[_grp, 0] setWaypointBehaviour "AWARE";
	[_grp, 0] setWaypointCombatMode "RED";
	[_grp, 0] setWaypointSpeed "FULL";
	[_grp, 0] setWaypointFormation "WEDGE";
	[_grp, 0] setWaypointType "MOVE";
	[_grp, 1] setWaypointType "SENTRY";
};

PMC_MakeGuardInf =
{
	_grp=objNull;
	waitUntil {
		_grp = createGroup (east);
		!(isNull _grp);
	};
	
	"SquadLeaderE" createUnit [_respawnpoint, _grp];
	"TeamLeaderE" createUnit [_respawnpoint, _grp];
	"SoldierEG" createUnit [_respawnpoint, _grp];
	"SoldierEMG" createUnit [_respawnpoint, _grp];
	"SoldierEAT" createUnit [_respawnpoint, _grp];
	"TeamLeaderE" createUnit [_respawnpoint, _grp];
	"SoldierEG" createUnit [_respawnpoint, _grp];
	"SoldierEMG" createUnit [_respawnpoint, _grp];
	"SoldierESniper" createUnit [_respawnpoint, _grp];

	_grp addWaypoint [_respawnpoint, 500];
	[_grp, 0] setWaypointBehaviour "AWARE";
	[_grp, 0] setWaypointCombatMode "RED";
	[_grp, 0] setWaypointSpeed "FULL";
	[_grp, 0] setWaypointFormation "WEDGE";
	[_grp, 0] setWaypointType "GUARD";
};

// choose new digit for the gamelogic "pmc_*"
_a=1;
_p = call compile format["pmc_%1",_a];

// loop until we have no gamelogics left, it then should return 0.
while {(getpos _p select 0) != 0} do
{
	// debug :)
	player sidechat format["_p: %1 _a: %2",_p,_a];

	// the position of our gamelogic
	_respawnpoint = getpos _p;
	[] call PMC_MakeTank;
	[] call PMC_MakeGuardInf;


	// add one digit to our gamelogic name.
	_a=_a+1;
	_p = call compile format["pmc_%1",_a];
};

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.