Jump to content
Sign in to follow this  
Durka-Durka

Respawning on LHD

Recommended Posts

Hi all, I'm having a problem trying to respawn in my MP map. Can someone please check my code and tell me if I have everything right?

My init.sqf looks like this:

[] execVM "briefing.sqf";

[] execVM "description.ext";

My description file looks like this:

respawn=3;

respawndelay=5;

respawnvehicle=3;

respawnvehicledelay=15;

disabledAi=1;

AiKills=1;

Now, I had a marker set up as respawn_west, and it worked, except everyone respawns under the carrier. I've tried to place a game logic object there with this code in the init box...

this setPosASL [getposASL this select 0, getposASL this select 1, 16];
and I've named it respawn_west in both the "name" box and the "description" box.

...but everytime I respawn, it places me in the exact position that I died.

Is there a better way to respawn on an object, or should I use a marker? And if I use the marker, how do I get it elevated enough to spawn on the deck of the LHD? I've tried looking for answers and can't find much. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Any ideas folks? I'm just trying to get them to respawn at a certian height on the LHD. I've tried to find the answer, unsuccessfully...

Share this post


Link to post
Share on other sites

1st start with remove

[] execVM "description.ext";

from init.sqf

then in init.sqf add something like this

player addEventHandler ["killed", {_this execVM "scripts\respawn_player.sqf";}];

next is to make respawn_player.sqf

waitUntil {!isNil {player}};
waitUntil {player == player};
_pos = getMarkerPos "respawn_west";
player setPosAsl [_pos select 0, _pos select 1, 15.9];

;

i have not tested this tho.. but it should work in theory

Share this post


Link to post
Share on other sites

Thanks for the help. That looks reasonable, but I still can't get it to work. I've tried.... it about as many ways as I can think, and still no luck.

It looks like the script works, but it just doesn't get me to the altitude I need. Any other ideas? Thanks for any suggestions.

Share this post


Link to post
Share on other sites

Is this map Utes and the LHD in question the default one? If so, 15.6 - 16 is perfect for most of the deck area. If you're using ArmATech's LHD spawner on Chernarus or you've manually placed it you'll need to play around with the heights though I think.

Share this post


Link to post
Share on other sites

Add this to the init.sqf :-

"respawn_west" setMarkerPosLocal [markerPos "respawn_West" select 0, markerPos "respawn_West" select 1, 15.9];

Use the respawn_west marker as default, that should do it.

Share this post


Link to post
Share on other sites

Shadow.D. ^BOB^

setMarkerPosLocal works on 3d format ?

i thought setMarkerPosLocal & setMarkerPos was in 2d format.

Share this post


Link to post
Share on other sites

WOW, thank you Bob and others who helped me out. I sat up for days trying to get this through my head. And, for clarity's sake, I'll post everything I found out below.

Step 1: In your init.sqf file, put these two lines of code

"respawn_west" setMarkerPosLocal [markerPos "respawn_West" select 0, markerPos "respawn_West" select

1, 15.9];

player addEventHandler ["killed", {_this execVM "scripts\respawn_player.sqf";}];

Step 2: Make a file called description.ext and place it in your missions folder with at least this...

respawn=3;

respawndelay=5;

respawnvehicle=3;

respawnvehicledelay=5;

disabledAi=1;

AiKills=1;

respawnDialog=true;

Step 3: Make a file called respawn_player.sqf and place it in your mission/scripts folder. Place this inside...

waitUntil {!isNil {player}};

waitUntil {player == player};

_pos = getMarkerPos "respawn_west";

player setPosAsl [_pos this select 2, _pos this select 3, 15.9];

Step 4: In your editor, make a marker and name it respawn_west. Then you should be good to go.

Share this post


Link to post
Share on other sites

You don't need to setPos the player after respawn.

Just set the respawn marker in the correct height and the player will respawn there.

Am using it in co50 The Longest Day for some time now, it's working fine.

Xeno

Share this post


Link to post
Share on other sites

if setMarkerPos & setMarkerPosLocal is working with 3d format [x,y,z] in arma2 the wiki/biki needs to be updated :p

Share this post


Link to post
Share on other sites

Great ;)

seams like Dr Eyeball

added some info there while i was asleep

02:03, 7 August 2009 (CEST)

Share this post


Link to post
Share on other sites

maybe this has been fixed in a patch? I just tried it and I always respawn on the deck of the ship. respawn_west marker size is critical though.

Now if I could just figure out how to get OBJECTS to start on the flight deck instead of underneath Men seem to start at the lowest accessible level, which is the flight deck but any editor placed object starts in the water.

Share this post


Link to post
Share on other sites

add this to init line:

this setPosASL [getposASL this select 0, getposASL this select 1, 15.9];

Share this post


Link to post
Share on other sites
if setMarkerPos & setMarkerPosLocal is working with 3d format [x,y,z] in arma2 the wiki/biki needs to be updated :p

You can use modelToWorld to put a marker into 3D format.

Example Respawn onto LHD script:

while {true} do {
waitUntil {!alive player};
_p = player;

};



_Offset = [5, 20.5, 16.20];
_respawnPos = LHD_Center modelToWorld _Offset;
_p setPosASL _respawnPos;

};

if (true) exitWith {};

;)

Share this post


Link to post
Share on other sites

have a look at the longest day or GITS evolution - both use the LHD with spawnpoints and vehicles, ammo boxes and AA guns etc on the LHD.

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  

×