Jump to content
Play3r

Make Spawned group get in a helicopter

Recommended Posts

Hey guys and girls.

I am trying my first time in making a group spawn in my mission.

it is a MP game and it is all for making the base look alive.

I can spawn the group and i can make them move, But i can't get them to go inside a helicopter.

I have tried with GETIN and GETIN NEAREST.

The Helicopter is not spawned in to game it is placed in editor.

 

How can i make this work as simple as possible 

 

_spawngroup = [getMarkerPos "MARK1", INDEPENDENT, ["I_G_Soldier_A_F", "I_G_Soldier_F", "I_G_Soldier_AR_F"]] call BIS_fnc_spawnGroup;

 

_wp1 = _spawngroup addWaypoint [getmarkerpos "wp1", 0];
    _wp1 setWaypointType "MOVE"; 
    _wp1 setWaypointSpeed "NORMAL";
    _wp1 setWaypointBehaviour "CARELESS";
    _wp1 setWaypointFormation "COLUMN";
 
_wp2 = _spawngroup addWaypoint [getmarkerpos "WP2", 0];
    _wp2 setWaypointType "GETIN NEAREST"; 
    _wp2 setWaypointSpeed "NORMAL";
    _wp2 setWaypointBehaviour "CARELESS";
    _wp2 setWaypointFormation "COLUMN";

Share this post


Link to post
Share on other sites

Try putting the GETIN waypoint on same pos as the helo

 

like:

 

_wp2 = _spawngroup addWaypoint [getpos HeloName, 0];

Share this post


Link to post
Share on other sites
7 minutes ago, gc8 said:

 

_wp2 = _spawngroup addWaypoint [getpos HeloName, 0];

 

Sad to say @gc8it did not do the trick,did try it with GETIN NEAREST also.

any other ideas 

Share this post


Link to post
Share on other sites
2 minutes ago, Play3r said:

 

Sad to say @gc8it did not do the trick,did try it with GETIN NEAREST also.

any other ideas 

 

You have the helo named in the editor? that name needs to go to the getpos

Share this post


Link to post
Share on other sites

yes it is called spawnheli

 

my line is like this :

_wp2 = _spawngroup addWaypoint [getpos spawnheli, 0];

Share this post


Link to post
Share on other sites

Idk maybe the helo needs to have LOAD waypoint or something I'm out of ideas because I rarely use the editor WPs

Share this post


Link to post
Share on other sites

@Play3r,

You can make them move with the waypoint no problem, right? So maybe fake the loading into the helicopter bit with some kind of assign/moveInCargo foreach?

Share this post


Link to post
Share on other sites

okey @gc8 thanks for your time,i hope someone else can tell me the way to solve my small problem(i think it is).

all they do is walk over to the heli and look at it- 🤔

Share this post


Link to post
Share on other sites
1 minute ago, wogz187 said:

@Play3r,

You can make them move with the waypoint no problem, right? So maybe fake the loading into the helicopter bit with some kind of assign/moveInCargo foreach?

I was thinking the same thing but do not know how i can do that, i do know the command MoveInCargo but not the foreach command.

Share this post


Link to post
Share on other sites

@Play3r,

Quote

"... i do know the command MoveInCargo but not the foreach command."

That's about where I'm at, too. We can work on it together here and another community member will probably take a look at it.

Share this post


Link to post
Share on other sites

This example makes it look pretty do-able.

{ _x setDammage 1; } forEach units group player;

Something like (pseudo code):

    {
        sleep 0.2;
        _x assignAsCargo helo1;
        _x MoveInCargo helo1;
    } forEach units group _spawnedgroup;

Researching...

getting closer, still not a real script
 

_spawnedgroup = createGroup [west, true];
    _wp1 = _spawnedgroup addWaypoint [(getPos HeloName), 0];
	_wp1 setWaypointSpeed "NORMAL";
	_wp1 setWaypointBehaviour "CARELESS";
	_wp1 setWaypointFormation "COLUMN";
	_wp1 setWaypointType "move";
waitUntil { (currentWaypoint (_wp1 select 0)) > (_wp1 select 1) };

    {
        sleep 0.2;
        _x assignAsCargo HeloName;
        _x MoveInCargo HeloName;
    } forEach units group _spawnedgroup;

 

Edited by wogz187
still researching...
  • Like 2

Share this post


Link to post
Share on other sites

Here is an example from my GF Missions :

Spoiler

waitUntil {sleep 1; GF_Missions_Hostage_11 distance2D GF_Missions_Heli_11 < 100 };

if (GF_Missions_Systemchat_info) then {
systemchat"GF_Missions_Hostage_11 distance2D GF_Missions_Heli_11 < 100";
};	

_Smoke_1 = "SmokeShellGreen" createVehicle (position GF_Missions_Hostage_11);
_Smoke_1 attachTo [GF_Missions_Hostage_11,[-0.02,-0.07,0.042],"rightHand"];

	
[GF_Missions_Hostage_11]  joinSilent _Group_Crew; 	
GF_Missions_Hostage_11 assignAsCargo GF_Missions_Heli_11;
[GF_Missions_Hostage_11] orderGetIn true;
[GF_Missions_Hostage_11] allowGetIn true;

if (GF_Missions_Systemchat_info) then {
systemchat"Wait Hostage to get in Heli";
};	

waitUntil {sleep 1;getPos GF_Missions_Heli_11 select 2 < 10};
_Smoke_2 = "SmokeShell" createVehicle (position GF_Missions_Heli_11);
		
waitUntil {sleep 1;{_x in GF_Missions_Heli_11} count [GF_Missions_Hostage_11] > 0};

