Jump to content
Sign in to follow this  
tophe

Simple Vehicle Respawn Script

Recommended Posts

Thanks for your reply. Ive run into another problem though. Ive added 2 a10's and 4 f16's to domination map. The a10's respawn correctly when destroyed on the airfield insitu however the f16's leave a burning wreck on the airfield when destroyed and then respawn on top of the wreck. Can you help?

Could you upload the mission somewhere and PM it to me?

I could have a look at it.

Share this post


Link to post
Share on other sites

Did you find a resolution to this problem? I'm having the same issue. Script on the F16 is this:

veh = [this, 15, 1000, 0, TRUE, FALSE, FALSE] execVM "vehicle.sqf";

Thank you.

Share this post


Link to post
Share on other sites

Hello, I want to put this script in the init of a vehicle I create after the fact. As in, not in the editor. So I made a createvehicle trigger that works. I put the respawn script syntax right there in the same trigger as the createvehicle.

a10 = ["a10", 15, 10, 5, FALSE] execVM "vehicle.sqf"

I defined the vehicles name in the respawn script and the spawn script. The vehicle spawns just fine however once destroyed it does not REspawn. I tried the respawn script on a static (placed in editor) vehicle and it worked fne. Appreciate any help on this

Share this post


Link to post
Share on other sites

Hi Trophe,

First, I must say, Nice Work.

I know A LOT goes into doing this sort of thing.

Now, my problem...

I am a NoOb, no doubt. I have been a COD, Crysis, Company of Heroes, etc... player for years now, so I am new to anything of this nature.

I recently purchased a dedicated server for my clan in an attempt to give us something new to play. Ofcourse, the vanilla maps that they have there are OK but aren't the bells and whistles that we like.

I've since started looking into making us a map or 2 just for something different and I just can't seem to get the vehicles to respawn. I have read through everything here and followed the instructions to the best of my knowledge but alas, no prize.

I am sure you are busy, but I was wondering if you, or any of you other intelligent creatures could dumb down the step by step instructions to accomplish this please.

I have made the map, put in vehicles, in the init description box I put the veh = [this...etc...].

After making the map and doing all of the necessary things there I go to where the map was created and then I create a description file with ArmA edit to initialize respawn and other variables then save it to that Mission folder. Then I copy and paste your vehicle.sqf file into the Mission folder.

So far in the folder I have...

1)Description.ext

2)Mission.sqm

3)Vehicle.sqf

After seeing that I have these in there I go "back" 1 folder then right click and create PBO so that I can use this as a multi-player mission.

I start the map, everything loads up fine, I run and jump into the chopper I created, lift off, then commence to crashing it to test to see if it respawns.

No dice.

I'm lost and frustrated because I know I'm not seeing the forest for the trees.

Please steer me in the right direction.

Again, I'm a NoOb...be gentle...:D

Share this post


Link to post
Share on other sites

You seem to be doing it right. Post your mission PBO.

Share this post


Link to post
Share on other sites
You seem to be doing it right. Post your mission PBO.

Thanks for the reply T...

How should I post the pbo?

Share this post


Link to post
Share on other sites

upload it anywhere, like filefront.com

Share this post


Link to post
Share on other sites

Hate to tell you this, but your mission works as advertised. I started the chopper, ejected, and let it crash. 10 seconds later, it was back where it started.

Are you previewing in the single player editor? Scripts won't work there.

Share this post


Link to post
Share on other sites
Hate to tell you this, but your mission works as advertised. I started the chopper, ejected, and let it crash. 10 seconds later, it was back where it started.

Are you previewing in the single player editor? Scripts won't work there.

Get out T...LOL

No, I'm not previewing, I actually hosted a LAN server to test it.

What the heck...:butbut:

---------- Post added at 12:48 AM ---------- Previous post was at 12:23 AM ----------

OK, it worked.

My problem now...

It only worked when I played as the Cobra's Pilot. When I play as the other pilot and then just take the Cobra and crash it, no respawn.

SO...I'm thinking it has something to do with how I classify it in the editor.

Player

Non-Playable

Playable As...

Any thoughts?

Edited by HaZeL

Share this post


Link to post
Share on other sites

Heh, I tried all three slots and it worked. Can't think of a reason.

Share this post


Link to post
Share on other sites

Does this script also work for arma1 or can I modify it so it does work for arma1 somehow?

Share this post


Link to post
Share on other sites
Did you find a resolution to this problem? I'm having the same issue. Script on the F16 is this:

veh = [this, 15, 1000, 0, TRUE, FALSE, FALSE] execVM "vehicle.sqf";

Thank you.

So, has anyone been able to get the vehicle script to work successfully on mod planes like the F16 within a dedicated server with a map like Domination?

Share this post


Link to post
Share on other sites

I have a question :confused: (sorry for bad english)

I use this script in Domi map!) put in base 1 new A-10 and veh = [this] execVM "vehicle.sqf"! I go flay-landing! Live A-10 and after 1 min! look A10 Respawn in hangare point where i put first time! It probably to change? A-10 not mov!) and jast respawn after plane destroyed! Thx.

