Jump to content
Tankbuster

Editing, Expanding and Modifying Domination

Recommended Posts

Is it possible to add custom actions and/or run scripts for certain vehicle types via the respawn sqf? I've tried the d_action_menus_vehicle method in i_client but it tries to add the actions every time you get into the vehicle rather than one time at respawn.

Share this post


Link to post
Share on other sites

Strikor,

This is not tested but something like this should work, this is for the vehicle.sqf so this will only work for those vehicles your respawning this way.

in the vehicle.sqf try this:

_myvehicles = [whatever,Cars,you,want,to,put,addaction,on];

then further down in the vehicle.sqf: (My additions are in Red.)

// Respawn vehicle
     if (_dead) then 
{	
	if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep                 _delay;};
	if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;};
	if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;};
	sleep 0.1;

	deleteVehicle _unit;
	sleep 2;
	_unit = _type createVehicle _position;
	_unit setPosASL _position;
	_unit setDir _dir;

               [color="Red"]if (_unit in _myvehicles) then {_unit addAction ["My Action1","doittoit.sqf",1]};[/color]

	if (_haveinit) then 
				{_unit setVehicleInit format ["%1;", _unitinit];
				processInitCommands;};
	if (_hasname) then 
				{_unit setVehicleInit format ["%1 = this; this               setVehicleVarName ""%1""",_unitname];
				processInitCommands;};
	_dead = false;

	// Check respawn amount
	if !(_noend) then {_rounds = _rounds + 1};
	if ((_rounds == _respawns) and !(_noend)) then {_run = false;};
};

Share this post


Link to post
Share on other sites

Thanks, but I can't seem to get it to work. I put it in x_vehirespawn.sqf to test since I have some ATVs using that respawn script.

x_vehirespawn.sqf

#include "x_setup.sqf"

private ["_delay","_disabled","_moved","_newveh","_startdir","_startpos","_type","_vehicle"];

if (!isServer) exitWith{};

_vehicle = _this select 0;

_delay = _this select 1;

_moved = false;

_startpos = position _vehicle;

_startdir = getDir _vehicle;

_type = typeOf _vehicle;

_myvehicles = ["ATV_US_EP1"];

_vehicle setVariable ["d_vec_islocked", if (locked _vehicle) then {true} else {false}];

while {true} do {

sleep (_delay + random 15);

_empty = if ((_vehicle call XfGetAliveCrew) > 0) then {false} else {true};

if (_empty) then {

_moved = if (_vehicle distance _startpos > 5) then {true} else {false};

_disabled = if (damage _vehicle > 0) then {true} else {false};

if ((_disabled && _empty) || (_moved && _empty) || (_empty && !(alive _vehicle))) then {

_isitlocked = _vehicle getVariable "d_vec_islocked";

deletevehicle _vehicle;

_vehicle = objNull;

sleep 0.5;

_vehicle = createVehicle [_type, _startpos, [], 0, "NONE"];

_vehicle setpos _startpos;

_vehicle setdir _startdir;

_vehicle setVariable ["d_vec_islocked", _isitlocked];

if (_isitlocked) then {_vehicle lock true};

if (_vehicle in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};

#ifndef __ACE__

if ((getNumber(configFile >> "CfgVehicles" >> _type >> "ARTY_IsArtyVehicle")) == 1) then {

switch (_type) do {

case "MLRS": {

_vehicle removeMagazine "12Rnd_MLRS";

_vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

};

case "GRAD_RU": {

_vehicle removeMagazine "40Rnd_GRAD";

_vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

};

case "MLRS_DES_EP1": {

_vehicle removeMagazine "12Rnd_MLRS";

_vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

};

case "GRAD_TK_EP1": {

_vehicle removeMagazine "40Rnd_GRAD";

_vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

};

};

["d_bi_a_v", _vehicle] call XNetCallEvent;

};

#endif

};

};

};

No action shows up at all. I even tried changing it to setdamage and nothing happened.

Share this post


Link to post
Share on other sites

So what's the deal with the parajump?

I moved all the scripts into the mission and now can turn and have the altitude and speed showing, but for some reason I still get this crazy camera shake so I don't get to look where I want, I do not have this in any other missions, is there something aside from scripts in AAHALO that is fixing that in other missions?

Edited by callihn

Share this post


Link to post
Share on other sites

I tried searching this but can't quite find what I'm looking for.

In the modified version of domination that we're playing at the moment I need to add an action to the JTACs in Alpha and Bravo squads. I also need to attach a COIN to the engineers in those squads. This is easy to do at the start but how do I make it happen when they respawn?

Share this post


Link to post
Share on other sites
I tried searching this but can't quite find what I'm looking for.

In the modified version of domination that we're playing at the moment I need to add an action to the JTACs in Alpha and Bravo squads. I also need to attach a COIN to the engineers in those squads. This is easy to do at the start but how do I make it happen when they respawn?

x_client/x_setupplayer.sqf

You will most likely find it helpful to include Windows search in your mission editing tools, you can search file content for commands or varibles, this makes things much easier to find and follow.