detach _Smoke_1;


GF_Missions_Heli_11 engineOn true;
		
if (GF_Missions_Systemchat_info) then {
systemchat"addwaypoint";
};	
	
_randomPos_WP = GF_Missions_Heli_11 getPos [2500,random 360];

_WP = _Group_Crew addwaypoint [(_randomPos_WP),0];
_WP setWaypointSpeed "FULL";
_WP setWaypointBehaviour "CARELESS";
_WP setWaypointCombatMode "BLUE";

 

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

name the heli like , GF_Heli_1 :

_grp = [getMarkerPos "MARK1", INDEPENDENT, ["I_G_Soldier_A_F", "I_G_Soldier_F", "I_G_Soldier_AR_F"]] call BIS_fnc_spawnGroup;

{
	_x assignAsCargo GF_Heli_1;
	[_x] orderGetIn true;
	[_x] allowGetIn true;
}forEach units _grp;
  • Like 1
  • Thanks 3

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR

 

Thanks for the answer it did the trick

I made it work this way:

made a trigger when activated runs a SQF file with this text.

the Spawnheli is hidden with the HIDE/SHOW modules and it has a HoldWP, that a trigger skips and SHOW get activated also when the trigger that runs the SQF file is activated.  

Spoiler

_spawngroup = [getMarkerPos "MARK1", INDEPENDENT, ["I_G_Soldier_A_F", "I_G_Soldier_F", "I_G_Soldier_AR_F"]] call BIS_fnc_spawnGroup;


_wp1 = _spawngroup addWaypoint [getmarkerpos "wp1", 0];
    _wp1 setWaypointType "MOVE"; 
    _wp1 setWaypointSpeed "LIMITED";
    _wp1 setWaypointBehaviour "CARELESS";
    _wp1 setWaypointFormation "STAG COLUMN";
 

 _wp2 = _spawngroup addWaypoint [getmarkerpos "WP2", 0];
    _wp2 setWaypointType "MOVE"; 
    _wp2 setWaypointSpeed "LIMITED";
    _wp2 setWaypointBehaviour "CARELESS";
    _wp2 setWaypointFormation "STAG COLUMN";
    
    sleep 30;
    {
    _x assignAsCargo spawnheli;
    [_x] orderGetIn true;
    [_x] allowGetIn true;
}forEach units _spawngroup;

The spawned group goes into the heli so that part is great.

i want the heli to take off when the spawned group is inside the heli by trigger, but how do i give the _spawngroup a variable name so i can activate the trigger that lets the heli move from the loadWP ?  

 

Share this post


Link to post
Share on other sites

@Play3r,

Quote

Spawnheli is hidden with the HIDE/SHOW modules


Hide/Show is a less than ideal solution for animated units and AI because they still move, react, talk, shoot, ect. Disabling AI/simulation fixes a lot of that but vehicles still make engine noises and emit exhaust.

I think you need "fullcrew" but I'm not sure how to implement it in this case. Something like [fullcrew Spawnheli] select 0 > 0, but you'll need one of the resident experts to make that into something useful.

Or, in your load script, switch a variable. Right after the "forEach" set heliFULL=1;. Your trigger (skip waypoint) in the mission has condition "heliFULL==1".

  • Thanks 1

Share this post


Link to post
Share on other sites

@wogz187

 

The heliFULL = 1 is a good idea will try that.

The heli is far from players so they will not hear it.

Edited by Play3r
spelling

Share this post


Link to post
Share on other sites

@Play3r,

Quote

 

The heliFULL = 1 is a good idea will try that.

The heli is far from players so they will not hear is, so they will not hear it.

 

I hope it works. Just remember the script is "heliFULL=1;" and the condition is "heliFULL==1". Also, in your init, "heliFULL=0;".

Share this post


Link to post
Share on other sites
23 hours ago, GEORGE FLOROS GR said:

waitUntil {sleep 1;{_x in GF_Missions_Heli_11} count [GF_Missions_Hostage_11] > 0};

 

This is from the upper example , but it's way better to use @wogz's example.

Share this post


Link to post
Share on other sites

Wuhuu got it working.

by using  the HeliFULL variable. 

 

Edited by Play3r
  • Like 1

Share this post


Link to post
Share on other sites
Spoiler

_spawngroup = [getMarkerPos "MARK1", WEST, ["rhsusf_socom_marsoc_cso_cqb", "rhsusf_socom_marsoc_cso_breacher"]] call BIS_fnc_spawnGroup;


_spawngroup setVariable ["spawnunits", 123, true];

_wp1 = _spawngroup addWaypoint [getmarkerpos "wp1", 0];
    _wp1 setWaypointType "MOVE"; 
    _wp1 setWaypointSpeed "LIMITED";
    _wp1 setWaypointBehaviour "CARELESS";
    _wp1 setWaypointFormation "STAG COLUMN";
 

 _wp2 = _spawngroup addWaypoint [getmarkerpos "WP2", 0];
    _wp2 setWaypointType "MOVE"; 
    _wp2 setWaypointSpeed "LIMITED";
    _wp2 setWaypointBehaviour "CARELESS";
    _wp2 setWaypointFormation "STAG COLUMN";
    
    sleep 30; // just so they time to finish WP2
    {
    _x assignAsCargo spawnheli;
    [_x] orderGetIn true;
    [_x] allowGetIn true;
}forEach units _spawngroup;
    
    AllIn = 1;

6 minutes ago, wogz187 said:

So it's working?

yep it does.. 

Thanks for the help to @wogz187 , @GEORGE FLOROS GR and @gc8 

  • Like 2

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

×