Jump to content
Sign in to follow this  
AdirB

What happens if spawn in chopper and the copper deletes after that?

Recommended Posts

Hello, I created a mission and in the spawn, all the units are spawning in helicopters, they land, everyone gets out, the helicopters flies away and being deleted.

The problem is if someone disconnects from the server and then rejoins the mission he will spawn singing "I believe I can fly", fall and die.

So I wonder if there's a way to make the units change the spawn position after the helicopters deleted so they won't fall and die after rejoining the mission.

 

I'd appericate your help.

Cheers :)

Share this post


Link to post
Share on other sites

When the helicopter is deleted setup a new starting position somewhere else, either a respawn point or group leader location or something similar.

Share this post


Link to post
Share on other sites

When the helicopter is deleted setup a new starting position somewhere else, either a respawn point or group leader location or something similar.

Thanks for your reply.

 

How do I set a new starting position?

Share this post


Link to post
Share on other sites

How does your mission work?  Where does the helo drop them off?  If you're using an invisible helipad for that maybe tack this onto the end of initPlayerLocal.sqf:

if (isNull heloName) then {
	player setPos getPos invisibleHelipadObjectUsedForLZ;
};

So when they join the game if the helo doesn't exist anymore it'll move them to the landing zone invisible helipad instead.

Share this post


Link to post
Share on other sites

How does your mission work?  Where does the helo drop them off?  If you're using an invisible helipad for that maybe tack this onto the end of initPlayerLocal.sqf:

if (isNull heloName) then {
	player setPos getPos invisibleHelipadObjectUsedForLZ;
};

So when they join the game if the helo doesn't exist anymore it'll move them to the landing zone invisible helipad instead.

Can it work with markers? Like that:

 

UPDATE: more than one objects

if (isNull chinook1) || (isNull chinook2) then {
	player setpos (getMarkerPos "markerName"); 
};

Share this post


Link to post
Share on other sites

Absolutely, though || means OR so if you want to spawn at the marker if EITHER helo is gone, then your code is great.  If you want to detect if BOTH are down use && instead of ||.  You also need a few more ( )

// If either helo is down...
if ((isNull chinook1) || (isNull chinook2)) then {
	player setpos (getMarkerPos "markerName"); 
};

// If both helo is down...
if ((isNull chinook1) && (isNull chinook2)) then {
	player setpos (getMarkerPos "markerName"); 
};

Share this post


Link to post
Share on other sites

 

Absolutely, though || means OR so if you want to spawn at the marker if EITHER helo is gone, then your code is great.  If you want to detect if BOTH are down use && instead of ||.  You also need a few more ( )

// If either helo is down...
if ((isNull chinook1) || (isNull chinook2)) then {
	player setpos (getMarkerPos "markerName"); 
};

// If both helo is down...
if ((isNull chinook1) && (isNull chinook2)) then {
	player setpos (getMarkerPos "markerName"); 
};

I doesn't work unfortunately :/

He keeps falling into the water.

 

I created an empty marker, called it spawnNATO and then pasted the lines you gave me at the end of initPlayerLocal.sqf.

Gave variable names to both helicopters "chinook1" and "chinook2".

changed  "markername" to "spawnNATO" in the code.

after that I in spawn the mission (multiplayer PC hosting), I got untransported from the helicopter, they got deleted and then my friend joined the server and he fell in to the water.

Share this post


Link to post
Share on other sites

Reverse it.  In the editor start your players on the LZ and move them into the helos if they exist.  Or just keep things simple and start at the LZ and don't try to move, just have the helo fly off at game start as if they'd just dropped them off.

Share this post


Link to post
Share on other sites

Reverse it.  In the editor start your players on the LZ and move them into the helos if they exist.  Or just keep things simple and start at the LZ and don't try to move, just have the helo fly off at game start as if they'd just dropped them off.

Hey, sorry for the delay. I'm pretty sure I messed up with the code:

if((isNil "chinook1") && (isNil "chinook2")) then {
grp1 moveInCargo chinook1;
grp2 moveInCargo chinook2;
}else{
player setPos (getMarkerPos "respawn_west");
};

Share this post


Link to post
Share on other sites

The easiest solution is to start everyone on the marker and the helicopters flying away as if they just dropped them off.  Long slow AI helo inserts just slow things down at game start and as you're finding out, are a pain in the ass to get working properly.  Even more so if it's multiple groups and you want to support JIP.

 

Or else your code was close.  Just start everyone at the marker, after a slight delay check if the helos exist and if they do move the units in.

if (!isNull infilHelo) then {player moveInCargo infilHelo};

Share this post


Link to post
Share on other sites

 

The easiest solution is to start everyone on the marker and the helicopters flying away as if they just dropped them off.  Long slow AI helo inserts just slow things down at game start and as you're finding out, are a pain in the ass to get working properly.  Even more so if it's multiple groups and you want to support JIP.

 

Or else your code was close.  Just start everyone at the marker, after a slight delay check if the helos exist and if they do move the units in.

if (!isNull infilHelo) then {player moveInCargo infilHelo};

How to do it with more helicopters and groups?

like I want group1 and group2 to go in chopper1 and group 3 to go in chopper2

 

I can guess how to do the check on both choppers but can't figure out the rest.

Maybe like this? I will name all the groups like this:

CP = group this;
squad1 = group this;
squad2 = group this;
squad3 = group this;

and then do this in initPlayerLocal.sqf:

if ((!isNull chinook1) && (!isNull chinook2))then{

{_x moveInCargo chinook1} forEach units group CP;
{_x moveInCargo chinook1} forEach units group squad1;
{_x moveInCargo chinook2} forEach units group squad2;
{_x moveInCargo chinook2} forEach units group squad3;}

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  

×