Jump to content
Sign in to follow this  
steelblood

Mobile HQ's or a moving Respawn

Recommended Posts

Hi Everyone

I have trawled the internet and forums for an easy answer to a mobile respawn or a moving respawn. There has been many options none of which have worked :( So i have made this thread in order for everyone to put anything they have on mobile respawns on here in order to help. In my case i made a moving respawn (Not a mobile one as techincally that would have the option to spawn at base too ? ) However after the MR has been destroyed the mission always gives a unit a new name so in the coding if the vehicle is named "Mhq" after it has been destroyed the coding no longer applies due to it's name being changed. So how do i stop this from happening as this would prove helpful for other situations aswell such as granting airstrikes to a named unit.

Thank's Alot

Dan :D

Share this post


Link to post
Share on other sites

Gimme the init line of your mobile respawn and I will do it for you. + Your mobile respawn script it self.

Share this post


Link to post
Share on other sites

At the moment it's not a mobile one it's just moving ( i'm not trying to sound like a douche there i'm just trying to avoid confusion :D) here it is

if(!isServer) exitWith {};

while {alive mhq} do {

"respawn_west" setMarkerPos getPos mhq;

};

deleteMarker "respawn_west";

Obviously there is an existing marker "respawn_west" however i would really like it if there was the option to spawn at the mobile respawn or base ? Is that possible without getting to complicated ? But anyway that is the code i'm currently using thank you so much for any help Joshii.

Thanks again

Dan

Btw thats in the init.sqf not the actual initlization line of the unit (It's an empty unit also btw)

If that helps

Edited by steelblood
Forgot something

Share this post


Link to post
Share on other sites

Norrins Revive 042 does this perfectly.

PDF with it gives details of it.

Share this post


Link to post
Share on other sites

Yeah i've had a looksy at that stuff and i don't mind using others peoples scripts (At all) it's just i'd quite like to figure out how to do this easily so i can just use the same method over and over again on the different missions i make.

Dan

Share this post


Link to post
Share on other sites

2 Files

1 Init

Car Init:

[this] execVM "mobilerespawn.sqf";

marker.sqf

if(!isServer) exitWith {};

_v = _this select 0

while {alive _v} do {

"respawn_west" setMarkerPos (getPos _v);

};

mobilerespawn.sqf

if (!isServer) exitWith {};

sleep 1+(random 3);

_v = _this select 0;

_pos = getpos _v;

_dir = getDir _v;

_type = typeof _v;

waitUntil {not alive _v};

deleteVehicle _v;

_v =_type createVehicle _pos;

_v setdir _dir;

_v setpos _pos;

[_v] execVM "marker.sqf";

sleep 1;

Wrote this out of my mind I hope you get me if not ask!

Edited by Joshii

Share this post


Link to post
Share on other sites

Ok thanks so much :D I have not tested it yet and i won't be able to until Friday however the marker.sqf ? Do i initiliaze that in the init.sqf or does that code just go straight into the init.sqf or am i totally on the wrong tracks :D ?

Ignore that i just properly looked at the coding and it's executed during the mobile respawn.sqf thanks again

Dan :)

Also i'm guessing V stands for the vehicle or ?

Edited by steelblood

Share this post


Link to post
Share on other sites

_v = _this select 0;

_this select 0 selects the first argument send in the exec command thus

[this] execVM "mobilerespawn.sqf"; this in the car init = the vehicle yes.

Share this post


Link to post
Share on other sites

Ok this means nothing to me but :P I'm a noob to actual scripting i know how to use them etc but not how to write them

Share this post


Link to post
Share on other sites
Is it working?

Unfortuanetly you will have to wait until Friday for your answer :( I know, i know the shame in not having Arma 2 installed here but when i go to my other home i will let you know :)

Share this post


Link to post
Share on other sites

No it does not work it says Type Script expected nothing

Edit: I've got it to work however you do not spawn on the mobile hq :P Is there something i'm missing ? I've put everything where it needs to be and named the vehicle mhq and changed all the v's to mhq ? (I was trying this it didn't work as _v so) And do i need a marker pre-placed or ? I spawned on the normal marker when it was pre-placed however when it isn't there i just respawn exactly where i die ?

Thanks

Dan

Edited by steelblood

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  

×