Jump to content
Sign in to follow this  
xtesic

hmmm..really struggling with this...move troops incargo

Recommended Posts

here is what i want:

on activation trigger1: a zamak spawns and drives down the road to you.

but i want troops inside that zamak transport.

so i think i have to spawn a group of units and move them into the zamak...

when i try, the zamak and units just go down the road and zamak is empty except driver...

this is the car and the AA units scripted, with a waypoint to SAD.

if (!isServer) exitWith {} ;

car = [getmarkerpos "mk1", EAST, ["O_Truck_02_covered_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;

wp1 = car addWaypoint [getmarkerpos "wp1", 0];

wp1 setWaypointType "SAD";

wp1 setWaypointSpeed "FULL";

wp1 setWaypointBehaviour "AWARE";

antiair = [getmarkerpos "mk2", WEST, ["B_soldier_AA_F","B_soldier_AA_F","B_soldier_AA_F","B_soldier_AA_F"],[],[],[],[],[],90] call BIS_fnc_spawnGroup;

wp2 = antiair addWaypoint [getmarkerpos "wp2", 0];

wp2 setWaypointType "SAD";

wp2 setWaypointSpeed "FULL";

wp2 setWaypointBehaviour "AWARE";

Share this post


Link to post
Share on other sites

tried this, didnt work:

if (!isServer) exitWith {} ;

hmg4 = [getmarkerpos "mk4", EAST, ["O_Truck_02_transport_F","O_crew_F","O_crew_F","O_crew_F","O_crew_F","O_crew_F","O_Soldier_F","O_Soldier_F","O_Soldier_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;

wp4 = hmg4 addWaypoint [getmarkerpos "wp4", 0];

wp4 setWaypointType "SAD";

wp4 setWaypointSpeed "FULL";

wp4 setWaypointBehaviour "AWARE";

Share this post


Link to post
Share on other sites

tried this...also didnt work, pls help,

truck moves to wp and units stay behind doing nothing

if (!isServer) exitWith {} ;
transport1 = [getmarkerpos "mk20", EAST, ["O_Truck_02_transport_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
 wp20 = transport1 addWaypoint [getmarkerpos "wp20", 0];
     wp20 setWaypointType "MOVE";
     wp20 setWaypointSpeed "NORMAL";
     wp20 setWaypointBehaviour "AWARE";
rifle21 = [getmarkerpos "mk21", EAST,    ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F","O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_lite_F"],[],[],[],[],[],230] call    BIS_fnc_spawnGroup;
rifle21 moveInCargo transport1;

tis also didnt work...pfff

if (!isServer) exitWith {} ;
transport1 = [getmarkerpos "mk20", EAST, ["O_Truck_02_transport_F"],[rifle21 moveInCargo transport1],[],[],[],[],180] call BIS_fnc_spawnGroup;
 wp20 = transport1 addWaypoint [getmarkerpos "wp20", 0];
     wp20 setWaypointType "MOVE";
     wp20 setWaypointSpeed "NORMAL";
     wp20 setWaypointBehaviour "AWARE";
rifle21 = [getmarkerpos "mk21", EAST,    ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F","O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_lite_F"],[rifle21 moveInCargo transport1],[],[],[],[],230] call    BIS_fnc_spawnGroup;
this moveInCargo transport1;

Edited by xtesic

Share this post


Link to post
Share on other sites

Still posting in the wrong section again xtesic!!

Scripting questions should be posted in ARMA-3-MISSION-EDITING-AND-SCRIPTING

Your query would be better (and answered faster) if asked there. :cool:

Also when posting code, put it in between "["php"]"YOUR CODE"["/php"]" without the "".

Anyway, to answer your question try replacing

rifle21 moveInCargo transport1;

with

{_x  moveInCargo transport1;
} foreach units rifle21;

Edited by Beerkan

Share this post


Link to post
Share on other sites

Tried that, didnt work, says : missing ]

When adding ] it keeps saying: missing ]

just wanna spawn a loaded zamak moving to a wp ....GRRRRRR

This is what i have now:

if (!isServer) exitWith {} ;
transport1 = [getmarkerpos "mk20", EAST, ["O_Truck_02_transport_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
wp20 = transport1 addWaypoint [getmarkerpos "wp20", 0];
wp20 setWaypointType "MOVE";
wp20 setWaypointSpeed "NORMAL";
wp20 setWaypointBehaviour "AWARE";
rifle21 = [getmarkerpos "mk21", EAST, ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F" ,"O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_li te_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;
(_x  moveInCargo transport1;
} foreach units rifle21;

Share this post


Link to post
Share on other sites

This is what i have now:

if (!isServer) exitWith {} ;
transport1 = [getmarkerpos "mk20", EAST, ["O_Truck_02_transport_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
wp20 = transport1 addWaypoint [getmarkerpos "wp20", 0];
wp20 setWaypointType "MOVE";
wp20 setWaypointSpeed "NORMAL";
wp20 setWaypointBehaviour "AWARE";
rifle21 = [getmarkerpos "mk21", EAST, ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F" ,"O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_lite_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;
(_x  assignAsCargo transport1;
_x  moveInCargo transport1;
} foreach units rifle21;

OK,

If you look at your script, you are creating a group called "transport1" spawned at location "mk20", in a vehicle of type "O_Truck_02_transport_F"

you are then creating another group called "rifle21" at location "mk21"

The line moveinCargo is trying to move group "rifle21" into a group "transport1". BUT "transport1" is not a vehicle, it's a group consisting of a driver and a co-driver, who are in the spawned "O_Truck_02_transport_F".

Here is a working script.

Create a group called "drivers". No units are assigned to this group yet.

Spawn your "transport1" vehicle with an AI group named "drivers".

Set the name "truck" as the vehicle name of "drivers" "O_Truck_02_transport_F"

Now "rifle21" group will get into the "truck", and "drivers" will move to your waypoint.

This works.

	if (!isServer) exitWith {};
drivers = creategroup EAST;
transport1 = [(getMarkerPos "mk20"), 180, "O_Truck_02_transport_F", drivers] call BIS_fnc_spawnVehicle;
truck = (transport1 select 0);
rifle21 = [getmarkerpos "mk21", EAST, ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F" ,"O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_lite_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;
	{_x moveinCargo truck;
	} foreach units rifle21;
wp20 = drivers addWaypoint [(getmarkerpos "wp20"), 0];
wp20 setWaypointType "MOVE";
wp20 setWaypointSpeed "NORMAL";
wp20 setWaypointBehaviour "AWARE";

Edited by Beerkan

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×