Jump to content
xeno

co30 Domination! One Team

Recommended Posts

Nice work oktane!

Could it possibly have any connection to extended event handlers? For example, if the server can't handle them, it can't pass them to players?

Could it possibly be an order of events problem?

Maybe some redundancy could be built into the x_playersetup.sqf as a fallback.

eg a script that reads the client's public var list and checks it isn't null - resending the server's array if it is?

Final thoughts, is there any possibility that having the mission on the clients machine might cause conflict? eg client loads mission from local source and arma detects the "server" gamelogic from that mission, causing the fuckup?

God it's great being ignorant about network coding! I can come up with all kinds of bullshit theories!

Seriously though, xeno, mando - sort us out!

Share this post


Link to post
Share on other sites

Nothing to do with eventhandlers, I don't think..

When a player connects, x_serverOPC is executed on the server. (init.sqf, ln620) This *should* cause all the variables in that array I spoke of to be transmitted to the client. The client is supposed to waituntil the number of items in vars_array > 0 (init.sqf ln950), which would imply the server has set the pubvar and the client has now received it. But the client doesn't seem to wait for the data or its not even getting to that line in the init...

it could be that this line, if (!X_Client) exitWith {}; (init.sqf ln 929) is causing the client to exit the init prematurely. Or look into any other ways that init.sqf could be aborted from before getting to ln950 or beyond. (client side only)

The differences in this version and the old version that work are that all the client checks have been replaced with a x_client boolean... there could be a bug here.

wink_o.gif

Share this post


Link to post
Share on other sites

The differences in this version and the old version that work are that all the client checks have been replaced with a x_client boolean... there could be a bug here.

wink_o.gif

Am not following the thread currently (not much time atm) but I have a nicely filled vars_array on client side here in my standard version smile_o.gif

Xeno

Share this post


Link to post
Share on other sites

OK.. I will continue to play around and see whats causing it. sad_o.gif

Turok for the next revision, you'll want to update the name of your mission in mission.sqm so that the version number is correct and shows up with its version number in the mission list. Right now .3 and .4 show up as the same name.

Also please consider naming the file similar to Xeno's/community standard. co30_Domination_WEST_TurokEditv04.Sara.pbo for example. Then it will show up next to Xeno's domination.

Just a suggestion.

I will go back to trying to find the bug now.

goodnight.gif

Share this post


Link to post
Share on other sites

Will do on naming standard oktane.

I'll probably make next release just a bug fix as I'm still playing around with ideas for further things to add.

In particular, I really like Carl's ideas for new player classes - whcih ppotentially has amazing scope for me to totally fuck up the domination gamecode wink_o.gif

Plus I think I should go back and revise how mando bombs and missiles have been implemented based around the small amount of feedback I've had.

Good luck with the bug hunt oktane - please let me know if anything turns up.

Incidentally, which version of domination are you investigating the JIP bug with? Are you comparing my 0.4 edit with domination 3.02?

Share this post


Link to post
Share on other sites

Yesterday playing our own version (classbased, not free for all, limited ammo and so on), we had some JIP problems. The array sent is now 4 more elements longer, containing slightly randomized weather information (iRainLess,iRainMore,iFogMore, and iFogLess). These just contain the information used in the weather areas.

But the JIP problem was a bit weird actually.

A friend joined while the game was probably finished with the main mission setup, and before the side mission was setup. For this guy, he would get Main Mission info in the status screen, but not the Side Mission. He would not get any mission markers shown on the map.

Later, another guy joined, and he claimed all appeared ok.

A while back, with a severely tampered 2.22 version, we also had non-jip players who didn't get markers updated. I always thought it was my own fault, and haven't bothered reporting it.

I really hope ArmA2 doesn't make JIP this difficult. Certain things should be synched automatically every minute or so. Too many problems with "local" effects that should never be local.

Share this post


Link to post
Share on other sites

Ok, then let's see if we can find another solution...

1. Remove the JIP trigger in the editor (X_Client && X_INIT)

2. Add the following after "client_target_counter = count resolved_targets;" to init.sqf:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

waitUntil {local player};

[] execVM "x_scripts\x_jip.sqf";

3. In x_serverOPC.sqf add the following after "publicVariable "vars_array";":

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

vars_array = [];

