Arma 3 > Questions & Answers > Topic Details
BennekeBen Jun 28, 2013 @ 4:04pm
respawn/vehicle respawn
im kinda new with the editor but i have been making some mission in arma2 and arma3 alpha, to being able to use vehicles that respawn i allways used a vehicle.sqf script.
now with the release of beta they wont work anymore. ive searched around and cant seem to solve it. I also tried the Btc revive script wich has a vehicle respawn option. but it allows me to respawn only 1 vehicle for each side.
If anyone has an idea or has a working version for the Beta let me know!
Invite me @ steam : Bennekeben / / @ x-fire : Bennekeben
Showing 1-9 of 9 comments
< >
Ed! Jun 29, 2013 @ 12:18am 
Create a description.ext file in your mission folder and then read up :
http://community.bistudio.com/wiki/Description.ext#respawn

For vehicle respawning I did this.
in your script or wherever you create the vehicle, just add _vehicle execVM "vehicleinit.sqf";

create a file vehicleInit.sqf in your mission file with this.
////////////////////////
_vehicle = _this;
_vehiclepos = getPos _vehicle;
_vehicledir = getDir _vehicle;
_classname = typeOf _vehicle;
waitUntil{!alive _vehicle};
sleep 5;
deleteVehicle _this;
sleep 30;
_vehicle = _classname createVehicle _vehiclepos;
_vehicle setPos _vehiclepos;
_vehicle setDir _vehicledir;
_vehicle execVM "vehicleInit.sqf";
//////////////////////////////
BennekeBen Jun 29, 2013 @ 3:33am 
Ive tried this but still no luck for me

I paste my current script i made to test the info u gave me
Take a look maybe u see anymistakes because this is all new to me.

It coud sound lazy but its not.. somebody paste working scripts here? ;)

There is a chance im forgetting to add simple things but im just not that expirianced with the commen signs/commands

This are my current scripts maybe the more experianced person can see the mistakes i made?
-----------------------------------------------------------------
Description.ext (nothing special just a basic setting for server info)

author="Bennekeben";
OnLoadName = "1manarmyfans.webs.com";
OnLoadMission = "testing the respawn function";
loadScreen = "";
onLoadIntro = "Testing Respawn";
onLoadMissionTime = 1;
respawn = 3;
respawnDelay = 3;
respawndialog = 0;
respawnVehicleDelay = 5;
aiKills = 1;
ShowGPS = 1;
enableItemsDropping = 0;

class Header
{
gameType = COOP; //game type
minPlayers = 1; //min # of players the mission supports
maxPlayers = 38; //max # of players the mission supports
};

------------------------------------------------------------------------

