Jump to content
Sign in to follow this  
tophe

Simple Vehicle Respawn Script

Recommended Posts

I'm working on a solution for it.

Thanks for letting me know about the problem.

The problem is that when a vehicle is setPos'd the script will not take the new position in account but the old one.

So when a vehicle is placed 15.9 ASL the script thinks that the vehicle has moved 15.9 meters and then been left empty.

So it will trigger the deserted timer.

I will work on it tonight and see what I can find on it!

Edited by Tophe

Share this post


Link to post
Share on other sites
Cool..

How do you mean as content of the editing guide?

And yep, it is my totally my work.

So you don´t know Mr-Murrays ArmA Editing Guide? It´s a Editing ressource which was written by him since the first days of OFP. The ArmA Editing Guide is the latest version of that ressource. Mr-Murray is currently about to figure out the content for the ArmA2 Editing Guide. Your script will definately be a part of it, cause it´s pretty useful.

Share this post


Link to post
Share on other sites

Great! Thank you.

There are a new version coming up soon with an option for limiting the amount of respawns.

Share this post


Link to post
Share on other sites

Think you could create a version that does the same thing for players?

Share this post


Link to post
Share on other sites
Think you could create a version that does the same thing for players?

Well... you can't actually drive a player so the deserted timer wouldn't do much and respawn is already hardcoded into the Arma 2 engine.

Or is there something else your after?

If you want to know about player respawn check this thread:

http://forums.bistudio.com/showthread.php?t=77526

Share this post


Link to post
Share on other sites

Updated the script to v1.3, see first post.

It now works on vehicles put on the deck of the LHD.

Share this post


Link to post
Share on other sites

Right now I haven't implemented any special function for it. Will try to look at it for next version.

But for now, you could always init it by a trigger or so. So that it executes every time the vehicle is respawn to the position.

I'll look into it soon.

Share this post


Link to post
Share on other sites

not sure if this is a bug when I used this script with the LittleBirds (Cyborgs Mod) helicopters they jumped 20m in the air for most of the time when they spawned and exploded when falling to ground...

I disabled the explosion effect which is true by default but this has also given no improvement on this so I meanwhile switched to the t-respawn.sqt script.

Share this post


Link to post
Share on other sites

There are problems with the setPos command, and since my script is made to work on th LHD as well I need to use the setPosASL function. This might render some problems with Arma's collision detection.

I'll try to look at it and get it tweaked a bit. Thx for the heads up.

Share this post


Link to post
Share on other sites

1. Give the vehicle a name, for example car1.

1. Put a trigger (F3) and make sure the circle covers the vehicle, and only that vehicle (an easy way might be to set it at 1x1 meters and then put it right on the vehicle.)

2. Set the trigger to activate on Anyone and Repeatedly

4. In the On Act. field on the trigger you put nul = [car1] execVM "yourscript.sqf"

Now, every time the vehicle spawns back the trigger will fire.

There are more elaborate ways to do this, but this should have you up and running.

Will try to get the function into the script in the future.

Share this post


Link to post
Share on other sites

Just updated the script to 1.4

Check first post.

Share this post


Link to post
Share on other sites

thanks Tophe,

Testing the script on some of our maps,

So far, so good.

Share this post


Link to post
Share on other sites

Thanks a lot man... Please keep me posted of any problems or requests you might have with it.

Share this post


Link to post
Share on other sites

New version up. See first post.

The script now supports setting the INIT of the respawned vehicle.

Vehicles will now also respawn with it's original name.

Share this post


Link to post
Share on other sites

Great script..

I'm running a server that I'm modifying the layout on the A10's.

The script works great, but when the vehicle respawns, it's loadout is default.

I've tried having the init before the call to your script, and inside the call to your script. ie:(straight from mission.sqf

INIT="veh = [this, 30, 120, 0, FALSE, FALSE, ""this removeweapon ""FFARLauncher_14""; this removeweapon ""BombLauncherA10""; this removeMagazine ""4Rnd_GBU12"";this removeweapon ""MaverickLauncher""; this removeMagazine ""5Rnd_Maverick_A10""; this addWeapon ""BombLauncher""; this addMagazine ""6Rnd_GBU12_AV8B""; this addweapon ""HellfireLauncher""; this addMagazine ""8Rnd_Hellfire""; this addWeapon ""FFARLauncher""; this addMagazine ""38Rnd_FFAR""] execVM ""vehicle.sqf"""

BTW, I tried this as well:

veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf"

The vehicle would respawn, but still be at full health.

What am I missing?

Thanks for your help.

Edited by Big_Daddy

Share this post


Link to post
Share on other sites

That was very strange.

I updated this post before Armaholic updated theirs, so maybe you got hold of version 1.4. Could you please check inside the script if it says v1.5?

Or perhaps contact me on PM so you can email me the mission and let me have a look at it.

Share this post


Link to post
Share on other sites

Yes, 1.5.. I even re-downloaded it thinking there was already a bug fix..

:)

---------- Post added at 12:02 PM ---------- Previous post was at 10:58 AM ----------

Ok.. I think I got it figured out.. seems it WAS all me.. :)

too many quotes and semicolons.. here's the init that works for me..

this removeweapon "MaverickLauncher"; this removeWeapon "5Rnd_Maverick_A10"; this addMagazine "6Rnd_GBU12_AV8B"; this addWeapon "BombLauncher"; this removeweapon "BombLauncherA10"; this removeMagazine "4Rnd_GBU12"; this addweapon "HellfireLauncher"; this addMagazine "8Rnd_Hellfire"; this removeweapon "FFARLauncher_14"; this addWeapon "FFARLauncher"; this addMagazine "38Rnd_FFAR"; veh = [this, 15, 10, 5, TRUE, FALSE, "this removeweapon ""MaverickLauncher""; this removeWeapon ""5Rnd_Maverick_A10""; this addMagazine ""6Rnd_GBU12_AV8B""; this addWeapon ""BombLauncher""; this removeweapon ""BombLauncherA10""; this removeMagazine ""4Rnd_GBU12""; this addweapon ""HellfireLauncher""; this addMagazine ""8Rnd_Hellfire""; this removeweapon ""FFARLauncher_14""; this addWeapon ""FFARLauncher""; this addMagazine ""38Rnd_FFAR""" ] execVM "vehicle.sqf"

You have to add the weapons and ammo in both places..

Also, you have to make sure to remove the final semicolon.

Share this post


Link to post
Share on other sites

Oh.. yeah. Adding init lines to the script will only affect the respawned vehicle. Not the original. You'll have to add that too...

I thought of putting it all in the script, but I decided it was a better idea to let the user choose if the vehicle should respawn in another state then it was from the beginning.

Thanks for getting back on that.

Share this post


Link to post
Share on other sites

I'm having problems with the respawn delay. The vehicle respawns after 5 seconds whatever delay time i set.

veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"

This is correct, right? I first thought there was a problem with the added respawn effect.

( yes, i have 1.5, dled it a couple of minutes ago from armaholic )

Share this post


Link to post
Share on other sites
I'm having problems with the respawn delay. The vehicle respawns after 5 seconds whatever delay time i set.

veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"

This is correct, right? I first thought there was a problem with the added respawn effect.

( yes, i have 1.5, dled it a couple of minutes ago from armaholic )

I sent you a PM with my email. Could you send me your mission so I might take a look at it?

Share this post


Link to post
Share on other sites

Nope.. got it.

Share this post


Link to post
Share on other sites

I am still having the same issue, it will load out the vehicle on map load but the trigger doesnt work afterwards.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×