Tankbuster

Editing, Expanding and Modifying Domination

1948 posts in this topic

Xeno's thread over user missions, does get a bit bunged up with questions about editing and modifying Domination, so I got permission to start this thread.

For me Domination got me into playing as well as editing. His code is usually internally documented very well and it's possible, with a little code gazing to see how he's done stuff and why he's used a given method.

So, let's get started! :)

---------- Post added at 09:22 AM ---------- Previous post was at 09:10 AM ----------

The basics. To edit a Domination mission you need the mission file, available from Dev Hev or if you don't want the vanilla stuff, from your mission cache folder. The Dev Hev stuff comes in a 7z file, use 7z or winrar to unpack it.

You're going to need an application to 'dePBO' the file. I like Kegetys cPBO but some have trouble with it. So, once you're dePBO'd the mission file, you will end up with the mission folder.

To edit the mission files, I use notepad++ because it does bracket and parenthesis pair matching, but equally a lot of people like Armaedit. It's cool as it knows all the reserved and key words, but it's author is long gone.

That's the absolute basics. So, get in there, have a look through the files and get editing. When you're done, you can see your efforts in editor preview, or use cPBO to remake the PBO from the mission file and try them on a server.

---------- Post added at 09:27 AM ---------- Previous post was at 09:22 AM ----------

There are 3 main files you should look into first.

In the mission folder, there are files called i_server, i_client and i_common.

i_server makes all the server side units, so that's all the enemies.

i_client deals with all the player stuff such as scoring and player interaction with other stuff in the game.

i_common is where stuff common to both server and client is managed. So, enemy town locations and the arrays that determine what units you win for completing objectives in here.

Edited by Foxhound

Share this post


Link to post
Share on other sites

I've never tried notepad++ so I won't comment on it. But I've sort of grown up using UltraEdit and UltraCompare, which can be found here. They're not free though, but Kegetys have a very nice highlighting wordfile you can use for UltraEdit. Regular Notepad and using OS for file search? Forget it, you'll just end up frustrated. UltraCompare is an extremely nice tool if you try to keep your edited version updated to the latest vanilla Domination, since you can do a three-way folder compare; your version, latest Domination version, and the previous Domination version. Especially useful when you loose track of what files you have edited.

A tip. When editing Domination, don't change the code. Instead copy the old line and comment it using // at the beginning of the line. Use // also for multiple lines, and avoid block commenting using /* and */ unless what you are commenting is really huge. Reason: When something gets messed up (and it will :)) when you search for text in files, you'll always see both versions at the same time which will make it easier to identify your introduced bug. If you used block commenting (/* and */) the line would show up but it wouldn't be immediately apparent that it was commented out before you actually open the file.

Share this post


Link to post
Share on other sites

nice thread Tankbuster,

sure it will be helpfull for a lot of people when it gets filled up.

I'll start by posting the question i had on the other thread:

"on request of a clanmember i have added a blackhawk to the 2.28 version.

For now it can pick up ammoboxes, but i got no 'chopper menu' to drop it after loading it in.

How can i get that chopper to have such a menu?"

Share this post


Link to post
Share on other sites

In init.sqf you define the vehicles, initiate them with respawn scripts etc.

In i_client.sqf you define d_check_ammo_load_vecs (I guess you probably already did this), add the chopper here. Also look for d_choppers where you setup marker to use and hud name etc.

In x_client\x_chop_hud.sqf you can change the welcome message if you want to.

In x_client\x_initvec.sqf the action is added using the __addchopm macro. It should be applied to all choppers defined above with d_choppers.

Maybe a bit vague, but I hope it helps. I've never added choppers myself, only removed or rearranged stuff. These are the places I would start to look, but there might be more. Hard to tell when I can't really try it out.

Share this post


Link to post
Share on other sites

Things to check for the chopper ammo box hud are:

i_client.sqf:

d_check_ammo_load_vecs needs to have the chopper type in it.

d_choppers needs an entry for the chopper (make sure you put it into the correct version's array) - something along the lines of:

["HR7",2,"chopper7",307,"n_air","ColorWhite","7",""]

init.sqf:

Search for x_helirespawn2 and add an entry for your chopper:

[ch7,307,true]

Note that ch7 is the name of the chopper in mission.sqm and 307 must match with the number in d_choppers.

That should be it, if it still isn't working post what you've already got and I'll have another go.

*edit* Agh! I see you beat me to it Carl Gustaffa - I shall remember to type quicker next time, even if I am eating... :)

