Jump to content

Sign in to follow this  
Winchester Delta_1

How to make vehicels Respawn in Domination

Recommended Posts

Hey fellow ARMA players,

I was reading a post in a forum on how to add new vehicels and aircraft in Domination. CarlGustaffa told the guy to unpbo and put in the vehicel. But i woulden't respawn. That part i luckely do know "on how to UnPbo".

But he also told its gonna be more diffecult to make them respawn in domination and he would not go into that in that topic.

So i try'd to solve that problem myself. But couldn't find any scripts inside the domination that gave me a clue on how do that. Can somebody maybe explain me howto.

I am asking this question cause i had some problems making the F-14 respawn. Because of some kind of weird bug it keeps dancing around when using a separate respawn script from armaholic. The funny thing is that respawn script is working perfectly for the vanilla vehicels and the F-16 mod and other mods. But the F-14, B-52, and the Airwolf mod keep dancing around with that script.

Is there a manual to edit domination and to add respawning vehicels?

Thanks for your time allready. I appreciate the help.

The script for respawning that i use now in Domination is:

v = [this, "", 240, 240] execVM "vrs_AI.sqf"

 /*

VEHICLE RESPAWN SCRIPT WITH CREW RESTRICTIONS 

© May 2007 - norrin (norrins_nook@iprimus.com.au) 

***********************************************************************************************************************************
Version 1.0 

Based upon KaRRiLLioN's original vrs.sqf script heavily modified for use with playable and non-playable AI units and crew restrictions

IMPORTANT: ADD A GAMELOGIC NAMED Server
to the mission to prevent multispawn

to run this script place the following code in the init line of the vehicle:
v = [this, "vehicle name", x, y] execVM "vrs_AI.sqf"
where x and y are the times you wish to set for the vehicle empty respawn delay and vehicle destroyed respawn delay
Note: the vehicle name must be in quotation marks eg. if vehicle name Hmm1 it must appear in the init line as "Hmm1", 
if on the otherhand you don't want to rename your vehicles just put "" instead 

**********************************************************************************************************************************
BEGIN vrs_AI.sqf
*/

private ["_vcl","_respawndelay","_vclemptydelay","_dir","_pos","_type","_unit","_run","_wait","_delay"];

if (!local Server) exitWith {};

_vcl = _this select 0;
_name_vcl = _this select 1;
_vclemptydelay = _this select 2;
_respawndelay = _this select 3;
_dir = Getdir _vcl;
_pos = Getpos _vcl; 
_type = typeOf _vcl;

_run = TRUE;
sleep 5;



for [{}, {_run}, {_run}] do
{
while {_vcl distance _pos < 5 && canMove _vcl} do
 	{
		sleep 1;
 	};
while {canMove _vcl && count crew _vcl > 0 && ({damage _x}forEach crew _vcl)!= 1} do  
 	{
	_wait = Time + _vclemptydelay;
	sleep 1;
};
while {canMove _vcl && count crew _vcl < 1 && Time < _wait} do
{
	sleep 1;
};
while {canMove _vcl && {damage _x} forEach crew _vcl >= 1 && Time < _wait} do
{
	sleep 1;
};
_delay = Time + _respawndelay;
while {!canMove _vcl && Time < _delay} do
 	{
	sleep 1;
 	};
if (count crew _vcl < 1) then
 	{
 		deleteVehicle _vcl;
       	_vcl = _type createVehicle _pos;
  	_vcl setVehicleVarName _name_vcl;
  	player groupchat format ["%1", VehicleVarName _vcl];
       	_vcl setdir _dir;
       	sleep 1;
       	_vcl setvelocity [0,0,0];
       	_vcl setpos _pos;
       	sleep 1;
       	_vcl setvelocity [0,0,0];
 		sleep 2;
};
if ({damage _x} forEach crew _vcl >= 1)then
 	{
 		deleteVehicle _vcl;
       	_vcl = _type createVehicle _pos;
	  	_vcl setVehicleVarName _name_vcl;
  	player groupchat format ["%1", VehicleVarName _vcl];
       	_vcl setdir _dir;
       	sleep 1;
       	_vcl setvelocity [0,0,0];
       	_vcl setpos _pos;
       	sleep 1;
       	_vcl setvelocity [0,0,0];
 		sleep 1;
	call {[_vcl] execVM "vcl_lock\lock.sqf"};
};
sleep 2;
}; 

