Jump to content
Sign in to follow this  
demonized

Single Player - respawn [script]

Recommended Posts

maybe, one sec ill create a A2 demo mission, maybe it only works for oa atm, will look into it if demo doesnt work for you..

1 sec

---------- Post added at 01:30 AM ---------- Previous post was at 01:25 AM ----------

A2 demo on utes: same as before, you on marker, opfor on position, he is on the road just west of you around the corner.

Share this post


Link to post
Share on other sites

Thanks, I tried it, but the respawn still doesn't work. :(

Share this post


Link to post
Share on other sites

ok, then not for Arma 2 only atm, will look into this, i think i know the reason, its the getvariable parts...

wont happen tonight though.

there are some other SP respawn scripts about, unknown if they support A2 only, but use search and you might find one.

Share this post


Link to post
Share on other sites

Hi demonized,

I wonder if you can help, this script is great but I have a scenario that this would work for but not quite at the moment ...

I realise I can have team im in respawn, but what im after is if I die as the leader, the entire team get removed and respawn as if they die with me.

Im playing an open mission and start with a 4 man team, but if im far away from base/spawn and get killed I spawn back to base but then im left with team AI miles away asking me for location and I want to stick with 4 men each spawn.

So ... is there another addition that could be created for this so "if you as leader die all existing team die and spawn again with you" ?

Share this post


Link to post
Share on other sites
*snip*

yes, that i can include in next release, for now, use this as a temp workaround:

locate at the bottom of the script:

if (_lead) then {
	_grp selectLeader _unit;
	if (!_player) then {
		_pos = getPos _unit;
		_unit doMove [(_pos select 0) + 1,(_pos select 1) + 1,0];
	};
};

change it to this:

	if (_lead) then {
	_grp selectLeader _unit;

	// temp workaround for group teleport on player leader position on player respawn when leader.
	if (_player) then {
		_pos = getPos player;
		{
			if (_x != player AND alive _x) then {
				_x SetPos [(_pos select 0)-10*sin(round(random 359)),(_pos select 1)-10*cos(round(random 359))];
				_x doFollow player;
			};
		} foreach units _grp;
	};
	// end workaround.

	if (!_player) then {
		_pos = getPos _unit;
		_unit doMove [(_pos select 0) + 1,(_pos select 1) + 1,0];
	};
};

Share this post


Link to post
Share on other sites

Hi Demonized,

I have a question and was wondering if it is possible to add a feature to the script where when you get killed that

instead of just respawning at the chosen marker, you could setup several markers and then have a small dialog,

or list pop up where you can choose where you wish to spawn.

Is that possible to do in SP?

Share this post


Link to post
Share on other sites
Hi Demonized,

I have a question and was wondering if it is possible to add a feature to the script where when you get killed that

instead of just respawning at the chosen marker, you could setup several markers and then have a small dialog,

or list pop up where you can choose where you wish to spawn.

Is that possible to do in SP?

Yes, using dialogs, though ive not tried fiddling with those yet.

I think one of the domination versions has it already, small map opens and you can click on various pre placed positions, like MHQ or base to respawn at.

Should be very doable in SP, ill look into it, maybe i can rip of some of Xenos great work. :p

Share this post


Link to post
Share on other sites

Nice script!Thanks!

Can you add a dead body respawn? like: respawn= "INSTANT"; to respawn on the last position where you died?

Thank you.

Share this post


Link to post
Share on other sites

cant same to get this to work iv did all you said but nothing im not get any errors or anything must be something im doing wrong , i made the SPR_respawn.sqf put all the stuff in it and made the maker plus i add to the players init line like you said ? any idea

Share this post


Link to post
Share on other sites
cant same to get this to work iv did all you said but nothing im not get any errors or anything must be something im doing wrong , i made the SPR_respawn.sqf put all the stuff in it and made the maker plus i add to the players init line like you said ? any idea

maybe it's all the tabs from copy & paste of his #code] box

in your syntax editor look for: convert tabs to spaces

I'm not certain how the engine deals with too many tabs when people form code like scripting Arma in XML format

example: ">>" =invisible tabs

<code>

>> >> <example>

>> >> >> <3tabs>3</3tabs>

>> >> </example>

</code>

<edit> @ corro disregard what I wrote above, it works just fine for me.

@ Demonized I have been looking for a good SP respawn script & this is a great script, thanks.

Edited by MadM0nkey

Share this post


Link to post
Share on other sites

I just had to reply to this thread and bump it because i've been looking for a good SP respawn script for Arma 3 and this works awesome!! Thank you!

  • Like 1

Share this post


Link to post
Share on other sites

I have been looking for a script like this one. I am stuck getting this error.

It is pointing to this section

if ((count _init) != 0) then {

_unit setVehicleInit (_init select 0);

processInitCommands;

};

Here's the rpt

File C:\Users\StTosin\Documents\Arma 3 - Other Profiles\StTosin\missions\testing%20loadout.Stratis\SP_respawn.sqf, line 479

Error in expression <

if ((count _init) != 0) then {

_unit setVehicleInit (_init select 0);

process>

Error position:

Error Missing ;

Line 479 is "_unit setVehicleInit (_init select 0);"

If I comment it out the script works but respawns me in the ocean. Any help is appreciated.

Using Stable build Arma 3.

I commented it out and used it on Dariyah map and it worked somewhat. Dariyah does not have any water body....all desert.

Tried it with only cba_a3 with same problem.

Edited by sttosin

Share this post


Link to post
Share on other sites

how do i get this to work in arma 3 SP? i put the SP_respawn in my mission folder. _null = ["SPR_start",this] execVM "SP_respawn.sqf"; into the player int field and nothing happens no error no nothing

Share this post


Link to post
Share on other sites

Still looking for help on this also. See previous post.

Share this post


Link to post
Share on other sites

The script would have to be re-written with setVehicleInit replaced by the new BIS MP function

Share this post


Link to post
Share on other sites

Hopefully Demonized will give us an update along with his patrol markers script, I feel he's around somewhere.. There's a disturbance in the force lol.

Share this post


Link to post
Share on other sites

When i respawn im screen is just blood red, i tried with the kill cam removed and i get the samething :( how can i fix this, what could i possibly missed?

Share this post


Link to post
Share on other sites
I just had to reply to this thread and bump it because i've been looking for a good SP respawn script for Arma 3 and this works awesome!! Thank you!

When i do what he says in ARMA 3, I am getting "Script SP_respawn.sqf not found" error on the mission loading screen. Any ideas?

Share this post


Link to post
Share on other sites
"Script SP_respawn.sqf not found"

Means you didn't put the script in the mission folder, its being called ingame but the physical script isn't in the folder.

So locate your mission folder for arma3 should be here C:\Users\username\Documents\Arma 3\missions\mission folder (your mission whatever you named it)

and move the SP_respawn.sqf script to the folder.

Share this post


Link to post
Share on other sites

I just had to reply to this thread and bump it because i've been looking for a good SP respawn script for Arma 3 and this works awesome!! Thank you!

Would you please share how you tackled the setvehicleinit line and got it working? Thanks

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  

×