PMC websites shut down October 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.

Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond october 13th 2025 when yearly web hosting fees are due.

User Tools

Site Tools


arma:scripting:pmc_logic1

ArmA 1 Units On GameLogics

ArmA 1 Forum, ArmA 1 Home, ArmA 1 Config, ArmA 1 Tools, ArmA 1 File Formats, ArmA 1 Missions, ArmA 1 3D Modeling, ArmA 1 Terrain, ArmA 1 Texturing, 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 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.

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.

_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.txt · Last modified: 2024/08/01 10:43 by snakeman