Share this post


Link to post
Share on other sites

Quick and dirty method: Join a server who is hosting a custom edit involving new respawnable vehicles, copy and de-pbo that mission from the mission cache, and investigate from there.

Maybe it is enough to start the Domination respawning scripts from the vehicles init line? I'm not sure. What makes it "look hard" is the fact that vehicles are given variables, in order to give players proper actions as they get in and out of vehicles. It is needed for the i.e. "Show Status" action to "behave properly".

I recommend you get a proper script editor which can search for text in files. That makes it easier to "track" where stuff happens. Notepad doesn't cut it.

I'm sorry I'm not too helpful. The respawn/variable system in Domination is hard to teach, and it took me quite some time to understand it myself. It's like teaching you how to drive a car using this forum :)

If a custom respawn script works for some addons and not for others (jumping around?), I would suspect the addon to be the bad guy. Try checking what vehicle is respawned and force a change in position when it is respawned.

Share this post


Link to post
Share on other sites

dom x_scripts x_vehirespawn.sqf

2 parameters

_vehicle = _this select 0;

_delay = _this select 1;

so just put this in the init field of the unit

null = [this,90] execVM "x_scripts\ x_vehirespawn.sqf";

this = the vehicle in the init

90 = 90 seconds...

i make alot of typos so dont copy and paste, but you get the idea...

Share this post


Link to post
Share on other sites

Is there a way to do this by simply naming the vehicle? Now in the OA Domination the helicopters are named ch1, ch2, ch3, etc. How can I go about adding 1 or 2 more helicopters with the respawn function and just make them ch7 and ch8? I do understand this would also need editing with the markers.

Share this post


Link to post
Share on other sites
  Quote
;1683887']Is there a way to do this by simply naming the vehicle? Now in the OA Domination the helicopters are named ch1' date=' ch2, ch3, etc. How can I go about adding 1 or 2 more helicopters with the respawn function and just make them ch7 and ch8? I do understand this would also need editing with the markers.[/quote']

I dont think the name has anything to do with it, or you'd loose control over vehicle functions. Somewhere in the mission init or unit init you have to run the above mentioned script with the unit name and delay, obviously.

Edit: Uh, just noticed you performed thread Necromancy. Nevermind.

Share this post


Link to post
Share on other sites

Well its related to the topic, just a later version of Domination.

Share this post


Link to post
Share on other sites

Hi guys

Now im adding vehicles in a domination, but if got a tiny problem they dont respawn, if opened a lot of modified dominations with many vehicles and y can see they all have a specific name like exav16 or ch8.

The question is were do I have to specify that name and in which file, if found some in the init, but i cant understand the code.

Thx for the help, if this has been asked before im sorry but I always search it first or look into other dominations.

Edited by Jaime

Share this post


Link to post
Share on other sites
  Günter Severloh said:
Add this script in the main folder:

http://www.armaholic.com/page.php?id=6080&highlight=SIMPLE+VEHICLE+RESPAWN+SCRIPT

and then for every vehicle you wish to respawn add this code

veh = [this, 15] execVM "vehicle.sqf"

in the init line of the vehicle and or even plane.

Hi Günter thx a lot for the answer, if used that script before and its very good. But with lost of vehicles added in the domination wouldnt it be better to use another method.

If I add like 15 vehicles with a script each running isnt that a big load for the server?

If seen in a lot of dominations that the vehicles added have a specific name and they all respawn like the mhq or helos by default. What I dont know is were to add those specific names.

Share this post


Link to post
Share on other sites

No, I have used this script many times in all of my mpmissions and have my own gameserver,

and have not seen any lag or less performance.

Its not like 20 vehicles are spawning at once.

I would suggest just using this script for vehicles/planes you add, and not to existing vehicles,

and what not in Domination as they have their own respawn setup.

Share this post


Link to post
Share on other sites

Ok thx a lot Gunter going to start with it.

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  

×