Share this post


Link to post
Share on other sites

Does this script only respawn empty vehicles? Or is there a way to make them respawn with the crew? Thanks in advance.

Share this post


Link to post
Share on other sites
Does this script only respawn empty vehicles? Or is there a way to make them respawn with the crew? Thanks in advance.

I want to know too... I`m creating a tank war here :D

Share this post


Link to post
Share on other sites

Tophe this is a great script, but I am having a nightmare with the respawn and it working with a pilot type checking script from F2.

This is the script that usually goes into the init for F2:

veh addEventhandler ["GetIn", {[_this,["USMC_Soldier_Pilot"]] execVM "f\common\f_isAuthorisedCrewType.sqf"}];

Now it seems to me to be complicating the whole process, nor can I actually get the above script integrated with your call for the vehicle.sqf

Do you possibly have any ideas how to make this work?

In an ideal world, it would be great to have a simple option in your Vehicle.sqf to have the ability to specify a soldier class to operate the vehicle? do you think this is something you could do quite quickly? or anyone else for that matter?

Many thanks...this has been bugging me for a while, unfortunately I dont have the scripting knowledge to fix it.

Share this post


Link to post
Share on other sites

Hello... I got your PM.

You put:

this addaction ["Teleport to Base", "teleport3.sqf"]; this addaction ["Teleport to MHQ","teleport4.sqf"]; veh= [this, 10,1800,0,false,false, "this addaction [""Teleport to Base"", ""teleport3.sqf""]; this addaction [""Teleport to MHQ"",""teleport4.sqf"""] execvm "vehicle.sqf";

Just looking it over quickly i noticed you've put a " at the wrong place and missed out on a bracket... Try this:

this addaction ["Teleport to Base", "teleport3.sqf"]; this addaction ["Teleport to MHQ","teleport4.sqf"]; veh= [this,10,1800,0,false,false,"this addaction [""Teleport to Base"", ""teleport3.sqf""]; this addaction [""Teleport to MHQ"",""teleport4.sqf""]"] execvm "vehicle.sqf"

I'm about to put the kids to bed, so don't have time to look through your code but at least the syntax error should be fixed.

Share this post


Link to post
Share on other sites
Hello... I got your PM.

Who was that to mate?! :)

Any ideas for the Pilot's only limitation to respawned aircraft?

:D Ta Muchly!

Share this post


Link to post
Share on other sites

Oh! My bad...

I thought it was you that sent me the PM. It was someone else.

Wouldn't something like this work?

this addEventhandler ["GetIn", {[_this,["USMC_Soldier_Pilot"]] execVM "f\common\f_isAuthorisedCrewType.sqf"}]; veh = [this,10,1800,0,false,false,"this addEventhandler [""GetIn"", {[_this,[""USMC_Soldier_Pilot""]] execVM ""f\common\f_isAuthorisedCrewType.sqf""}"] execvm "vehicle.sqf"

Share this post


Link to post
Share on other sites
Oh! My bad...

I thought it was you that sent me the PM. It was someone else.

Wouldn't something like this work?

this addEventhandler ["GetIn", {[_this,["USMC_Soldier_Pilot"]] execVM "f\common\f_isAuthorisedCrewType.sqf"}]; veh = [this,10,1800,0,false,false,"this addEventhandler [""GetIn"", {[_this,[""USMC_Soldier_Pilot""]] execVM ""f\common\f_isAuthorisedCrewType.sqf""}"] execvm "vehicle.sqf"

Your a Gent sir!

Unfortunately, this does not work. it works for the first get in attempt, then after the helo respawns, it simply will not run the authorised crew script. Which is completely bizarre as it clearly recognizes the rest of the script enough to respawn the helo, but it simply wont stop any soldier from getting in....

Most odd!

Edited by BD1

Share this post


Link to post
Share on other sites

Thanks for your help with this issue. I just noticed this should be in his respawn script disscussion and not the repair script. DOH!

I did what the instructions and you say but the ammo and other scripts I am calling in the init are not running. The respawn works fine but lets say I want the respawned truck to run an ammo script to add equipment to it. The truck or heli respawns but the ammo script did not run. Here is what I am running in the vehicles init line:

s = this execVM "vrs.sqf"; this exec "scripts\ammoTruckAll.sqf"; veh = [this, 30, 0, 0, TRUE, FALSE,"s = this execVM ""vrs.sqf""; this exec ""scripts\ammoTruckAll.sqf"""]execVM "vehicle.sqf"

As per the isntructions I am enclosing the sqfs in two quotes and I run them outside this script so the initial instance of the vehicle gets proper init also. Thanks...da

Share this post


Link to post
Share on other sites

My problem is that the vehicle respawns where it was destroyed or abandoned.

Share this post


Link to post
Share on other sites
My problem is that the vehicle respawns where it was destroyed or abandoned.

Check your settings.... Either you have set up the script incorrectly or you have another script that interferes with the respawn script.

Share this post


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

×