Clients now really do wait until vars_array is filled (although I don't think that those changes are needed).

@TurokGMT

You are sending publicVariable inside init.sqf in your version, for example:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

mando_support_left_re_west = 0; //Number of AI reinforcement drops available

publicVariable "mando_support_left_re_west";

What happens here is that every new client that connects will broadcast those variables (init gets called on each client and server) and revert those variables to the initial values on each client and the server. Not wanted if a client JIPs later in the game wink_o.gif

Another thing is that you should allways be sure where a script should be executed.

For example, you start "scripts\allow_air_support.sqf" on all connected machines including the server, but you should only start it on clients.

Then... you are using sleep at the beginning of init.sqf. That means that the init.sqf script will stop execution until the mission is started. What happens then is that onPlayerConnected sends the vars_array but vars_array gets set back to the default value (vars_array = []) as soon as the execution of init.sqf continues meaning you'll get an empty array.

I know, MP mission making isn't easy smile_o.gif

Xeno

Share this post


Link to post
Share on other sites

Thanks for the info and help xeno! I haven't had much time to work on my edit over the past few days - got an iminent house move coming up...*sigh

But I'm making tweaks here and there to either patch up or improve upon the code I've got.

Hopefully I'll release v0.5 just before the summer break before going dark for a few weeks until I get broadband set up in my new place - wherever that might be...meh

Share this post


Link to post
Share on other sites
Ok, then let's see if we can find another solution...

Xeno,

I think I have narrowed this down to Turok + Mando's placement of the Mando stuff in init.. If I remove that stuff, or move it past all the JIP code (both server and client), the mission works great. (Xeno, your version works fine smile_o.gif )

Now I just need to verify what is needed to be run by the server.

I already did similar to what you suggested, but instead put some debug messages in.. The client gets stuck on the waiting for the vars_array to come in. It never gets sent because the SERVER has never finished the init, it bombs out somewhere in mandoland, and since that is at the beginning of the file, it doesn't do a lot of the really important stuff. (like set the onplayerconnect!wink_o.gif

I am going to whip up a little server messages func so the server can report its progress in init.sqf.

To reproduce this 100% (Turok mod), all you need to do is host dedicated, join and wait for main and side missions and then leave and come back. (persistent mode should be on)

When you come back, the vars_array is never sent and your client init hangs. You can still play but you lose all of the info in the vars_array.

If you do some magic like create a unit and in his init, make the server execute x_serverOPC.sqf, the data is sent like it should be and then the client resumes.

I think there is a line for the mando stuff that should not be executed for the server, or it does not return. I should be able to find the line that it gets stuck on after creating that debug server messages utility function. smile_o.gif

Share this post


Link to post
Share on other sites

k, so that sucks....I've officially broken domination!? confused_o.gif sorry guys!

Thanks for your work in identifying the cause of the problem oktane - looks like I've got some serious recoding to do.

With regards to ensuring that only certain code is run on server, client or both, what arguments should I be using in init.sqf if statments?

eg

if (isServer) then {}

A lot of this will depend on xeno's original definitions I guess.

Sorry for not spotting the JIP bug earlier guys - during testing I was naturally the first person to connect to my dedicated server and hence initiated the map load - everything works fine for the first person in.

After I've finished hanging my head in shame at my shoddy coding, I'll get right on fixing stuff. banghead.gif

Share this post


Link to post
Share on other sites

There are a couple of things I would like to change in my personal version of Domination, if possible.

First, I would like to mod my Domination mission such that you can complete a mission without killing every single enemy in the area. It seems to me you should be able to complete a mission by destroying 80-90 percent of the enemy soldiers, all the armored vehicles, complete other objectives (destroy a particular building, kill/capture a General etc.) and possibly destroy the enemy radio tower (if there is one), then get a mission complete without killing ever single enemy soldier in the area. And doing so would also require you to continue to be cautious entering the town after "mission complete" as there could be a handful of enemy soldiers lurking about.

Secondly, I am having an annoying number of "the enemy has decided to destroy X" Where I spend an hour or so on a mission and when I finally destroy the primary objective (prototype helicopter, Arty, tower etc.) I get the message that the enemy destroyed it themselves and I get no credit and no bonus vehicle.

If someone could point me in the right direction, file and code wise, to "tamper" with these things I would very much appreciate it. Thanks in advance!

Share this post


Link to post
Share on other sites

Your first point has already been implemented in domination and discussed in this (admittedly long) thread. Look for this bit in init.sqf:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// max men for main target clear

d_man_count_for_target_clear = 6;

// max tanks for main target clear

d_tank_count_for_target_clear = 0;

// max cars for main target clear

d_car_count_for_target_clear = 0;

Not sure where the code for sidemission resolution handling is - although it would be nice to know for my edit too - anything destroyed by a mando airstrike doesn't count as player side resolved side mission at the moment sad_o.gif

Share this post


Link to post
Share on other sites
Your first point has already been implemented in domination and discussed in this (admittedly long) thread.

Thanks and again my apologies for not digging through the thread to find the answer. I need to print out and bind this thread for leisure reading on the couch! smile_o.gif

Share this post


Link to post
Share on other sites
anything destroyed by a mando airstrike doesn't count as player side resolved side mission at the moment sad_o.gif

And this relates to the other point dogsb made. 'Enemy decided to destroy it themselves' happens when;

(1) Timed satchel charges go off after the player who placed them dies

(2) The target is killed by an artillery strike

(3) The target is killed by collateral damage.

It's a shame this happens, but I'm guessing this behaviour is buried deep within the hard code, probably with an eventhandler. It would be nice if it could be tidied up so the credit for kills is given more accurately.

Also, I'd like the game to be able to work out 'assists'. For example, the pilot of a UH60 should get some of the credit for the kills his gunners get. Likewise for tank drivers/commanders. Can this be done in any way, Xeno, do you think?

Share this post


Link to post
Share on other sites

Ok, v0.5 of TurokGMT edit is well underway.

To avoid the JIP bug and general mutilation of xeno's beautifully crafted domination code, I'm creating my own Turokinit script to be called at the end of the init.sqf file which checks for isServer to take xeno's "what code is running where" comments onboard.

Wish me luck...

wink_o.gif

Share this post


Link to post
Share on other sites

@xeno (or anyone else that can figure it out)

domination init.sqf has these lines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if (d_version == "AI") then {

server_grp_array = [];

onPlayerDisconnected "xhandle=[_name] execVM ""x_scripts\x_serverOPDC.sqf""";

};

but there's no other mention to x_serverOPDC.sqf

x_serverOPDC.sqf from what I can tell from it's code, it ejects the player's soldier from a vehicle if it's in one and then deletes the soldier. It then does the same for all members of the players group (which in AI version will all be AI).

Am I right in thinking therefore that there is no equivalent to x_serverOPDC.sqf that gets called for normal or revive versions?

Share this post


Link to post
Share on other sites

ok, current mauling of xeno's 3.02 west init script looks like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

titleText ["", "BLACK FADED", 0.2];

X_INIT = false;

X_Server = false;

X_Client = false;

X_JIP = false;

X_SPE = false;

X_MP = (if (playersNumber east + playersNumber west + playersNumber resistance + playersNumber civilian > 0) then {true} else {false});

// Code checks if machine is server and for presence of players.

if (isServer) then {

X_Server = true;

if (!(isNull player)) then {X_Client = true;X_SPE = true;};

X_INIT = true;

} else {

X_Client = true;

if (isNull player) then {

X_JIP = true;

[] spawn {waitUntil {!(isNull player)};X_INIT = true};

} else {

X_INIT = true;

};

};

setterraingrid 50;

// center position, name city, diameter for placing units

target_names = [[[9348.73,5923.4,0],"Cayo", 210],

[[10692.9,4953.4,0],"Iguana", 250],

[[7613.23,6424.32,0],"Arcadia", 235],

[[8241.74,9016.77,0],"Chantico", 200],

[[9170.43,8309.3,0],"Somato", 230],

[[10580.1,9430.44,0],"Paraiso", 300],

[[12399,7141.23,0],"Ortego",280],

[[11452,6075.97,0],"Dolores",300],

[[13351.8,8937.45,0],"Corazol",300],

[[14470,10773.5,0],"Obregan",240],

[[13172,11319.6,0],"Mercalillo",210],

[[14232.7,12525,0],"Bagango",230],

[[17291,14213.4,0],"Masbete",180],

[[19033.5,13814.3,0],"Pita",230],

[[12538.3,15004.2,0],"Eponia",210],

[[16595.8,9357.96,0],"Everon",200],

[[9773.03,14435.7,0],"Pacamac",150],

[[7771.72,15802.1,0],"Hunapu",150],

[[10592.5,16193.8,0],"Mataredo",150],

[[12426.8,13387.6,0],"Carmen",170],

[[2895.6,2890.64,0],"Rahmadi",180]

];

for "_xxxxx" from 2 to ((count target_names) + 1) do {

call compile format ["""%1"" objStatus ""HIDDEN"";", _xxxxx];

};

// Define sides

d_own_side = "WEST";

d_enemy_side = "EAST"; // This variable may be defunct as it was used to define d_side_enemy, which is now clearly defined

d_side_enemy = east;

d_side_player = west;

d_version = "NORMAL";

d_side_player_str = "west";

d_own_side_trigger = "west";

// true = you will see player markers right after mission start

// false = you have to manually turn on player markers via settings

d_show_player_marker = false;

// show old intro

d_old_intro = false;

// if true then the old engineer (faster) script gets used

d_engineer_old = false;

// next variables turns on/off some internal AI features

// maybe you are using a mod like ECS which allready has an enhanced AI system

// turn on/off Rommels suppression script (true = on)

d_suppression = true;

// turn on/off smoke, means enemy will throw smoke grenades if true

d_smoke = true;

// turn on/off internal group link system

d_link = true;

// if true, internal weather system will be used

d_weather = true;

// if true, fog area will be used

d_weather_fog = true;

d_weather_sandstorm = false; // for islands like Sakakah set to true. Replaces rain with sandstorm

// choose false, if you don't want to use the backpack feature

d_use_backpack = true;

// choose false, if you don't want to use teamstatusdialog

d_use_teamstatusdialog = true;

d_rep_truck = "Truck5tRepair;

d_version_string = "west";

//default flag RACS

FLAG_BASE setflagtexture "\ca\misc\data\usa_vlajka.pac";

d_engineer = "SoldierWMiner;

d_artillery = "OfficerW;

// can build mash

d_medic = ["SoldierWMedic"];

// if you want to use the mgnest for machinegunners

d_with_mgnest = true;

// can build mg nest

d_mg_gunner = ["SoldierWMG"];

if (d_with_mgnest) then

{

d_mg_nest = "WarfareBWestMGNest_M240";

);

// Side missions

// each row of sm_positions array represents one sidemission

// first element of the array is allways the exact position of the sidemission and the position of the sidemission target

// see x_scripts\x_getsidemission.sqf for server sided stuff and x_scripts\x_getsidemissionclient.sqf for client stuff

// to see what a specific sidemission does, edit the file x_scripts\x_getsidemission.sqf and uncomment the line

// //current_mission_index = 43; Now you are able to start the script in the editor and select an index

sm_positions = [[[14258.5,15169.1,0]], // index: 0, radar tower on Pico de Perez

[[17763.2,12139.8,0], [17717.1,12040.1,0]], // index: 1, Officer, Tres Valles, second array = position Shilka

[[18074.1,18206.8,0], [18151.5,18216.1,0]], // index: 2, steal plane prototype, Antigua, second array position armor

[[14750.5,13925.6,0], [14750.4,13935.4,0], [14712.9,13992.4,0]], // index: 3, steal tank prototype, Alcazar, array 2 and 3 = infantry and armor positions

[[12104.7,17750,0], [12114.3,17739.1,0], [12110.8,17656.7,0]], // index: 4, Water tower (chemical weapons) Cabo Santa Lucia

[[10269.6,7353.71,0], [10268.4,7313.75,0]], // index: 5, King of Sedia at hotel in Vallejo

[[13938.3,16718.8,0], [13904.7,16694.1,0], [13836.9,16705.1,0]], // index: 6, Hangar at Roca del Dror

[[6400.09,7472.16,0], [6611.5,7652.1,0]], // index: 7, Training facility in San Peregrino

[[13113,16509.7,0]], // index: 8, Radio tower at Pico de Revolucion

[[19225.5,13889.3,0], [19231.1,13939,0], [19236.2,13992.5,0], [19198.6,13912.9,0]], // index: 9, Helicopter Prototype at Pita Airfield

[[11424.7,8573.97,0], [11354.3,8554.22,0]], // index: 10, Artillery at top of mount San Esteban

[[16582.7,4690.99,0], [16430.9,4617.28,0]], // index: 11, Lighthouse on Isla del Zorra

[[7844.54,9738.02,0], [7903.75,9624.79,0]], // index: 12, Officer in Cabo Canino, attention, uses nearestObject ID

[[11008.5,8028.66,0], [11016.7,7938.81,0]], // index: 13, Prime Minister, Valle Azul

[[15681.9,11384.6,0], [15851.6,11431.2,0]], // index: 14, Radio tower at Monte Liberacion

[[10838.5,12636.7,0], [10886.6,12722.2,0]], // index: 15, Transformer station in Tlaloc

[[6107.75,16944.8,0], [6305.86,17354.5,0]], // index: 16, Radio tower near Cabo Valiente

[[15318.3,9870.91,0], [15368.8,9875.38,0]], // index: 17, Officer in Valor

[[9709.64,11010.8,0], [9655.45,11026.4,0]], // index: 18, Government member visitin Rashidah shipyard

[[10131.6,8377.25,0], [10115.8,8420.6,0]], // index: 19, Prime minister of Tadistan in Pesto

[[17452.8,13577.6,0], [11851.9,14376.5,0]], // index: 20, Convoy Ixel to Tandag, start and end position

[[12723,8729.78,0], [6946.93,8226.66,0]], // index: 21, Convoy Corazol to Estrella, start and end position

[[7736.82,15810.5,0], [14293.2,9450.24,0]], // index: 22, Convoy Hunapu to Modesta, start and end position

[[10312.7,13407.5,0], [10202.5,13416.8,0], [10309.9,13471.5,0],[10433.7,13239.7,0],[10319.8,13444.5,0],[10284,13425.8,0],[10326.3,13397.6,0],[10335.9,13354.9,0]], // index: 23, Special forces boats in a bay near Pacamac

[[7767.34,7500.25,0]], // index: 24, Fuel station in camp near Arcadia

[[4726.85,15689,0],[4385.75,15825.4,0],[4415.64,15790.9,0],[4375.74,15790.8,0],[4392.87,15521.3,0],[4532.88,15304.8,0],[4585.08,15287.2,0],[4978.4,15466.1,0],[4855.92,15535.1,0],[4930.69,15514.1,0],[4956.34,15760.8,0],[4949.85,15827.9,0],[4964.33,16067,0],[4987.25,15717.1,0],[4395.8,15350.6,0], [4574.74,15374.2,0],[4368.82,15737,0],[5044.83,15799.3,0],[4860.15,15679.2,0]], // index: 25, enemy officer on Isla del Vasal or Isla del Vida

[[7743.49,14452.7,0],[7959.68,14514.2], [7774.97,14422.1,0],[7667,14409.6,0]], // index: 26, Hangar on Trelobada

[[12535.7,12699.6,0]], // index: 27, Radio tower at farm near Bagango

[[10245.7,15784.9,0],[10276.6,15813.6,0],[10269.1,15751,0],[10287.4,15719.9,0]], // index: 28, Radio Tower at bunker near Mataredo

[[8166.81,17018.4,0], [8130.84,17010.5,0],[8121.2,16991.2,0],[8140.73,17030,0],[8149.6,17049.7,0], [8162.93,16994.6,0],[8154.33,16974.8,0] ], // index: 29, Tank depot at Cabo Juventudo

[[18239,2943.84,0],[18186.4,3081.09,0]], // index: 30, scientist on Monte Asharah

[[17563.9,9550.78,0], [17589,9571.56,0], [17572.9,9567.49,0], [17529.4,9573.4,0], [17563.9,9533.05,0], [17527.6,9532.41,0], [17600.9,9551.71,0]], // index: 31, Tank depot near Everon

[[11359.1,5325.78,0], [11346.2,5357.91,0],[11249.9,5286.24,0],[11200.1,5182.9,0],[11287.7,5280.05,0],[11347.4,5312.99,0]], // index: 32, Capture the flag, Parato

[[11184.8,8849.94,0], [11138.7,8869.54,0], [11195.2,8820.68,0], [11203.6,8857.68,0],[11149.1,8791.9,0],[11158.3,8860,0]], // index: 33, Capture the flag, Bonanza

[[11388.3,9848.09,0]], // index: 34, Transformer station near Paraiso

[[12492,10849,0],[12500.9,10883.5,0]], // index: 35, Government member Isla de Libertad (attention, the AI is placed in a Lighthouse, uses nearestObject ID)

[[11919.6,15361.8,0], [11967.2,15314.4,0],[11841.5,15302.9,0],[11935,15480.1,0],[11950.3,15395.7,0],[11897.4,15424.6,0]], // index: 36, Capture the flag, Pesadas

[[11300.6,16870.3,0]], // index: 37, Prison, Isla de Victoria

[[13978.5,15741.7,0]], // index: 38, Biological weapons near Passo Epone

[[16197.8,10336.2,0]], // index: 39, Radio tower on top of Monte Valor

[[9379.85,5221,0]], // index: 40, Prison camp, Tiberia

[[11619.9,14336.6,0]], // index: 41, Prison camp, Tandag

[[9626.99,16344.6,0]], // index: 42, Officer in forrest Selva de Caza

[[11531.7,6113.28,0], [11387.1,6130.63,0], [11431.5,5966.3,0],[11665.7,6210.15,0]], // // index: 43, Dolores bridges... bridge 1, bridge 2, bridge 3

[[9529.46,3492.03,0], [9570.09,3566.11,0]], // index: 44, Steal chopper prototype on San Thomas

[[14206.3,12523.6,0]], // index: 45, Destroy bank building in Bagango, attention, uses nearestObject ID

[[10673.1,8980.08,0]], // index: 46, Destroy factory building in Paraiso, attention, uses nearestObject ID

[[8975.58,8437.76,0]], // index: 47, Destroy factory building in Somato, attention, uses nearestObject ID

[[12956.3,8638.32,0]], // index: 48, Transformer station Corazol, attention, uses nearestObject ID

[[16551.3,12925.3,0]], // index: 49, Officer near Benoma

[[16592.5,11844.6,0]] // index: 50, Artillery base

];

// to add bonus vehicles just add a new position and direction to sm_bonus_positions and a new vehicle to sm_bonus_vehicle_array

// the number of the elements in the sm_bonus_positions and sm_bonus_vehicle_array must be equal (you don't have to change a script)

if (isServer) then {

sm_bonus_positions = [

[[9804.41,9997.06,0], 0], // A10/Su34B Position and direction

[[9838.57,9997.0,0], 0], // AH1/KA50 Position and direction

[[9839.79,10055.9,0], 180], // AH6/Mi17 Position and direction

[[9767.19,9996.12,0], 0], // AV8B/Su34 Position and direction

[[9767.19,9996.12,0], 0], // AV8B2/Su34 Position and direction

[[9839.79,10055.9,0], 180], // UH60/Mi17 Position and direction

[[9559.23,9890.8,0], 270], // M1/T72 Position and direction

[[9573.58,9890.8,0], 270] // Vulcan/ZSU Position and direction

];

};

sm_bonus_vehicle_array = (

switch (d_own_side) do {

case "RACS": {["A10","AH1W","AH6_RACS","AV8B","AV8B2","UH60","T72_RACS","Vulcan_RACS"]};

case "WEST": {["A10","AH1W","AH6","AV8B","AV8B2", "UH60", "M1Abrams","Vulcan"]};

case "EAST": {["Su34B","KA50","Mi17","Su34","Su34","Mi17","T72","ZSU"]};

}

);

// main target missions

// to add bonus vehicles just add a new position and direction to mt_bonus_positions and a new vehicle to mt_bonus_vehicle_array

// the number of the elements in the mt_bonus_positions and mt_bonus_vehicle_array must be equal (you don't have to change a script)

if (isServer) then {

mt_bonus_positions = [

[[9559.23,9874.15,0], 270], // Stryker_ICV_M2/BMP2 Position and direction

[[9559.23,9859.23,0], 270], // Stryker_ICV_MK19/BRDM2 Position and direction

[[9513.53,9841.47,0], 90], // HMMWV50/UAZMG Position and direction

[[9513.53,9856.57,0], 90], // HMMWVMK/UAZ_AGS30 Position and direction

[[9513.53,9856.57,0], 90], // HMMWVTOW/BRDM2_ATGM Position and direction

[[9559.23,9874.15,0], 270], // Stryker_TOW/BMP2 Position and direction

[[9513.53,9841.47,0], 90] // M113/BRDM2 Position and direction

];

};

mt_bonus_vehicle_array = (

switch (d_own_side) do {

case "RACS": {["Stryker_ICV_M2","Stryker_ICV_MK19","HMMWV50","HMMWVMK","HMMWVTOW","Stryker_TOW","M113_RACS"]};

case "WEST": {["Stryker_ICV_M2","Stryker_ICV_MK19","HMMWV50","HMMWVMK","HMMWVTOW","Stryker_TOW","M113"]};

case "EAST": {["BMP2","BRDM2","UAZMG","UAZ_AGS30","BRDM2_ATGM","BMP2","BRDM2"]};

}

);

if (isServer) then {

// _E = East

// _W = West

// _G = Racs/Guer

// this is what gets spawned

d_sleader_E = "SquadLeaderE";

d_sleader_W = "SquadLeaderW";

d_sleader_G = "SquadLeaderG";

d_crewman_E = "SoldierECrew";

d_crewman2_E = "SoldierEB";

d_crewman_W = "SoldierWCrew";

d_crewman2_W = "SoldierWB";

d_crewman_G = "SoldierGCrew";

d_crewman2_G = "SoldierGB";

d_pilot_E = "SoldierEPilot";

d_pilot_W = "SoldierWPilot";

d_pilot_G = "SoldierGPilot";

d_allmen_E = ["SoldierEB","SoldierEMedic","SoldierEG","SoldierE","SoldierENOG","SoldierEMG","SoldierEAT","SoldierEAA","SoldierESniper","SoldierEMiner"];

d_allmen_W = ["SoldierWB","SoldierWMedic","SoldierWG","SoldierW","SoldierWNOG","SoldierWMG","SoldierWAT","SoldierWAA","SoldierWSniper","SoldierWMiner"];

d_allmen_G = ["SoldierGB","SoldierGMedic","SoldierGG","SoldierG","SoldierGNOG","SoldierGMG","SoldierGAT","SoldierGAA","SoldierGSniper","SoldierGMiner"];

d_specops_E = ["SoldierESaboteur","SoldierESaboteurPipe","SoldierESaboteurBizon","SoldierESaboteurMarksman"];

d_specops_W = ["SoldierWSaboteur","SoldierWSaboteurPipe","SoldierWSaboteurPipe2","SoldierWSaboteurRecon","SoldierWSaboteurAssault","SoldierWSaboteurMarksman"];

d_specops_G = ["SoldierGCommando","SoldierGMarksman","SoldierGGuard"];

d_sabotage_E = ["SoldierESaboteur","SoldierESaboteurPipe"];

d_sabotage_W = ["SoldierWSaboteur","SoldierWSaboteurPipe","SoldierWSaboteurPipe2"];

d_sabotage_G = ["SoldierGCommando"];

d_veh_a_E = ["T72","BMP2","BRDM2","ZSU","UAZMG","UAZ_AGS30","DSHKM","AGS","D30","UralRefuel","UralRepair","UralReammo"];

d_veh_a_W = ["M1Abrams","Stryker_ICV_M2","M113","Vulcan","HMMWV50","HMMWVMK","M2StaticMG","AGS","M119","Truck5tRefuel","Truck5tRepair","Truck5tReammo"];

d_veh_a_G = ["M1Abrams","M113_RACS","M113_RACS","Vulcan_RACS","LandroverMG","HMMWVMK"];

d_arti_observer_E = "TeamLeaderE";

d_arti_observer_W = "TeamLeaderW";

d_arti_observer_G = "TeamLeaderG";

// position, where the attack or ai choppers and planes get spawned (flying)

d_airki_start_positions = [

[1155.8,13968.2,0],

[24739.8,9568.23,0]

];

// type of enemy plane that will fly over the main target

d_airki_attack_plane = (

if (d_enemy_side == "EAST") then {

"Su34B"

} else {

"A10"

}

);

// type of enemy chopper that will fly over the main target

d_airki_attack_chopper = (

if (d_enemy_side == "EAST") then {

"KA50"

} else {

"AH1W"

}

);

// enemy parachute troops transport chopper

d_transport_chopper = (

if (d_enemy_side == "EAST") then {

"Mi17"

} else {

"UH60"

}

);

// convoy start position and direction

// convoy waypoints 1 and 2 (1 or 2 gets randomly selected)

d_sm_convoy = [

[

[17452.8,13577.6,0],0,

[[16963.1,14105.9,0], [15399.6,13744,0], [15135.7,14049.8,0], [13983.5,13168.2,0], [13824.8,13116,0] , [12563.6,13406.7,0], [12395.6,14494,0], [11851.9,14376.5,0]],

[[16962.4,14106.6,0],[15371.1,12698.4,0],[14602.8,11861.4,0],[14103.6,12405.2,0],[13082.1,11276.8,0],[10100,14120.9,0],[11851.9,14376.5,0]]

],

[

[12723,8729.78,0],20.4149,

[[12737.5,8787.06,0], [10947.4,10623.1,0], [9614.35,11036.2,0], [8671.46,10084.4,0], [7618.55,9048.34,0], [7766.26,8822.9,0], [6946.93,8226.66,0]],

[[12737.5,8787.4,0],[10947.2,10623.3,0],[10517.3,9640.52,0],[10147.1,9317.35,0],[8952.3,8345.36,0],[8038.49,8893.38,0],[6946.93,8226.66,0]]

],

[

[8048.9,15783.5,0],101.542,

[[10100.4,14120.8,0],[10951.5,12658.1,0],[13082,11276,0],[13979.9,9841.15,0],[13816.5,9469.06,0],[14293.2,9450.24,0]],

[[10100.4,14120.8,0],[12394.8,14494.2,0],[12562.7,13406.4,0],[14124.8,12507.3,0],[13082,11276,0],[13979.9,9841.15,0],[13816.5,9469.06,0],[14293.2,9450.24,0]]

]

];

// these vehicles get spawned in a convoy sidemission (domination internal names)

d_sm_convoy_vehicles = (

switch (d_enemy_side) do {

case "EAST": {["BRDM2","BMP2", "ZSU", "UralRepair", "UralRefuel", "UralReammo", "T72"]};

case "WEST": {["Stryker_ICV_M2","M113", "Vulcan", "Truck5tRepair", "Truck5tRefuel", "Truck5tReammo", "M1Abrams"]};

}

);

// start positions of the choppers that will parachute new paratroopers over the main target (randomly chosen)

d_para_start_positions = [

[236.8,13889.7,0],

[812.8,9521.73,0],

[8172.8,865.727,0]

];

// end or delete positions of the choppers that will parachute new paratroopers over the main target (randomly chosen)

d_para_end_positions = [

[19500.8,6497.73,0],

[18956.8,17329.7,0],

[10476.8,20081.7,0]

];

// positions of the tanks in the sidemissions, where you have to destroy tanks

d_sm_tanks_dir_array = [

[114.952,114.952,114.952,114.952,292.444,292.444],

[178.861, 178.861, 178.861, 0, 0, 273.398]

];

// enemy ai skill: [base skill, random value (random 0.2) that gets added to the base skill]

d_skill_array = [0.3,0.2];

// Type of aircraft, that will air drop stuff

x_drop_aircraft = "UH60";

// max men for main target clear

d_man_count_for_target_clear = 6;

// max tanks for main target clear

d_tank_count_for_target_clear = 0;

// max cars for main target clear

d_car_count_for_target_clear = 0;

};

x_drop_array = (

switch (d_own_side) do {

case "RACS": {[["Drop Artillery", "M119"], ["Drop Landrover","Landrover_Closed"], ["Drop Ammo", "SpecialBoxGuer"]]};

case "WEST": {[["Drop Artillery", "M119"], ["Drop Humvee","HMMWV50"], ["Drop Ammo", "SpecialBoxWest"]]};

case "EAST": {[["Drop Artillery", "D30"], ["Drop Uaz","UAZ"], ["Drop Ammo", "SpecialBoxEast"]]};

}

);

// side of the pilot that will fly the drop air vehicle

x_drop_side = d_own_side;

// position of the player ammobox at base (created only on the players computer, refilled every 20 minutes)

d_player_ammobox_pos = [9659.13,9985.81,0];

// position base, a,b, for the enemy at base trigger and marker

d_base_array = [[9821.47,9971.04,0], 600, 200];

// this vehicle will be created if you use the "Create XXX" at a mobile respawn (old "Create Motorcycle")

d_create_bike = "M1030";

// vehicle reload time factor (for the chopper and plane service area).

x_reload_time_factor = 4;

// vehicle reload... turn engine off (false = don't turn engine off)

d_reload_engineoff = true;

// these vehicles can be lifted by the wreck lift chopper (previous chopper 4), but only, if they are completely destroyed

x_heli_wreck_lift_types = sm_bonus_vehicle_array + mt_bonus_vehicle_array;

if (X_SPE) then {

number_targets = count target_names;

} else {

number_targets = Param1;

};

skiptime param2;

current_target_index = -1;

number_side_missions = count sm_positions;

side_missions_random = [];

current_mission_index = -1;

current_mission_resolved_text = "";

side_mission_winner = 0;

side_mission_resolved_client = false;

resolved_targets = [];

update_target=false;

target_clear=false;

update_mission=false;

all_missions_resolved = false;

ammo_boxes = 0;

max_number_ammoboxes = 20;

the_end = false;

bonus_number = -1;

extra_bonus_number = -1;

mr1_in_air = false;

mr2_in_air = false;

sec_kind = 0;

sec_solved = "";

ari_available = true;

ari_type = "";

splashdown = "";

ari1 = 0;

ari2_available = true;

ari2_type = "";

splashdown2 = "";

announce_counterattack = "";

tele_array = [];

client_target_counter = 0;

current_mission_text = "Currently no side mission!";

vehicle_attached_list = [];

player_is_driver = false;

vec2_id = -1000;

vec_id = -1000;

sec_target_name = "";

actionID1 = -1;

actionID2 = -1;

objectID1 = objNull;

objectID2 = objNull;

rep_array = [];

new_jump_flag = objNull;

jump_flags = [];

weapon_array = [];

date_str = "";

ass = -1;

mr1_lift_chopper = objNull;

mr2_lift_chopper = objNull;

last_ammo_drop = -3423;

bike_created = false;

o_arti = [];

// static truck load

truck1_cargo_array = [];

truck2_cargo_array = [];

max_truck_cargo = 6;

current_truck_cargo_array = 0;

cargo_selected_index = -1;

currently_loading = false;

main_target_radiotower_pos = [0,0,0];

main_target_radiotower_down = false;

pbp_id = -1;

Observer1 = objNull;

Observer2 = objNull;

Observer3 = objNull;

d_create_box = [];

// you have to set respawndelay in the description.ext file to the same value

// for the revive version you have to set respawndelay in the description.ext to value 2 (respawndelay=20;=2;}

d_respawn_delay = 20;

// if you set d_with_respawn_dialog_after_death = false then you will respawn at your base, if true you'll see the respawn dialog allways if you die

d_with_respawn_dialog_after_death = true;

// for markers and revive (same like NORRN_player_units)

d_player_entities = ["RESCUE","RESCUE2","alpha_1","alpha_2","alpha_3","alpha_4","alpha_5","alpha_6","alpha_7","alpha_8","bravo_1","bravo_2","bravo_3","bravo_4","bravo_5","bravo_6","bravo_7","bravo_8","charlie_1","charlie_2","charlie_3","charlie_4","charlie_5","charlie_6","charlie_7","charlie_8","delta_1","delta_2","delta_3","delta_4"];

// This variable set to true for domination modes other than revive

x_weapon_respawn = true;

// Vars_array is the list passed to clients

vars_array = [];

if (isServer) then {

call compile preprocessFile "x_scripts\x_initx.sqf"; //server side code only, terminates by setting x_inited to true

waitUntil {x_inited};

if (d_weather) then {

[] execVM "scripts\weather\weathergen2.sqf";

};

// create random list of targets

targets_random = [];

for "_i" from 1 to number_targets do {

_ind = floor random (count target_names);

while {_ind in targets_random} do {_ind = floor random (count target_names);};

targets_random = targets_random + [_ind];

};

// create random list of side missions

for "_i" from 1 to number_side_missions do {

_ind = floor random number_side_missions;

while {_ind in side_missions_random} do {_ind = floor random number_side_missions;};

side_missions_random = side_missions_random + [_ind];

};

current_counter = 0;

current_mission_counter = 0;

side_mission_resolved = true;

counterattack = false;

extra_mission_remover_array = [];

extra_mission_vehicle_remover_array = [];

check_trigger = objNull;

xlink_running = false;

create_new_paras = false;

first_time_after_start = true;

nr_observers = 0;

//******************************************************************************************

**********************************

//***** Vehicle Respawn - Name of vehicle in Editor, Empty/Wrecked Delay, (numbered heli specific)/(base truck specific) *****

//******************************************************************************************

**********************************

x_helirespawn = compile preprocessFile "x_scripts\x_helirespawn.sqf";

x_vrespawn = compile preprocessFile "x_scripts\x_vrespawn.sqf";

x_vehirespawn = compile preprocessFile "x_scripts\x_vehirespawn.sqf";

[ch1,240,1,true] spawn x_helirespawn;

[ch2,240,2,true] spawn x_helirespawn;

[ch3,240,3,false] spawn x_helirespawn;

[ch4,240,4,false] spawn x_helirespawn;

[xvec1,240,1,"MR"] spawn x_vrespawn;

[xvec2,240,2,"MR"] spawn x_vrespawn;

[xvec3,240,1,"TR"] spawn x_vrespawn;

[xvec4,240,2,"TR"] spawn x_vrespawn;

[xvec5,240,3,"TR"] spawn x_vrespawn;

[xvec6,240,7,"TTR"] spawn x_vrespawn;

[xvec7,240,6,"TR"] spawn x_vrespawn;

[xvec8,240,5,"TR"] spawn x_vrespawn;

[xvec9,240,4,"TR"] spawn x_vrespawn;

[xvec10,240,8,"TTR"] spawn x_vrespawn;

[xmedvec,240,0,"MV"] spawn x_vrespawn;

[boat1,240] spawn x_vehirespawn;

[boat2,240] spawn x_vehirespawn;

[boat3,240] spawn x_vehirespawn;

[boat4,240] spawn x_vehirespawn;

[boat5,240] spawn x_vehirespawn;

[boat6,240] spawn x_vehirespawn;

[boat7,240] spawn x_vehirespawn;

[boat8,240] spawn x_vehirespawn;

[boat9,240] spawn x_vehirespawn;

[boat10,240] spawn x_vehirespawn;

[boat11,240] spawn x_vehirespawn;

[boat12,240] spawn x_vehirespawn;

[boat13,240] spawn x_vehirespawn;

[boat14,240] spawn x_vehirespawn;

[boat15,240] spawn x_vehirespawn;

[boat16,240] spawn x_vehirespawn;

[boat17,240] spawn x_vehirespawn;

[boat18,240] spawn x_vehirespawn;

[boat19,240] spawn x_vehirespawn;

[boat20,240] spawn x_vehirespawn;

[boat21,240] spawn x_vehirespawn;

[boat22,240] spawn x_vehirespawn;

[boat23,240] spawn x_vehirespawn;

[boat24,240] spawn x_vehirespawn;

[boat25,240] spawn x_vehirespawn;

[boat26,240] spawn x_vehirespawn;

[boat27,240] spawn x_vehirespawn;

[boat28,240] spawn x_vehirespawn;

[d_wreck_rep,"Wreck Repair Point",x_heli_wreck_lift_types] execVM "x_scripts\x_repwreck.sqf";

d_check_boxes = [];

no_more_observers = false;

main_target_ready = false;

[] execVM "x_scripts\x_setupserver.sqf";

[] execVM "x_scripts\x_infiltrate.sqf";

[] execVM "x_scripts\x_createnexttarget.sqf";

onPlayerConnected "[] exec ""x_scripts\x_serverOPC.sqf"""; // This script makes vars_array public - but what are initial values of array

if (d_version == "AI") then {

server_grp_array = [];

onPlayerDisconnected "xhandle=[_name] execVM ""x_scripts\x_serverOPDC.sqf""";

};

};

//X_INIT should always be true at this point

waitUntil {X_INIT};

//************************************

//***** Prepare to be dazzled... *****

//************************************

[]execVM "TurokGMT_Scripts\TurokGMTSERVERONLY.sqf";

if (!X_Client) exitWith {};

//******************************************************************************************

****

//***** X_Client will be set to true at start of init.sqf if client is running the script. *****

//***** Server will therefore exit init.sqf at this point *****

//***** All code beyond this point is client side only *****

//******************************************************************************************

****

// here you can change what chopper 1 - 3 can lift

// default is, all choppers can lift the same vehicles

d_helilift1_types = ["M113_MHQ","M113Ambul","M113AmbulRacs","Truck5tRepair","Truck5tRefuel","Truck5tReammo","Truck5tOpen","Truck5tMG","BMP2","Stryker_ICV_M2","Stryker_ICV_MK19","HMMWV50","HMMWVMK","UAZ_AGS30","D30","UAZMG","Stryker_TOW","HMMWVTOW","M113_RACS","BRDM2","BRDM2_ATGM","Vulcan_RACS","Vulcan"];

d_helilift2_types = d_helilift1_types;

d_helilift3_types = d_helilift1_types;

ts_vec_id = -1;

ts_nearest = objNull;

ts_id = -1;

player_backpack = [];

prim_weap_player = "";

x_weapon_array = [];

// need to locate when this is sent to client, x_serverOPC.sqf makes the array public

waitUntil {count vars_array > 0};

//*******************************************************

//***** FOLLOWING LINES COMPILE INTO VARIABLE ARRAY *****

//*******************************************************

date_str = vars_array select 0;

current_target_index = vars_array select 1;

current_mission_index = vars_array select 2;

main_target_radiotower_down = vars_array select 3;

target_clear = vars_array select 4;

all_missions_resolved = vars_array select 5;

ammo_boxes = vars_array select 6;

the_end = vars_array select 7;

mr1_in_air = vars_array select 8;

mr2_in_air = vars_array select 9;

sec_kind = vars_array select 10;

ari_available = vars_array select 11;

ari2_available = vars_array select 12;

resolved_targets = vars_array select 13;

side_missions_random = vars_array select 14;

jump_flags = vars_array select 15;

truck1_cargo_array = vars_array select 16;

truck2_cargo_array = vars_array select 17;

main_target_radiotower_pos = vars_array select 18;

Observer1 = vars_array select 19;

Observer2 = vars_array select 20;

Observer3 = vars_array select 21;

client_target_counter = count resolved_targets;

//**************************************

//***** Again with the dazzling... *****

//**************************************

[]execVM "TurokGMT_Scripts\TurokGMTCLIENTONLY.sqf";

if (true) exitWith {};

apologies for the HUGE code insert...

as you can see, I've commented the hell out of it and added calls for my two scripts towards the end.

I've also removed most of the code switching that goes on between different versions of domination - TurokGMT Edition is based on normal version only - not revive or AI.

I've posted it here so folks can have a nose through it and see if I've done anything stupid...it's 11.30pm here and I've been tinkering all day, so anything could have happened.

Anyone got a handle on how to deal with the "Enemy blew their own shit up, so no cobra for joo!" problem yet?

The cause is identified, anyone got a work around yet?

Domination code should be able to detect whether side mission specific objects are dead or not and allocate the reward regardless... x_sidemissionwinner.sqf seems a good place to start rummaging thumbs-up.gif

Share this post


Link to post
Share on other sites

can anybody help?

I am trying to set it up so you can play as SLA to help stop the us from completing objectives

I have set respawn_east marker but my SLA always spawns at the base surrounded by us troops when they die:-(

I cant find the code to stop this can anybody help? thanks

Share this post


Link to post
Share on other sites

I think it's probably to do with this section of code from x_setupplayer.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if (d_version != "REVIVE") then {

_respawn_marker = (

switch (d_own_side) do {

case "RACS": {"respawn_guerrila"};

case "WEST": {"respawn_west"};

case "EAST": {"respawn_east"};

}

);

_respawn_marker setMarkerPosLocal markerPos "base_spawn_1"; // <----- I think your problem's here

if (d_own_side == "RACS") then {

deleteMarkerLocal "respawn_west";

deleteMarkerLocal "respawn_east";

} else {

if (d_own_side == "WEST") then {

deleteMarkerLocal "respawn_guerrila";

deleteMarkerLocal "respawn_east";

} else {

deleteMarkerLocal "respawn_west";

deleteMarkerLocal "respawn_guerrila";

};

};

};

Domination is setup for one side - all the respawn markers get set to the position of "base_spawn_1" marker in editor.

Replacing the line of code I've highlighted with a switch command for each player side should do it. Not sure what other scripts affect respawn position...

Share this post


Link to post
Share on other sites

How would one go about adding sidewinder or Stinger missiles to the Cobra helicopter?

Share this post


Link to post
Share on other sites

download mando missiles, read the online help and write yourself...

...or just copy this code wink_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// AH1W will have 8 TOW missiles for the gunner (missile idx 0 and 1)

[["AH1W"], 1, "M197", [0,8], [0,8], 0, 0, "mando_missiles\units\mando_missilevehicle2.sqf", true, false, false, false, [4,0,-2], "mando_missiles\units\keysets\mando_guided_tow.sqf", 5, 5, 2, 0, false, 2]execVm"mando_missiles\units\mando_assignvehicle_by_type.sqf";

// AH1W will have 10 flares and 2 Sidewinder missiles for the driver (missile idx 2 and 3)

[["AH1W"], 0, "", [2,0], [2,0], 10, 10, "mando_missiles\units\mando_missilevehicle2.sqf", false, true, false, false, [3,0,-1.5], "mando_missiles\units\keysets\mando_guided_tow.sqf", 5, 5, 2, 2, false, 0]execVm"mando_missiles\units\mando_assignvehicle_by_type.sqf";

don't forget to remove all weapons from the cobra first, or you'll have the normal hellfires as well...but hey, that's not a problem, right? wink_o.gif

You'll also have to have a unit able to reload the thing:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

//provides ammo trucks with ability to reload mando flares and missiles to units (ammo count 15)

[["Truck5tReammo", "UralReammo"], 15]execVM"mando_missiles\units\mando_flaresreloadallow.sqf";

[["Truck5tReammo", "UralReammo"], 15]execVM"mando_missiles\units\mando_missilereloadallow.sqf";

that help?

Share this post


Link to post
Share on other sites

Note that missile idx is an important parameter there, if you only want a pair of Sidewinders and the rest of default BIS weapons is good for you, then:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

// init.sqf

// If you are using the addon, the next line is not needed, else:

// Mando Missile ArmA initialization

[false]execVM"mando_missiles\mando_missileinit.sqf";

// AH1Ws will have 10 flares and 2 Sidewinder missiles for the driver (missile idx 0 and 1, 1 slot is unused)

[["AH1W"], 0, "", [2,0], [2,0], 10, 10, "mando_missiles\units\mando_missilevehicle2.sqf", false, true, false, false, [3,0,-1.5], "mando_missiles\units\keysets\mando_guided_tow.sqf", 5, 5, 2, 0, false, 0]execVm"mando_missiles\units\mando_assignvehicle_by_type.sqf";

mando_assignvehicle_by_type.sqf online help

mando_missileinit.sqf online help

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

×