Vehicleinit.sqf ( to me this is not correct/missing alot of to do's)


_vehicle = _this;
_vehiclepos = getPos _vehicle;
_vehicledir = getDir _vehicle;
_classname = typeOf _vehicle;
waitUntil{!alive _vehicle};
sleep 5;
deleteVehicle _this;
sleep 30;
_vehicle = _classname createVehicle _vehiclepos;
_vehicle setPos _vehiclepos;
_vehicle setDir _vehicledir;
_vehicle execVM "vehicleInit.sqf";

with this u get an error adding the exec VM"blabla" in the init of the vehicle i want to respawn

Error : _vehicle execVM "vehicleInit.sqf , error message : Local variable in global space
i used simular script like this in the alpha.

-----------------------------------------------------------------------
Mission.sqm (added 2 quads with respawn markers like explained @ http://community.bistudio.com/wiki/Description.ext#respawn , yet again that doesnt work either)



version=12;
class Mission
{
addOns[]=
{
"A3_Characters_F_BLUFOR",
"A3_Soft_F_MRAP_01",
"a3_map_stratis",
"A3_Soft_F_Quadbike"
};
addOnsAuto[]=
{
"A3_Characters_F_BLUFOR",
"A3_Soft_F_Quadbike",
"a3_map_stratis"
};
randomSeed=600795;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
month=7;
day=6;
hour=14;
minute=15;
startFogBase=0.001;
forecastFogBase=0.001;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
class Groups
{
items=1;
class Item0
{
side="WEST";
class Vehicles
{
items=1;
class Item0
{
position[]={1779.6107,5.5,5709.606};
id=0;
side="WEST";
vehicle="B_Soldier_F";
player="PLAYER COMMANDER";
leader=1;
skill=0.60000002;
};
};
};
};
class Vehicles
{
items=2;
class Item0
{
position[]={1762.0364,5.5,5654.812};
id=1;
side="EMPTY";
vehicle="B_Quadbike_01_F";
skill=0.60000002;
health=0.20473531;
init="respawn_vehicle_west";
};
class Item1
{
position[]={1757.3634,5.5,5634.2505};
id=2;
side="EMPTY";
vehicle="B_Quadbike_01_F";
skill=0.60000002;
health=0.20473531;
text="respawn_vehicle_west_1";
};
};
class Markers
{
items=3;
class Item0
{
position[]={1765.2429,5.5,5714.1348};
name="respawn_west";
type="Empty";
};
class Item1
{
position[]={1749.2324,5.5,5656.0854};
name="respawn_vehicle_west";
type="mil_marker";
};
class Item2
{
position[]={1743.5525,5.5,5638.0415};
name="respawn_vehicle_west_1";
type="mil_marker";
};
};
};
class Intro
{
addOns[]=
{
"a3_map_stratis"
};
addOnsAuto[]=
{
"a3_map_stratis"
};
randomSeed=5913872;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
month=7;
day=6;
hour=14;
minute=15;
startFogBase=0.001;
forecastFogBase=0.001;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};
class OutroWin
{
addOns[]=
{
"a3_map_stratis"
};
addOnsAuto[]=
{
"a3_map_stratis"
};
randomSeed=6207419;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
month=7;
day=6;
hour=14;
minute=15;
startFogBase=0.001;
forecastFogBase=0.001;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};
class OutroLoose
{
addOns[]=
{
"a3_map_stratis"
};
addOnsAuto[]=
{
"a3_map_stratis"
};
randomSeed=13600365;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0.30000001;
startWind=0.1;
startWaves=0.1;
forecastWeather=0.30000001;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
month=7;
day=6;
hour=14;
minute=15;
startFogBase=0.001;
forecastFogBase=0.001;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};


For direct communication plz add me on Steam or Xfire.
Ed! Jun 29, 2013 @ 5:27am 
respawn features only work in multiplayer environments. did you export it to multiplayer missions and test it by hosting a server(it can be LAN, doesn't matter)
Ed! Jun 29, 2013 @ 5:28am 
and also when putting stuff in the init line in the editor. You refer to "this" and not "_vehicle".
BennekeBen Jun 29, 2013 @ 6:21am 
Yes its multiplayer and when i try this vehicle execVM "vehicleinit.sqf"; it gives an error of a missing ";" >> it shows error >> this|#|vehicle execVM "vehicleinit.sqf";
When i try >> this execVM "vehicleinit.sqf"; it shows error >> Type Script, Expect Nothing

maybe i did something wrong in the vehicleinit.sqf ?
Ed! Jun 29, 2013 @ 11:03am 
nah. try then to give your vehicle that you placed a name and then in the init.sqf add
vehiclename execVM "vehicleInit.sqf";
Buffalo Soldier Jul 5, 2013 @ 3:35am 
DatBro can u help me pls i named the vehicle it spawned but only once where it stands at mission beggining thats where i need but need it repetadely i used ur script from the first post says something about vehicle position error dunno if this is something
Last edited by Buffalo Soldier; Jul 5, 2013 @ 3:46am
Ed! Jul 5, 2013 @ 4:32am 
armaholic is full of templates and tutorials.
http://www.armaholic.com/page.php?id=590
BennekeBen Jul 6, 2013 @ 2:51pm 
3 steps a vehicleinit.sqf ,a init.sfq, and a vehicle name -> vehicle_1
--------------------------------------------------------------------------
Vehicleinit.sqf
---------------------

_vehicle = _this;
_vehiclepos = getPos _vehicle;
_vehicledir = getDir _vehicle;
_classname = typeOf _vehicle;
waitUntil{!alive _vehicle};
sleep 5;
deleteVehicle _this;
sleep 30;
_vehicle = _classname createVehicle _vehiclepos;
_vehicle setPos _vehiclepos;
_vehicle setDir _vehicledir;
_vehicle execVM "vehicleInit.sqf";
-------------------------------------------------------------------------
Init.sfq
-----------
vehicle_1 execVM "vehicleInit.sqf";
vehicle_2 execVM "vehicleInit.sqf";
------------------------------------------------------
To make more vehicles respawn add more lines to the init.sqf

Example > vehicle_3 execVM "vehicleInit.sqf";
vehicle_4 execVM "vehicleInit.sqf";
-------------------------------------------------------------------------
When both scripts added to your Multiplayer mission go to the editor and name the vehicles u want to respawn >> vehicle_1 , vehicle_2 ,...so on so on..

If you have 10 vehicles u want to respawn u need to name them and add a line for them in the init. doesnt matter if its air,car,armored aslong its named vehicle_randomnumberhere
Showing 1-9 of 9 comments
< >
Per page: 15 30 50
Date Posted: Jun 28, 2013 @ 4:04pm
Posts: 9