Anyone know what I'm doing wrong with the new parajump to cause the camera to be jerky or what I can do to fix it?:

http://forums.bistudio.com/showpost.php?p=1747250&postcount=355

Edited by callihn

Share this post


Link to post
Share on other sites

Question!

does anyone know how i can make the RESPAWN script NOT use camo nettings! its fucked up! with all the camo netting :D

Share this post


Link to post
Share on other sites
Question!

does anyone know how i can make the RESPAWN script NOT use camo nettings! its fucked up! with all the camo netting :D

Ahaha. I thought the exact same thing, so I did it yesterday:

x_server\x_vrespawn2.sqf - Remove the red (~29-38)

if (_number_v < 10 || (_number_v > 99 && _number_v < 110)) then {
	_vehicle addeventhandler ["killed", {(_this select 0) setVariable ["D_MHQ_Deployed",false,true]}];
};
[color="Red"]	#ifndef __CARRIER__
_camotype = switch (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "side")) do {
	case 1: {if (__OAVer) then {"Land_CamoNetB_NATO_EP1"} else {"Land_CamoNetB_NATO"}};
	case 0: {if (__OAVer) then {"Land_CamoNetB_EAST_EP1"} else {"Land_CamoNetB_EAST"}};
};
_camo = createVehicle [_camotype, position _vehicle, [], 0, "NONE"];
_camo setPos position _vehicle;
_camo setDir (direction _vehicle) + 180;
_vehicle setVariable ["d_camonet", _camo];
#endif[/color]
} forEach _this;
_this = nil;

sleep 65;

x_server\x_vrespawn2.sqf - Remove the red (~145-156)

		} else {
			_vehicle addeventhandler ["killed", {_this call x_checkveckilleast}];
		};
#endif
[color="Red"]#ifndef __CARRIER__
		if (isNull _camo) then {
			_camotype = switch (getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "side")) do {
				case 1: {if (__OAVer) then {"Land_CamoNetB_NATO_EP1"} else {"Land_CamoNetB_NATO"}};
				case 0: {if (__OAVer) then {"Land_CamoNetB_EAST_EP1"} else {"Land_CamoNetB_EAST"}};
			};
			_camo = createVehicle [_camotype, position _vehicle, [], 0, "NONE"];
			_camo setPos position _vehicle;
			_camo setDir (direction _vehicle) + 180;
			_vehicle setVariable ["d_camonet", _camo];
		};
#endif[/color]
	};
	sleep 8 + random 5;
};
};

Removes all camo nets from the trucks at base, but still allows the camo net on the Deployed MHQs.

Share this post


Link to post
Share on other sites
Thanks, but I can't seem to get it to work. I put it in x_vehirespawn.sqf to test since I have some ATVs using that respawn script.

x_vehirespawn.sqf

#include "x_setup.sqf"

private ["_delay","_disabled","_moved","_newveh","_startdir","_startpos","_type","_vehicle"];

if (!isServer) exitWith{};

_vehicle = _this select 0;

_delay = _this select 1;

_moved = false;

_startpos = position _vehicle;

_startdir = getDir _vehicle;

_type = typeOf _vehicle;

_myvehicles = ["ATV_US_EP1"];

_vehicle setVariable ["d_vec_islocked", if (locked _vehicle) then {true} else {false}];

while {true} do {

sleep (_delay + random 15);

_empty = if ((_vehicle call XfGetAliveCrew) > 0) then {false} else {true};

if (_empty) then {

_moved = if (_vehicle distance _startpos > 5) then {true} else {false};

_disabled = if (damage _vehicle > 0) then {true} else {false};

if ((_disabled && _empty) || (_moved && _empty) || (_empty && !(alive _vehicle))) then {

_isitlocked = _vehicle getVariable "d_vec_islocked";

deletevehicle _vehicle;

_vehicle = objNull;

sleep 0.5;

_vehicle = createVehicle [_type, _startpos, [], 0, "NONE"];

_vehicle setpos _startpos;

_vehicle setdir _startdir;

_vehicle setVariable ["d_vec_islocked", _isitlocked];

if (_isitlocked) then {_vehicle lock true};

if (_vehicle in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};

#ifndef __ACE__

if ((getNumber(configFile >> "CfgVehicles" >> _type >> "ARTY_IsArtyVehicle")) == 1) then {

switch (_type) do {

case "MLRS": {

_vehicle removeMagazine "12Rnd_MLRS";

_vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

};

case "GRAD_RU": {

_vehicle removeMagazine "40Rnd_GRAD";

_vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

};

case "MLRS_DES_EP1": {

_vehicle removeMagazine "12Rnd_MLRS";

_vehicle addMagazine "ARTY_12Rnd_227mmHE_M270";

};

case "GRAD_TK_EP1": {

_vehicle removeMagazine "40Rnd_GRAD";

_vehicle addMagazine "ARTY_40Rnd_120mmHE_BM21";

};

};

["d_bi_a_v", _vehicle] call XNetCallEvent;

};

#endif

};

};

};

No action shows up at all. I even tried changing it to setdamage and nothing happened.

Sorry Strikor try this:

[color="Red"]if (_type in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};[/color]

Share this post


Link to post
Share on other sites

Anyone running into artillery errors in Domi Ace? I edited the map and added a bunch of stuff, and when my guy goes to call in artillery, the HE round will fire, make the noise like its going to land, and then nothing happens, no explosion. I got curious and tried the other rounds, and the DPCIM is the only arty round that will actually impact. Every other round will make the whistling noise right before impact and then nothing.

Edited by 7akata

Share this post


Link to post
Share on other sites
Sorry Strikor try this:

[color="Red"]if (_type in _myvehicles) then {_vehicle addAction ["testaction","test.sqf",1]};[/color]

Works perfectly now, thanks!

Anyone running into artillery errors in Domi Ace? I edited the map and added a bunch of stuff, and when my guy goes to call in artillery, the HE round will fire, make the noise like its going to land, and then nothing happens, no explosion. I got curious and tried the other rounds, and the DPCIM is the only arty round that will actually impact. Every other round will make the whistling noise right before impact and then nothing.

You can crudely get HE working again by replacing all the #ifndef __ACE__ in x_server\x_arifire.sqf with #ifdef __ACE__ . It doesn't work with the SADARM but it's better than nothing.

Share this post


Link to post
Share on other sites
You can crudely get HE working again by replacing all the #ifndef __ACE__ in x_server\x_arifire.sqf with #ifdef __ACE__ . It doesn't work with the SADARM but it's better than nothing.

So is this a known bug, or do you think something else is broke somewhere. I appreciate your help!

Share this post


Link to post
Share on other sites

From Friday's patch:

Sys bi arty disabled until a solution is found for the artillery computer problems, refs #13495 [Xeno]

So it's sort-of intentional. I managed to get the SADARM working by adding adding the vanilla artillery module back to the map in addition to the other change.

Share this post


Link to post
Share on other sites

Regarding my previous question about adding actions to people. Does the d_action_menus_unit "pluggable actions function" in i_client.sqf not do anything? If it does, why is

d_action_menus_unit = [[["alpha_6"],"Air support", "a10sad.sqf", -1000]];

not working?

If that particular function isn't ever going to work because it's broken somehow, what should I do instead?

Share this post


Link to post
Share on other sites

Worked long time ago, haven't checked them lately. I'm not sure if this is updated to how all other actions are handled now (using player variables). Search for d_action_menus_unit and see if it at least tries to do something.

Share this post


Link to post
Share on other sites

It's mentioned in x_setupplayer.sqf

if (!isNil "d_action_menus_unit") then {
if (count d_action_menus_unit > 0) then {
	{
		_types = _x select 0;
		_ar = _x;
		if (count _types > 0) then {
			{
				private "_pc";
				_pc = __getMNsVar(_x);
				if (_p ==  _pc) exitWith { 
					_action = _p addAction [(_ar select 1) call XGreyText,_ar select 2,[],-1,false];
					_ar set [3, _action];
				};
			} forEach _types
		} else {
			_action = _p addAction [(_x select 1) call XGreyText,_x select 2,[],-1,false];
			_x set [3, _action];
		};
	} forEach d_action_menus_unit;
};
};

It shouldn't be this hard to add an action on unit respawn should it?

Share this post


Link to post
Share on other sites

That particular option only works for class names. Here is an example:

[["C130J_US_EP1"],"Load Cargo", "cargoLoad\cargoLoad.sqf", -1000]

Share this post


Link to post
Share on other sites

Is anyone having any joy with base flag textures in the TT version, because I'm not!

#ifdef __OWN_SIDE_WEST__
FLAG_BASE setflagtexture "UK.paa";
#endif
#ifdef __OWN_SIDE_EAST__
if (__OAVer) then {
FLAG_BASE setflagtexture "ca\Ca_E\data\flag_tka_co.paa";
} else {
FLAG_BASE setflagtexture "\ca\data\flag_rus_co.paa";
};
#endif

Still displays the old US Army flag on the south base flag pole.

Share this post


Link to post
Share on other sites

Is there a known issue with JIP and player lists / VON or are my servers just incorrectly setup? If people join a few minutes in, they report being unable to see most of the other players in the view team settings window, and cannot hear each other.

Share this post


Link to post
Share on other sites
Is anyone having any joy with base flag textures in the TT version, because I'm not!

#ifdef __OWN_SIDE_WEST__
FLAG_BASE setflagtexture "UK.paa";
#endif
#ifdef __OWN_SIDE_EAST__
if (__OAVer) then {
FLAG_BASE setflagtexture "ca\Ca_E\data\flag_tka_co.paa";
} else {
FLAG_BASE setflagtexture "\ca\data\flag_rus_co.paa";
};
#endif

Still displays the old US Army flag on the south base flag pole.

Fixed it. The flagpoles have different names in TT

Share this post


Link to post
Share on other sites

One of my team mentioned that there was a variable that controlled the likelihood of an air vehicle being chosen from the bonus vehicle array.

Not only can I not remember who said it, and so can't ask them, but I can't find this variable. Is there such a thing?

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

×