Edited by {SAS}Nutta
Pipped to the post :(

Share this post


Link to post
Share on other sites

Great thread, thanks for posting it. One quick question...

I edited a version of Domination, but didn't know it was missing the revive option. Is there an easy way to make it into a revive mission, or should I just do the work and port all my custom stuff into the Domination_west_revive? Thanks.

Share this post


Link to post
Share on other sites

I'd suggest that revive is a build option. That means it usually has it's own vanilla mission file, so yes, you should get the revive version and port your stuff into it.

But this isn't too hard if you're methodical. Take a file comparison application as mentioned earlier, compare your vanilla version to a vanilla revive. There you can see how revive differs from normal. Then compare your edit to the unedited normal, Now you can see your edits. If your edits are to files that are identical when you compared normal to revive, you can dump your edited file straight into the revive mission folder. if not, the comparison program will suggest how you might merge them.

At the very worst you'll have to reauthor your modded version by editing a revive mission folder, but as you documented all your changes, this won't be a problem. You *did* document all your changes, didn't you? :)

Share this post


Link to post
Share on other sites

How do i increment the chances of getting bonus air vehicles? Like, say A-10, AH-1Z, AH-64D, for example.

Share this post


Link to post
Share on other sites
How do i increment the chances of getting bonus air vehicles? Like, say A-10, AH-1Z, AH-64D, for example.

Ah now, this is a tricky one.

In i_common, there's two array and they hold the classnames of the vehicles that you are given for prizes. The two arrays are called (for side mission and main mission respectively);

d_sm_bonus_vehicle_array and d_mt_bonus_vehicle_array

The problem is that when you win a side or main mission, the game chooses, at random, 1 vehicle from the appropriate array. So, there's an equal chance of getting any of the vehicles from that array. What you can do to increase the chance of getting a particular vehicle is to put it in the array twice.

So, here's the basic side mission bonus array from my game;

["A10_US_EP1","AH64D_EP1","AH6J_EP1","M1A1_US_DES_EP1","M1A2_US_TUSK_MG_EP1","M6_EP1","UH60M_EP1"]

So theres a 1 in 8 chance of getting a Tusk, but if you wanted to increase the chance of getting Tusks, you could put the Tusk classname in there twice;

["A10_US_EP1","AH64D_EP1","AH6J_EP1","M1A1_US_DES_EP1","M1A2_US_TUSK_MG_EP1","M1A2_US_TUSK_MG_EP1","M6_EP1","UH60M_EP1"]

So, now there's a 2 in 9 (or nearly 1 in 4) chance of getting a Tusk.

Hope this helps,

Tanky -Paul-

Share this post


Link to post
Share on other sites

I don't think that will work since it is randomly decided whether your bonus should be an AIR vehicle or not.. Instead you might wanna change the number _airval in server_x\x_getbonus.sqf. Eg. setting it to 60 will mean you have 40% change to get an airplane.

Share this post


Link to post
Share on other sites

Oh I see, he wants to increase the chances of getting air vehicles, rather than a particular vehicle.

I've not looked at that getbonus.sqf file, that's good find. I didn't realise the method of selecting the vehicle isn't totally random any more. Thank you.

---------- Post added at 08:39 PM ---------- Previous post was at 08:33 PM ----------

I'm going to add another piece of software Domeditors might consider.

SBSMAC has written a file checker called Squint. It's very much a work in progress and is not fully featured yet but in short, it can check your files for errors such as mismatched brackets and braces, and also suggest good coding practice.

Just drop a sqf, or even an entire mission folder into it's file pane and it will check the files for all kinds of errors.

Share this post


Link to post
Share on other sites
Xeno adjusted that already since version 2.24 (i believe)

What version are you using?

Me? 2.28. What point are you replying to?

---------- Post added at 03:40 PM ---------- Previous post was at 03:35 PM ----------

I would appreciate some clarification on something from the guys...

I realise that the #defines are sometimes not exclusive. For example, if possible to have both #ifdef __TT__ and #ifdef __wounds__ true at the same time, but something is bugging me. Are any of them exclusive? Can we get into an fatal condition by having a bad combination of defines?

So, let me ask this. __OA__ isn't really about Arrowhead is it? I mean, if I edit my TT version and add in ArmA2 units, __OA__ is still true isn't it? I think __OA__ is more about __Takistan__ than about Arrowhead.

Share this post


Link to post
Share on other sites

What becomes true (defined) or not is up to you. x_setup.sqf has some pretty strict rules on what to combine or not. I know I tried some "funny stuff" a long time ago that would end in a crash. I believe the __OA__ define for Xeno is that it is based only on Operation Arrowhead content; no Chernarus land or Arma2 units in use. If you want to make a new version, maybe the safest thing would be to define a new one, i.e. __CO__ for "Combined Operations". Will give a hefty workload though, and a nightmare to keep updated. With Arma2 content lacking so badly, I don't see why you would want to though.

Share this post


Link to post
Share on other sites
I believe the __OA__ define for Xeno is that it is based only on Operation Arrowhead content; .

Yes, but that doesn't preclude me from leaving __OA__ defined and adding ArmA2 units? Will something bad happen?

---------- Post added at 04:50 PM ---------- Previous post was at 04:48 PM ----------

maybe the safest thing would be to define a new one, i.e. __CO__ for "Combined Operations". Will give a hefty workload though, and a nightmare to keep updated. .

Which is why I won't do it. It's far too much hard work.

My plan is to have ArmA2 Russians as the (TT) North base and US Army (with some USMC) as the south base. The AI will be Takistanis. That's why I need ArmA2 content.

Share this post


Link to post
Share on other sites

After a weekend in which I spent almost as much time editing DomiOA! as playing it I've fixed a few more bugs in v2.28:

Choppers not respawning when abandoned intact despite setting times in init.sqf:

The code to check the chopper positions and respawn them was missing it's _startpos variable which broke the range checking code. In addition, when _startpos was set correctly it only counted the time spent checking one chopper when six or more were being checked, resulting in a respawn time of 15 minutes actually taking over an hour and a half to trigger...

New x_server/x_helirespawn2.sqf: (I didn't change much but there's enough tweaks to make it easier to just post the new file.)

// by Xeno, patched by Nutta
#include "x_setup.sqf"
private ["_heli_array", "_vec_a", "_vehicle", "_number_v", "_i", "_ifdamage", "_empty", "_disabled", "_startpos", "_hasbox"];
if (!isServer) exitWith{};

_heli_array = [];
{
_vec_a = _x;
_vehicle = _vec_a select 0;
_number_v = _vec_a select 1;
_ifdamage = _vec_a select 2;
_heli_array set [count _heli_array, [_vehicle,_number_v,_ifdamage,0, position _vehicle,direction _vehicle,typeOf _vehicle,(if (_ifdamage) then {0} else {_vec_a select 3})]];

_vehicle setVariable ["D_OUT_OF_SPACE", -1];
_vehicle setVariable ["D_ABANDONED", -1];
_vehicle setVariable ["d_vec", _number_v, true];
_vehicle setVariable ["d_vec_islocked", if (locked _vehicle) then {true} else {false}];

#ifdef __TT__
if (_number_v < 400) then {
	_vehicle addeventhandler ["killed", {_this call x_checkveckillwest}];
} else {
	_vehicle addeventhandler ["killed", {_this call x_checkveckilleast}];
};
#endif
} forEach _this;
_this = nil;

while {true} do {
__MPCheck;
__DEBUG_NET("x_helirespawn2.sqf",(call XPlayersNumber))
for "_i" from 0 to (count _heli_array - 1) do {
	sleep 10 + random 5;
	_vec_a = _heli_array select _i;
	_vehicle = _vec_a select 0;
	_ifdamage = _vec_a select 2;
	_startpos = _vec_a select 4;

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

	_disabled = false;
	if (!_ifdamage) then {
		if (_empty && _vehicle distance _startpos > 10) then {
			_abandoned = _vehicle getVariable "D_ABANDONED";
			if (_abandoned != -1) then {
				if (time > _abandoned) then {_disabled = true;};
			} else {
				_vehicle setVariable ["D_ABANDONED", time + (_vec_a select 7)];
			};
		} else {
			_vehicle setVariable ["D_ABANDONED", -1];
		};
	};

	if (damage _vehicle > 0.9) then {_disabled = true};

	if (_empty && !_disabled && alive _vehicle && (_vehicle call XOutOfBounds)) then {
		_outb = _vehicle getVariable "D_OUT_OF_SPACE";
		if (_outb != -1) then {
			if (time > _outb) then {_disabled = true};
		} else {
			_vehicle setVariable ["D_OUT_OF_SPACE", time + 600];
		};
	} else {
		_vehicle setVariable ["D_OUT_OF_SPACE", -1];
	};

	sleep 0.01;

	if ((_disabled && _empty) || (_empty && !(alive _vehicle))) then {
		_hasbox = _vehicle getVariable "d_ammobox";
		if (isNil "_hasbox") then {
			_hasbox = false;
		};
		if (_hasbox) then {["ammo_boxes",__XJIPGetVar(ammo_boxes) - 1] call XNetSetJIP};
		_isitlocked = _vehicle getVariable "d_vec_islocked";
		sleep 0.1;
		deletevehicle _vehicle;
		if (!_ifdamage) then {_vec_a set [3,0]};
		sleep 0.5;
		_vehicle = objNull;
		_vehicle = createVehicle [(_vec_a select 6), (_vec_a select 4), [], 0, "NONE"];
#ifndef __CARRIER__
		_vehicle setpos (_vec_a select 4);
#else
		_vehicle setPosASL [(_vec_a select 4) select 0, (_vec_a select 4) select 1, 15.9];
#endif
		_vehicle setdir (_vec_a select 5);

		_vehicle setVariable ["d_vec_islocked", _isitlocked];
		if (_isitlocked) then {_vehicle lock true};

		_vec_a set [0,_vehicle];
		_heli_array set [_i, _vec_a];
		_number_v = _vec_a select 1;
		_vehicle setVariable ["D_OUT_OF_SPACE", -1];
		_vehicle setVariable ["D_ABANDONED", -1];
		_vehicle setVariable ["d_vec", _number_v, true];
		["d_n_v", _vehicle] call XNetCallEvent;

#ifdef __TT__
		if (_number_v < 400) then {
			_vehicle addeventhandler ["killed", {_this call x_checkveckillwest}];
		} else {
			_vehicle addeventhandler ["killed", {_this call x_checkveckilleast}];
		};
#endif
	};
};
};

Engineers unable to build a FARP after first death:

x_client/x_playerspawn.sqf:

// added after first "if (d_player_is_medic) then {....};" check:
if (d_eng_can_repfuel) then {
_id = __pGetVar(d_farpaction);
if (_id != -4444) then {
	__prma;
	__pSetVar ["d_farpaction", -4444];
};
};

// added after second "if (d_player_is_medic) then {...};" check:
if (d_eng_can_repfuel) then {
if (__pGetVar(d_farpaction) == -4444) then {
	__pSetVar ["d_farpaction", _p addAction ["Build FARP" call XGreyText, "x_client\x_farp.sqf",[],-1,false]];
};
};

I also removed the line "__pSetVar ["d_is_engineer",true];" from x_client/x_setupplayer.sqf as it doesn't appear to be used anywhere. Doesn't change any behaviour but it made me feel better... :)

