Jump to content
Sign in to follow this  
mattxr

Vehicle Respawn Template

Recommended Posts

I am using Karillions script for Vehicle Respawn, the vrs.sqf one. And I can get the respawn to work only if there are AI's in the vehicle...I dont want them in the vehicle. Any thoughts on how i can fix this?

Share this post


Link to post
Share on other sites
I'm using this script, and it's awesome for everything but that bug above...

Not sure who wrote it, but it's called vehirespawn.sql

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

; Call in initline with (120 for 120 seconds, 2 minutes) :

;

; [this, 120] exec "vehirespawn.sqs"

;

; Note - This script needs a "GameLogic" trigger named "SERVER" or else spawning will be nuts

;

?! (local server): exit

~3

_vehicle = _this select 0

_delay = _this select 1

_empty = true

_disabled = false

_moved = false

_startpos = getpos _vehicle

_startdir = getdir _vehicle

_type = typeof _vehicle

#waiting

~2

_newpos = getpos _vehicle

?! (_newpos select 0 in _startpos) or not (_newpos select 1 in _startpos): _moved = true

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not (isnull commander _vehicle): _empty = false

? (isnull driver _vehicle) and (isnull gunner _vehicle) and (isnull commander _vehicle): _empty = true

?! (canmove _vehicle) or (canfire _vehicle): _disabled = true

? (canmove _vehicle) and (canfire _vehicle): _disabled = false

? (_disabled) and (_empty): goto "spawn"

? (_moved) and (_empty): goto "spawn"

goto "waiting"

#spawn

~_delay

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not(isnull commander _vehicle): _empty = false

?! (_empty): goto "waiting"

deletevehicle _vehicle

~0.5

_newveh = _type createvehicle _startpos

_newveh setpos _startpos

_newveh setdir _startdir

[_newveh, _delay] exec "vehirespawn.sqs"

exit

Can anyone help me with this script, I don't want empty vehicles to respawn, I only want them to respawn when destroyed or anything other than empty. I know about Norrin's recent respawn where they don't respawn empty vehicles, but all my vehicles don't have names and those that do, I need to know that they will keep their names as given in the editor due to other scripts that refer to that vehicles name.

Share this post


Link to post
Share on other sites

@[WWS]WarWolf...

you could just alter norrins scripts where...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vcl setVehicleVarName _name_vcl;

would become...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vcl setVehicleVarName _name_vcl;

call compile format["%1 = _vcl;", (vehicleVarName _vcl)];

Why you ask?

'cause it's not enough to just set the 'vehicle name' on new versions of any vehicle you create, you've got to equate the 'vehicle name' to the 'object' as well. (that is if you want respawned vehicles to be 'testable' on all machines and not just the server)

Share this post


Link to post
Share on other sites
Quote[/b] ]

Can anyone help me with this script, I don't want empty vehicles to respawn, I only want them to respawn when destroyed or anything other than empty. I know about Norrin's recent respawn where they don't respawn empty vehicles, but all my vehicles don't have names and those that do, I need to know that they will keep their names as given in the editor due to other scripts that refer to that vehicles name.

Can anyone help. I only want them to respawn when destroyed. Not respawn when empty or damaged.

--UPDATE--

Got it to work.

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  

×