Hi
I've made a german WWII bunker addon.
It has 5 building positions
When placed in the mission editor I use a init line to call a script.
This script creates an machine gun and positions it relative to the location and direction of the bunker.
Using units added in the mission editor, with their formation set to 'none', I can get a unit to go to a certain position in the building and stay there using the following init line
"this setPos ((nearestBuilding this) buildingPos 1); CommandStop this; this setBehaviour AWARE; this setCombatMode YELLOW; this SetUnitPos UP"
I'm trying to achive the same thing via a script so that a mission editor can just place my bunker and call my script from the init line to have it fully crewed and with an MG.
However it just isn't working. I'm using the following code to create the unit, assign its group and move it into position.
"EC_MP40Sol" createUnit [getpos _Object, BunkerGuard, "e2 = this; this setPos ((nearestBuilding this) buildingPos 2); this SetUnitPos UP", 1, "SERGEANT"]
This seems to work except for the fact as no formation is specified the unit goes into a position for the default formation (wedge I think).
The command reference doesn't show a valid value for 'no formation' and I've tried including
e2 setFormation "NONE"
but this doesn't seem to have any affect.
Can anyone tell me what I'm doing wrong?
Bazooka_Boy