Bug #26214

Units recruited at barracks can sometimes get stuck inside

Added by eightysix over 5 years ago. Updated over 5 years ago.

Status:Closed Start date:11/06/2011
Priority:Normal Due date:
Assignee:eightysix % Done:


Target version:A2 Patrol Ops 2.02


Updated by Bon over 5 years ago

I use this in the "recruit.sqf" script:

/********************* UNIT CREATION ********************/
_spawnpos = call {
_ang = random 360;
_radius = 25;
_a = (getPos bon_recruit_barracks select 0)+(sin(_ang)*_radius);
_b = (getPos bon_recruit_barracks select 1)+(cos(_ang)*_radius);
_unit = group player createUnit [_unittype,_spawnpos,[],0,"FORM"];
_unit setRank "PRIVATE";
[_unit] execVM (BON_RECRUIT_PATH+"init_newunit.sqf");

Imagine a circle of 25m radius around the barracks tent. This code makes the AI spawn somewhere on the circle, not closer nor farther away from the barracks.
Anyway, the most easy and elegant solution probably would be just to use another object for barracks. Maybe a flagpole...

Updated by eightysix over 5 years ago

  • Status changed from New to Closed
  • % Done changed from 70 to 100

went with a flag in the end after some testing. most reliable method.

Also available in: Atom PDF