Fix for network messages for FARP, MASH and MG nest marker removal:

While testing the FARP fix I ran into errors generated when trying to remove map markers when a FARP etc. is destroyed.

In x_client/x_playerfuncs.sqf replace all three:

["d_p_o_r", str(player)] call XNetCallEvent;

lines with

["d_p_o_r", [str(player),_m_name]] call XNetCallEvent;

That's about it for now, I'll be back if I find any more...

Previous bug fixes for DomiOA! 2.28

Edited by {SAS}Nutta
Forgot to say it was abandoned not wrecked choppers...

Share this post


Link to post
Share on other sites
Me? 2.28. What point are you replying to?

Sry Tank, i was refering to the chances of getting an aircraft, nvm.

I am since today running an ACE domi AI 2.28 version on my server,

but the airdrop doesn't seem to work.

I tried every airdrop but the when the planes flies over, he droppes nothing.

Any advice on how to solve this?

i compared the x_createdrop.sqf of an ace and non-ace 2.28 version and they show no difference.

Regards

Share this post


Link to post
Share on other sites

Was the Domination Dev Heaven space taken down? I saw Xeno was thinking about retiring from Domination :( Are we staying at 2.28?

Share this post


Link to post
Share on other sites

@{SAS}Nutta

Whats the chances of you Uploading your fixed version of dom mate? I tried changing everything you said but i ended up breaking it badly lol

Share this post


Link to post
Share on other sites

Fix for network messages for FARP, MASH and MG nest marker removal:

While testing the FARP fix I ran into errors generated when trying to remove map markers when a FARP etc. is destroyed.

In x_client/x_playerfuncs.sqf replace all three:

["d_p_o_r", str(player)] call XNetCallEvent;

lines with

["d_p_o_r", [str(player),_m_name]] call XNetCallEvent;

I am using 2.28 West Revive for Takistan and do not have x_client/x_playerfuncs.sqf. Is this normal?

Edit: Looked at some of your other bug fixes. What variant are you using? I think this may be Ordeal's issue as well.

Edited by Grimes [3rd ID]

Share this post


Link to post
Share on other sites

I've only been testing co-op West OA so far as that's what we're running on our server so there could well be things I'm missing for the revive, ACE, TT etc. versions. I shall have a go at running the other versions and see what I find - is there any flavour that's the most popular these days?

If Xeno's OK with me uploading a bugfixed version of 2.28 I'll get one together ASAP. Can't say exactly when that might be, it won't take me long to get a co-op West bugfixed version but as for the others I have no idea what surprises await...

x_playerfuncs.sqf is in the x_client\x_f folder

That'd be the one - it's possible I may have some of the directories wrong as I ended up typing most of those by hand. The code should be more reliable as that was pasted directly from my working version.

*edit* Any recommended upload site for ArmA stuff? Freeness, ease of use and reasonable download speeds being the priorities...

Edited by {SAS}Nutta
see *edit*

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