Jump to content
Sign in to follow this  
drunkenjawa

Setting marker hieght for respawn?

Recommended Posts

Hey guys

I'm making my first Multiplayer mission and have everything all sorted - apart from the actual respawns.

I've been trying to use the in-editor respawn modules, they kinda work, work ok for vehicles at least. I know about placing markers etc, the thing is that there doesn't seem to be any way that I know of to actually raise the markers hieght ATL - I want people to respawn on the carrier deck of the Nimitz at hieght 18 or so, but I keep getting thrown underneath it into the water instead. Usually I'd just sync the marker to the flightdeck module, however you can't sync markers to modules, at least in the editor.

Is there a script that I could use perhaps, that would raise the markers hieght?

I've tried getMarkerPos and then setPosATL but it doesn't seem to want to move it. The BIS wiki says that it only accepts 2D positioning but surely that's not still the case?

Share this post


Link to post
Share on other sites

Well bis_fnc_addRespawnPosition can take a position, object or a marker.

My suggestion is to get the current marker's pos, and set your own height and then add that position to the respawn system

_pos = markerPos "spawn1";
_pos set [2, 18];
[west, _pos] call BIS_fnc_addRespawnPosition;

Or you've tested this? You'd want to use setPosASL (sea level) not ATL (terrain level)

Edited by cuel

Share this post


Link to post
Share on other sites

Great, thanks for that - progress! I started using what you posted and he's now spawning in the middle of the water, underneath it, so this is at least a good sign that change is happening!

I'm not entirely sure what's happening the the 'set' command you're using, set [2(what is 2? select 2 from the markerPos?), 18 (height, I'm guessing that this is telling it to set select 2 as 18 instead?)

EDIT: I had some other markers on the map that seemed to be interfering, deleted those, and your suggestion works perfectly! Thank you so much!

---------- Post added at 09:00 ---------- Previous post was at 08:26 ----------

Yeah, not sure what's happening but it's no longer working - keep just spawning in underwater. I'm putting the code that you posted, in init.sqf, was that correct? Everything was fine adding one marker, adding more seems to have just broken everything, lol.

---------- Post added at 09:41 ---------- Previous post was at 09:00 ----------

Perhaps this might have something to do with the map, maybe - I'm playing on Chernarus.

_pos set [2, 18]; - spawns underwater

_pos set [2, 19]; - spawns underwater

_pos set [2, 20]; - spawns underwater

_pos set [2, 21]; - spawns in parachute around 3-5m above deck...

I give up for now lol.

Edited by drunkenjawa

Share this post


Link to post
Share on other sites

Stop using the in-game module. Never liked that thing anyway...

I'm assuming that you want players to spawn/respawn in a specific spot on the deck of the Nimitz correct?

If so, just add (modify) this to your respawn script. I plug it into BTC Revive, replacing the default marker that it uses. You can also expand upon this with some if then commands and alternate spawn markers to spawn different classes in different places (I do this to separate the ground pounders from the pilots on respawn).

_pos = getMarkerPos "markername"; // The name of your invisible respawn marker

player setpos [(_pos select 0) + ((random 5) - (random 5)), (_pos select 1) + ((random 5) - (random 5)), 0]; 

Where select 0 and 1 are the X and Y coordinates of the marker and the final 0 is the Z coordinate or altitude. Sometimes with markers the 0 value will put you exactly on top of the object, sometimes it wont as is my experience with the Nimitz. The random's are just there so you don't have people respawning on top of one another, change the values as you see fit.

Edited by Kahna

Share this post


Link to post
Share on other sites

Nice, thanks - you're correct, that's exactly what I was wanting to do. I'll just get rid of the respawn modules, and put this in OnPlayerRespawn.sqf and see if that helps. I read somewhere that Arma 3 automatically runs that if it's there without additional setup, since this is the first MP mission I've made from scratch I don't have any respawn scripts or anything like that. Mistakenly thought the respawn module would make things easier!

Share this post


Link to post
Share on other sites

By default, you've got nothing for respawns (when not using modules). Also, by default, the standard Arma 3 respawn is to have a marker somewhere that is named "respawn_west", "respawn_east", etc for BLUFOR, OPFOR, etc which is automatically recognized by the game that you want players to respawn there at ground level. If you want to get trickier than that, that's when you start using other markers, setPos, getPos/getMarkerPos and use if-thens for different classes in whatever script you're using the handle respawns.

Another fun thing to do is the good old checkpoint system where you use triggers to move the respawn point around the map with you Halo style (ie setMarkerPos of your respawn marker to the location of another marker via trigger ON ACT). Good times.

Share this post


Link to post
Share on other sites

Yeah, ground level spawns, no worries hehe, I can have multiple of those it seems without any issues at all. It's just getting it to that specific height, reliably lol. I might try on Altis to see how that goes, instead of chernarus. Or might try moving the Nimitz to another spot on the map.

Share this post


Link to post
Share on other sites
Here you go! It's a bit crude, I'm sure someone could script it better, but this demo will get you started on the right track.

https://www.dropbox.com/sh/t4rrsju5yv70iq8/AAAc9RzaibtnbI44IdtCzIDJa

Oh, you're totally awesome Kahna hehe thank you! I'm at work at the moment so can't try this out just yet, but will go through the code to see if I can pick out what I was specifically doing incorrectly. I love how encouraging the community is to help actually LEARN stuff, when there is most likely an easy to resolve issue that noobs like me are struggling with :)

Thanks again :)

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  

×