Jump to content

Recommended Posts

Is it possible to download WarfareBE for Arma 3 already?

I'm ending up the next big release for A3 before porting it to WF for both A2 & A3 (I don't want to do the same work 3 times :))

Btw, how would you guys see handling of the artillery calls? (Free to call by anyone? Player -> Commander Ack/Deny -> Funds reduction?)

The big things that left are:

- Player-to-Player reviving

- The Ack/Deny menu for commander

- The FOB

- The Artillery Menu

Share this post


Link to post
Share on other sites
I'm ending up the next big release for A3 before porting it to WF for both A2 & A3 (I don't want to do the same work 3 times :))

Btw, how would you guys see handling of the artillery calls? (Free to call by anyone? Player -> Commander Ack/Deny -> Funds reduction?)

The big things that left are:

- Player-to-Player reviving

- The Ack/Deny menu for commander

- The FOB

- The Artillery Menu

Arty range set in params please (far, med, short) or some system to restrict the arty range. Maybe up-gradable ammo as before. Then arty only if Commander ACK/Deny. would be my choice.

Would that work if CTI_AI_TEAMS_ENABLED = 0; ,CTI_PLAYERS_GROUPSIZE = 0; and disabledAI = 1; ?

Share this post


Link to post
Share on other sites

I think that disabledAI = 1; will break some scripts. Thought if you can post the RPT with disabledAI = 1; I'll fix those problems :)

Arty range set in params please (far, med, short) or some system to restrict the arty range. Maybe up-gradable ammo as before. Then arty only if Commander ACK/Deny. would be my choice.

Would that work if CTI_AI_TEAMS_ENABLED = 0; ,CTI_PLAYERS_GROUPSIZE = 0; and disabledAI = 1; ?

Share this post


Link to post
Share on other sites

Client rpt = http://pastebin.com/M79TbaKa

Server rpt = http://pastebin.com/DgwVn2SG

The errors are when a player connects and there is a commander and when commander disconnects and rejoins.

Errors also appear if the player tries to use the Map commanding menu or the team menu. ( I just made the UI action = hint "Disabled"; to fix the UI errors though ). example

 case "onMapPressed": {
	hint " MAP COMs Disabled No AI";
};

I also think I remember that if you group players together in the editor then turn on disableai = 1; then when a player disconnects his group players get teleported to the island \ AI default spawn position.

Hope this helps. As I was trying to fix it myself but I'm a dumb ass !!

Also :) Transfer resources returns <Null>AI in list of groups. if player disconnects and reconnects.

PS. if ya send or tell me the fixes ill be happy to test on a dedi for ya.

Edited by BL1P

Share this post


Link to post
Share on other sites

finally found thread :)

Btw, how would you guys see handling of the artillery calls? (Free to call by anyone? Player -> Commander Ack/Deny -> Funds reduction?)

i think free to call by anyone with fund reduction or limited range like "semi close" and maybe "semi medium"

atm in altis i can sit with my arty anywhere in map and shoot every corner of map. in one game i had every city in map contained like 1000 mines. it was fun to drive tank but other then tank no way.

or maybe for arty complex tech tree? or like individual training for squad leader.

Edited by JonXu
hard typos

Share this post


Link to post
Share on other sites

Can't figure it out or maybe I've been over looking a parameter. But the AI doesn't buy vehicles. They have what they start with and that's it. What am I missing here?

Share this post


Link to post
Share on other sites

I was wondering if you was going to setup some build able helo repair/rearm landing pads, or if the current ammo/repair buildings work for this. A place able helo pad would be so much better in my opinion if its even possible.

Share this post


Link to post
Share on other sites

Just a quick question regarding the 2.073.3 A2 BE. I'm having a go at implementing the artillery radar to track any enemy shells, much like the current AAR. I've managed to implement the arty radar model fine as well as the tracking script, but I'm struggling to link the two together. Having taking a closer look at "Common_AARadarMarkerUpdate.sqf" to get a feel for how the AAR works I found what I think is the key to how it works but am unable to trace its source:

while {alive _object && !(isNull _object)} do {
[size=4][b]if (antiAirRadarInRange) then {[/b][/size]
	if (((getPos _object) select 2) > _height) then {
		_markerName setMarkerAlphaLocal 1;
		_markerName setMarkerPosLocal (getPos _object);
	} else {
		_markerName setMarkerAlphaLocal 0;
	};
};

sleep 1;
};

so this script seems to be triggering the air markers based on the "antiairradarinrange" variable (or at least making them visible). However upon searching for this variable elsewhere in the mission file there is only one other reference to it in the "init_client.sqf" file, which simply declares:

"antiAirRadarInRange = false;"

So my question is, at what point does this variable come true for it to trigger the AAR marker script, and how would i adapt this for the arty radar model?

thanks

Edited by Sari

Share this post


Link to post
Share on other sites

I'll have a look thought this requires some late game squad init with global team sync/update. Should be doable still (next version is more disabled-ai friendly with AI param off).

Client rpt = http://pastebin.com/M79TbaKa

Server rpt = http://pastebin.com/DgwVn2SG

The errors are when a player connects and there is a commander and when commander disconnects and rejoins.

Errors also appear if the player tries to use the Map commanding menu or the team menu. ( I just made the UI action = hint "Disabled"; to fix the UI errors though ). example

 case "onMapPressed": {
	hint " MAP COMs Disabled No AI";
};

I also think I remember that if you group players together in the editor then turn on disableai = 1; then when a player disconnects his group players get teleported to the island \ AI default spawn position.

Hope this helps. As I was trying to fix it myself but I'm a dumb ass !!

Also :) Transfer resources returns <Null>AI in list of groups. if player disconnects and reconnects.

PS. if ya send or tell me the fixes ill be happy to test on a dedi for ya.

I'll limit the artillery and remove the artillery computer. Now that we have a command which "may" work i think that we can use it.

finally found thread :)

i think free to call by anyone with fund reduction or limited range like "semi close" and maybe "semi medium"

atm in altis i can sit with my arty anywhere in map and shoot every corner of map. in one game i had every city in map contained like 1000 mines. it was fun to drive tank but other then tank no way.

or maybe for arty complex tech tree? or like individual training for squad leader.

This depends if the commander is AI or human. A human commander has to set the AI roles since they're infantry based by default.

Can't figure it out or maybe I've been over looking a parameter. But the AI doesn't buy vehicles. They have what they start with and that's it. What am I missing here?

I could but I won't. The range is already large enough for the rep/reammo depot & rep/reammo truck.

I was wondering if you was going to setup some build able helo repair/rearm landing pads, or if the current ammo/repair buildings work for this. A place able helo pad would be so much better in my opinion if its even possible.

Have a look in \Client\FSM\updateavailableactions.fsm

if (_antiairradar_enabled) then {
_checks = [sideJoined, missionNamespace getVariable Format ["WFBE_%1AARADARTYPE",sideJoinedText],_buildings] Call GetFactories;
if (count _checks > 0) then {antiAirRadarInRange = true} else {antiAirRadarInRange = false};
};

The script check each x seconds if a structure is in range/available. Make sure that you use the right type that you've defined when you've added the model (like '_v = _v + ["AntiArtyRadar"]')

Just a quick question regarding the 2.073.3 A2 BE. I'm having a go at implementing the artillery radar to track any enemy shells, much like the current AAR. I've managed to implement the arty radar model fine as well as the tracking script, but I'm struggling to link the two together. Having taking a closer look at "Common_AARadarMarkerUpdate.sqf" to get a feel for how the AAR works I found what I think is the key to how it works but am unable to trace its source:

while {alive _object && !(isNull _object)} do {
[size=4][b]if (antiAirRadarInRange) then {[/b][/size]
	if (((getPos _object) select 2) > _height) then {
		_markerName setMarkerAlphaLocal 1;
		_markerName setMarkerPosLocal (getPos _object);
	} else {
		_markerName setMarkerAlphaLocal 0;
	};
};

sleep 1;
};

so this script seems to be triggering the air markers based on the "antiairradarinrange" variable (or at least making them visible). However upon searching for this variable elsewhere in the mission file there is only one other reference to it in the "init_client.sqf" file, which simply declares:

"antiAirRadarInRange = false;"

So my question is, at what point does this variable come true for it to trigger the AAR marker script, and how would i adapt this for the arty radar model?

thanks

Share this post


Link to post
Share on other sites

I love this mod Benny. Thanks. I play whenever I have my free time.

I agree with the comments above about the A3 artillery being overpowered.

Although, I like the artillery computer.

My preferred solution would be to restrict the range to max 1/3 of the map and also introduce an artillery tech tree.

Seems a shame to me to get rid of the Artillery Computer function as a solution.

I think making the investment needed via a tech-tree would be great as being spawn killed for minutes on end to be really

frustrating but the artillery computer is really cool.

Also it would make the scope of your mod even better.

Next and maybe even more importantly, may I request better team-killer kicking please?

Its really bad in Arma3. The"Americas Army" game on Steam handles it well. After 2/3 TK's people are kicked automatically or if they are just badly trolling the team can instigate a vote.

The Arma voting system doesnt seem to be very effective.

People either dont vote or people get kicked for nothing, Extremes.

It is really hard to command while half your team are new players and are only good enough to TK.

Share this post


Link to post
Share on other sites

Have a look in \Client\FSM\updateavailableactions.fsm

The script check each x seconds if a structure is in range/available. Make sure that you use the right type that you've defined when you've added the model (like '_v = _v + ["AntiArtyRadar"]')

Thanks very much benny, seems the file search wasn't picking up text in the .fsm files. It's now working nicely for the grad and mlrs, still trying to figure out how to attach it to the cannons and mortars haha!

Share this post


Link to post
Share on other sites
Can't figure it out or maybe I've been over looking a parameter. But the AI doesn't buy vehicles. They have what they start with and that's it. What am I missing here?

The commander has to tell them to become 'mechanized'. Initially the AI just start in the 'infantry' role and move about the map on foot.

Share this post


Link to post
Share on other sites

Ok im gong to ask in here instead of my thread in the scripting forum as I think there might be more going on in the background than I think. As I said before I'm trying to attach the tracking script to the M119 (for now...). To do this I'm adding the following to server\construction\construction_stationarydefense.sqf

if (_defense isKindof "M119_US_EP1") then {
_defense addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}];
       ["INFORMATION", Format ["eventhandler added to M119", str _side, _type]] Call WFBE_CO_FNC_LogContent;
};

Whilst the above works for grads and mlrs in the common\init\init_unit.sqf, it doesn't work here. However when I place the M119, is does send the message to the log so it is recognising it. I've also tried variations of setvehicleinit to no avail (To be honest I don't really know what I'm doing with setvehicleinit!)

Share this post


Link to post
Share on other sites
I love this mod Benny. Thanks. I play whenever I have my free time.

I agree with the comments above about the A3 artillery being overpowered.

Although, I like the artillery computer.

My preferred solution would be to restrict the range to max 1/3 of the map and also introduce an artillery tech tree.

Seems a shame to me to get rid of the Artillery Computer function as a solution.

I think making the investment needed via a tech-tree would be great as being spawn killed for minutes on end to be really

frustrating but the artillery computer is really cool.

Also it would make the scope of your mod even better.

Next and maybe even more importantly, may I request better team-killer kicking please?

Its really bad in Arma3. The"Americas Army" game on Steam handles it well. After 2/3 TK's people are kicked automatically or if they are just badly trolling the team can instigate a vote.

The Arma voting system doesnt seem to be very effective.

People either dont vote or people get kicked for nothing, Extremes.

It is really hard to command while half your team are new players and are only good enough to TK.

Artillery Comp cannot be altered that easily (like reducing the radius), that's why i'll make my own. There's a prison system for tks :)

Ok im gong to ask in here instead of my thread in the scripting forum as I think there might be more going on in the background than I think. As I said before I'm trying to attach the tracking script to the M119 (for now...). To do this I'm adding the following to server\construction\construction_stationarydefense.sqf

if (_defense isKindof "M119_US_EP1") then {
_defense addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}];
       ["INFORMATION", Format ["eventhandler added to M119", str _side, _type]] Call WFBE_CO_FNC_LogContent;
};

Whilst the above works for grads and mlrs in the common\init\init_unit.sqf, it doesn't work here. However when I place the M119, is does send the message to the log so it is recognising it. I've also tried variations of setvehicleinit to no avail (To be honest I don't really know what I'm doing with setvehicleinit!)

You have to broadcast it if you want a local effect.

The easiest way for A2 is to processInitCommand it. So here's how i'd do it.

1. Create "Common\Init\Init_Static.sqf"

2. In "Construction_StationaryDefense.sqf", check if the defense is kind of artillery with:

_arty_veh = getNumber(configFile >> "CfgVehicles" >> typeOf(_defense) >> "ARTY_IsArtyVehicle");
_arty_scan = getNumber(configFile >> "CfgVehicles" >> typeOf(_defense) >> "artilleryScanner");
if (_arty_veh == 1 || _arty_scan == 1) then { //--- Make sure that the defense is Artillery-compatible (A2 Vanilla/A2 OA)
//--- We initialize the defense (we make it JIP comptabile too)
_defense setVehicleInit format["[_this, %1] execVM 'Common\Init\Init_Defense.sqf'", _sideID];
processInitCommands;
};

3. We edit "Common\Init\Init_Static.sqf"

_defense = _this select 0;
_sideID = _this select 1;

if !(alive _defense) exitWith {}; //--- Abort if the unit is null or dead.

waitUntil {commonInitComplete}; //--- Wait for the common part.

_side = (_sideID) Call GetSideFromID;

if !(local player) exitWith {}; //--- We don't need the server to process it.

waitUntil {clientInitComplete}; //--- Wait for the client part.

//--- Do script specific here 

Share this post


Link to post
Share on other sites

Come on Benny the full release is out and your mission isn't ?? :)

I blame BIS for not adding your mission as a built in mission for Arma3 !!!!!!!

On a serious note though in your BECTI_0.9 there is a system in I believe the Server\FSM\Town_Resistance.fsm which removes the resistance AI if the town is held by a none resistance force for more than a specified time period.

How would you go about removing that timeout if you wanted the AI to retake the town if there is still only 1 AI left in town and opposing forces to resistance have left the area ?

Would this work ?

_town setVariable ["cti_town_resistance_activeTime", -99999];

Edited by BL1P

Share this post


Link to post
Share on other sites

@Benny me and a guy wrote a set of skill levels for created AI that uses random amounts as well as a base amount.

And a possibility to set a modifier for each skill in the AIs skill tree. all tied into a param.

which replaces your _unit setSkill 0.7;//tbd tweak from Common\Functions\Common_CreatUnit.sqf

Here it is if you want to use it feel free mon ami no credits required or needed :)

In Common\Init\Init_CommonConstants.sqf

if (isNil 'AI_SKILL') then {AI_SKILL = 1};

In Rsc\Parameters.hpp

class AI_SKILL {
	title = "Created AI skill settings";
	values[] = {0,1,2,3,4};
	texts[] = {"0.05 -- Easy","0.1 -- Normal","0.2 -- Above Average","0.3 -- Hard","0.5 -- Hackng Bastards"};
	default = 1;
};

Common\Functions\Common_CreateUnit.sqf

Private ["_net", "_position", "_sideID", "_special", "_team", "_type", "_unit", "_skillz"];

_classname = _this select 0;
_team = _this select 1;
_position = _this select 2;
_sideID = _this select 3;//tbd
_net = if (count _this > 4) then {_this select 4} else {false};
_special = if (count _this > 5) then {_this select 5} else {"FORM"};

if (typeName _position == "OBJECT") then {_position = getPos _position};
if (typeName _sideID == "SIDE") then {_sideID = (_sideID) Call CTI_CO_FNC_GetSideID};

_unit = _team createUnit [_classname, _position, [], 0, _special];

//---( bl1p ) Randomised skill settings by Fluit and BL1P
_SkillLevel = missionNamespace getVariable "AI_SKILL";

_skill = 0;
_commanding = 0;
_general = 0;

// Calculate the random skill level
_randomskill = (random(20) / 100); 

// Calculate the skill level
if (_classname == "I_Sniper_F") then {
_skill = ((0.4) + _randomskill);
_commanding = _skill;
_general = _skill;
} else {
switch (_SkillLevel) do {
	case 0: {
		_skill = ((0.05) + _randomskill);
		_commanding = 0.2;
		_general = 0.2;
	};
	case 1: {
		_skill = ((0.1) + _randomskill);
		_commanding = 0.3;
		_general = 0.3;
	};
	case 2: {
		_skill = ((0.2) + _randomskill);
		_commanding = 0.4;
		_general = 0.4;
	};
	case 3: {
		_skill = ((0.3) + _randomskill);
		_commanding = 0.5;
		_general = 0.5;
	};
	case 4: {
		_skill = ((0.4) + _randomskill);
		_commanding = 0.6;
		_general = 0.6;
	};
};
};

// Skill can't be greater than 1
if (_skill > 1) then {
_skill = 1;
};

// Skill must be at least 0.05
if (_skill < 0.05) then {
_skill = 0.05;
};

// Set how the skill is affecting each skill type. Default is 100%.
// example: skill = 0.3
_aimingAccuracyLevel 	= _skill * 1.0;
_aimingShakeLevel 		= _skill * 1.0;
_aimingSpeedLevel 		= _skill * 1.0;
_spotDistanceLevel 		= _skill * 1.5; // 0.45
_spotTimeLevel 			= _skill * 1.0;
_courageLevel 			= _skill * 1.0;
_enduranceLevel 		= _skill * 1.0;
_reloadspeedLevel 		= _skill * 1.0;

// Validate the skills
if (_aimingAccuracyLevel > 1)	then { _aimingAccuracyLevel = 1; };
if (_aimingShakeLevel > 1) 		then { _aimingShakeLevel = 1; };
if (_aimingSpeedLevel > 1) 		then { _aimingSpeedLevel = 1; };
if (_spotDistanceLevel > 1) 	then { _spotDistanceLevel = 1; };
if (_spotTimeLevel > 1) 		then { _spotTimeLevel = 1; };
if (_courageLevel > 1) 			then { _courageLevel = 1; };
if (_enduranceLevel > 1) 		then { _enduranceLevel = 1; };
if (_reloadspeedLevel > 1) 		then { _reloadspeedLevel = 1; };

// Set the skills
_unit setSkill ["commanding",(_commanding)];
_unit setSkill ["general",(_general)];
_unit setSkill ["aimingAccuracy",(_aimingAccuracyLevel)];
_unit setSkill ["aimingShake",(_aimingShakeLevel)];
_unit setSkill ["aimingSpeed",(_aimingSpeedLevel)];
_unit setSkill ["spotDistance",(_spotDistanceLevel)];
_unit setSkill ["spotTime",(_spotTimeLevel)];
_unit setSkill ["courage",(_courageLevel)];
_unit setSkill ["endurance",(_enduranceLevel)];
_unit setSkill ["reloadspeed",(_reloadspeedLevel)];

diag_log format ["Group unit %1 classname %4 on skill %2 : IndividSkillz @ %3 - Commanding @ %5 - Gerneral @ %6 -Randomskill %7",_unit,_SkillLevel,_skill,_classname,_commanding,_general,_randomskill];

if (_net) then {_unit setVariable ["cti_net", _sideID, true]};

//--- Add a Killed EH.
// _unit addEventHandler ["killed", Format["[_this select 0, _this select 1, %1, 'vehicle'] Spawn WFBE_CO_FNC_OnUnitKilled;", _sideID]];

_unit

I must point out it was not this neat before FLUIT got on the job :)

Edited by BL1P

Share this post


Link to post
Share on other sites
Come on Benny the full release is out and your mission isn't ?? :)

I blame BIS for not adding your mission as a built in mission for Arma3 !!!!!!!

On a serious note though in your BECTI_0.9 there is a system in I believe the Server\FSM\Town_Resistance.fsm which removes the resistance AI if the town is held by a none resistance force for more than a specified time period.

How would you go about removing that timeout if you wanted the AI to retake the town if there is still only 1 AI left in town and opposing forces to resistance have left the area ?

Would this work ?

_town setVariable ["cti_town_resistance_activeTime", -99999];

Hehe, there's soooo much content that I don't know where to look at (not) :)

"If" I get your question, you want to remove the current force of a town when there is no enemy in it?

If so look for CTI_RESISTANCE_INACTIVE_MAX (this determine how long a town may remain active until that the current defending forces are cleaned up)

Can you repair HQ's yet?

Yes it's ready for next version.

@Benny me and a guy wrote a set of skill levels for created AI that uses random amounts as well as a base amount.

And a possibility to set a modifier for each skill in the AIs skill tree. all tied into a param.

which replaces your _unit setSkill 0.7;//tbd tweak from Common\Functions\Common_CreatUnit.sqf

Here it is if you want to use it feel free mon ami no credits required or needed :)

In Common\Init\Init_CommonConstants.sqf

if (isNil 'AI_SKILL') then {AI_SKILL = 1};

In Rsc\Parameters.hpp

class AI_SKILL {
	title = "Created AI skill settings";
	values[] = {0,1,2,3,4};
	texts[] = {"0.05 -- Easy","0.1 -- Normal","0.2 -- Above Average","0.3 -- Hard","0.5 -- Hackng Bastards"};
	default = 1;
};

Common\Functions\Common_CreateUnit.sqf

Private ["_net", "_position", "_sideID", "_special", "_team", "_type", "_unit", "_skillz"];

_classname = _this select 0;
_team = _this select 1;
_position = _this select 2;
_sideID = _this select 3;//tbd
_net = if (count _this > 4) then {_this select 4} else {false};
_special = if (count _this > 5) then {_this select 5} else {"FORM"};

if (typeName _position == "OBJECT") then {_position = getPos _position};
if (typeName _sideID == "SIDE") then {_sideID = (_sideID) Call CTI_CO_FNC_GetSideID};

_unit = _team createUnit [_classname, _position, [], 0, _special];

//---( bl1p ) Randomised skill settings by Fluit and BL1P
_SkillLevel = missionNamespace getVariable "AI_SKILL";

_skill = 0;
_commanding = 0;
_general = 0;

// Calculate the random skill level
_randomskill = (random(20) / 100); 

// Calculate the skill level
if (_classname == "I_Sniper_F") then {
_skill = ((0.4) + _randomskill);
_commanding = _skill;
_general = _skill;
} else {
switch (_SkillLevel) do {
	case 0: {
		_skill = ((0.05) + _randomskill);
		_commanding = 0.2;
		_general = 0.2;
	};
	case 1: {
		_skill = ((0.1) + _randomskill);
		_commanding = 0.3;
		_general = 0.3;
	};
	case 2: {
		_skill = ((0.2) + _randomskill);
		_commanding = 0.4;
		_general = 0.4;
	};
	case 3: {
		_skill = ((0.3) + _randomskill);
		_commanding = 0.5;
		_general = 0.5;
	};
	case 4: {
		_skill = ((0.4) + _randomskill);
		_commanding = 0.6;
		_general = 0.6;
	};
};
};

// Skill can't be greater than 1
if (_skill > 1) then {
_skill = 1;
};

// Skill must be at least 0.05
if (_skill < 0.05) then {
_skill = 0.05;
};

// Set how the skill is affecting each skill type. Default is 100%.
// example: skill = 0.3
_aimingAccuracyLevel 	= _skill * 1.0;
_aimingShakeLevel 		= _skill * 1.0;
_aimingSpeedLevel 		= _skill * 1.0;
_spotDistanceLevel 		= _skill * 1.5; // 0.45
_spotTimeLevel 			= _skill * 1.0;
_courageLevel 			= _skill * 1.0;
_enduranceLevel 		= _skill * 1.0;
_reloadspeedLevel 		= _skill * 1.0;

// Validate the skills
if (_aimingAccuracyLevel > 1)	then { _aimingAccuracyLevel = 1; };
if (_aimingShakeLevel > 1) 		then { _aimingShakeLevel = 1; };
if (_aimingSpeedLevel > 1) 		then { _aimingSpeedLevel = 1; };
if (_spotDistanceLevel > 1) 	then { _spotDistanceLevel = 1; };
if (_spotTimeLevel > 1) 		then { _spotTimeLevel = 1; };
if (_courageLevel > 1) 			then { _courageLevel = 1; };
if (_enduranceLevel > 1) 		then { _enduranceLevel = 1; };
if (_reloadspeedLevel > 1) 		then { _reloadspeedLevel = 1; };

// Set the skills
_unit setSkill ["commanding",(_commanding)];
_unit setSkill ["general",(_general)];
_unit setSkill ["aimingAccuracy",(_aimingAccuracyLevel)];
_unit setSkill ["aimingShake",(_aimingShakeLevel)];
_unit setSkill ["aimingSpeed",(_aimingSpeedLevel)];
_unit setSkill ["spotDistance",(_spotDistanceLevel)];
_unit setSkill ["spotTime",(_spotTimeLevel)];
_unit setSkill ["courage",(_courageLevel)];
_unit setSkill ["endurance",(_enduranceLevel)];
_unit setSkill ["reloadspeed",(_reloadspeedLevel)];

diag_log format ["Group unit %1 classname %4 on skill %2 : IndividSkillz @ %3 - Commanding @ %5 - Gerneral @ %6 -Randomskill %7",_unit,_SkillLevel,_skill,_classname,_commanding,_general,_randomskill];

if (_net) then {_unit setVariable ["cti_net", _sideID, true]};

//--- Add a Killed EH.
// _unit addEventHandler ["killed", Format["[_this select 0, _this select 1, %1, 'vehicle'] Spawn WFBE_CO_FNC_OnUnitKilled;", _sideID]];

_unit

I must point out it was not this neat before FLUIT got on the job :)

Ty, i'll have a look :)

Did BIS add Warfare Buildings in Arma 3 now that it's out?

There's just as much warfare buildings as there is furnitures

Share this post


Link to post
Share on other sites

You have to broadcast it if you want a local effect.

The easiest way for A2 is to processInitCommand it. So here's how i'd do it.

1. Create "Common\Init\Init_Static.sqf"

2. In "Construction_StationaryDefense.sqf", check if the defense is kind of artillery with:

3. We edit "Common\Init\Init_Static.sqf"

Well thanks very much again Benny. I do seem to be rather in over my head here but I'm down to my last problem on this one. Up until now I have been marking friendly artillery as its much easier to test, however I'm now trying to get it to mark enemy artillery (once again, much like the AAR). I thought it would be a simple case of adding the highlighted into the init_unit.sqf/construction_stationarydefense.sqf:

_isVeh = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "ARTY_IsArtyVehicle");
_isAC = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "artilleryScanner");

if (_isVeh == 1 || _isAC == 1) then {//--- MLRS, StrykerMC and GRAD radar Tracking
       if ((missionNamespace getVariable "WFBE_C_STRUCTURES_ARTILLERYRADAR") > 0) then {
	[size=4][b]if (sideJoined != _side) then {[/b][/size]
		[_unit, _side] ExecVM 'Common\Init\Init_Static.sqf'; 
		//_unit addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}] (this was the original way i ran the Grad and MLRS, both ways seem to work fine)
	[b]};[/b]
};
};

After much testing it seems that (sideJoined != _side) isn't agreeing with addeventhandler and I have no idea why. It will run the Init_static.sqf but then it still wont add the eventhandler to the enemy arty. Yet if I remove the (sideJoined != _side) then everything works flawlessly for friendly arty. Like i said I think I'm in a bit too deep here but its frustratingly close to being finished!

Edit: Ive also tried variations of [_unit,_side] addeventhandler etc. to no avail.

Share this post


Link to post
Share on other sites

Afaik, if you use the init_unit.sqf watch for the:

if (sideJoined != _side) exitWith {}; // 071

or

if (sideID != _sideID) exitWith {}; //073

Those mean that only the side of the initialized unit may process the rest of the information.

Well thanks very much again Benny. I do seem to be rather in over my head here but I'm down to my last problem on this one. Up until now I have been marking friendly artillery as its much easier to test, however I'm now trying to get it to mark enemy artillery (once again, much like the AAR). I thought it would be a simple case of adding the highlighted into the init_unit.sqf/construction_stationarydefense.sqf:

_isVeh = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "ARTY_IsArtyVehicle");
_isAC = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "artilleryScanner");

if (_isVeh == 1 || _isAC == 1) then {//--- MLRS, StrykerMC and GRAD radar Tracking
       if ((missionNamespace getVariable "WFBE_C_STRUCTURES_ARTILLERYRADAR") > 0) then {
	[size=4][b]if (sideJoined != _side) then {[/b][/size]
		[_unit, _side] ExecVM 'Common\Init\Init_Static.sqf'; 
		//_unit addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}] (this was the original way i ran the Grad and MLRS, both ways seem to work fine)
	[b]};[/b]
};
};

After much testing it seems that (sideJoined != _side) isn't agreeing with addeventhandler and I have no idea why. It will run the Init_static.sqf but then it still wont add the eventhandler to the enemy arty. Yet if I remove the (sideJoined != _side) then everything works flawlessly for friendly arty. Like i said I think I'm in a bit too deep here but its frustratingly close to being finished!

Edit: Ive also tried variations of [_unit,_side] addeventhandler etc. to no avail.

Share this post


Link to post
Share on other sites
Hehe, there's soooo much content that I don't know where to look at (not) :)

"If" I get your question, you want to remove the current force of a town when there is no enemy in it?

If so look for CTI_RESISTANCE_INACTIVE_MAX (this determine how long a town may remain active until that the current defending forces are cleaned up)

No My Question was I want to stop resistance being deleted when a town is Held by OPFOR or BLUFOR for the timeout period.

At the moment BLUFOR team can take a town whilst there are still resistance in the town or on the outskirts. Then when time > -1000 the resistance get deleted. I would like to stop the deletion.

Share this post


Link to post
Share on other sites
No My Question was I want to stop resistance being deleted when a town is Held by OPFOR or BLUFOR for the timeout period.

At the moment BLUFOR team can take a town whilst there are still resistance in the town or on the outskirts. Then when time > -1000 the resistance get deleted. I would like to stop the deletion.

Aaaaah I understand what you meant now :)

Well nothing complex (I even added it for next version for resistance & occupation).

If you can't wait for it here's how to proceed (untested as i'm at work but it shall work):

1. Open "Server\FSM\town_resistance.fsm" with FSM Editor (or notepad if you feel like a warrior) and locate the rectangle box called "Resistance Timeout?"

2. Paste this magic code in it:

//--- Resistance is Active...
if (_sideID != CTI_RESISTANCE_ID) then { //--- ....yet the current side holding the town is not the resistance
//--- Do we still have some fighting units?
_lives = 0;
{_lives = _lives + count(_x call CTI_CO_FNC_GetLiveUnits)} forEach _town_teams;

if (_lives >= CTI_RESISTANCE_MIN_ACTIVE) then { //--- There's still some units fighting! it's not that inactive!
	_town setVariable ["cti_town_resistance_activeTime", time];
};
};

This box is processed as long as the town is active, so the goal here is to increase the lifespan of our current units as long as the town is not recaptured!

Let's detail it a bit:

- The side ID has to be different from the resistance side ID otherwise we don't need to go any further

- For each spawned group which is contained in _town_teams I get the living units out of them and add their amount into _lives.

- If the living spawned units count (_lives) is greater or equal than the minimum number of friendly living units (CTI_RESISTANCE_MIN_ACTIVE) defined for a town to be active then we consider the town to be still "active"

3. Define CTI_RESISTANCE_MIN_ACTIVE in "Common\Init\Init_CommonConstants.sqf" (1 by default here)

Note that it checks for the living units, not their distance.

Share this post


Link to post
Share on other sites
Afaik, if you use the init_unit.sqf watch for the:

if (sideJoined != _side) exitWith {}; // 071

or

if (sideID != _sideID) exitWith {}; //073

Those mean that only the side of the initialized unit may process the rest of the information.

That part doesn't seem to be the problem, it just doesn't like eventhandlers for some reason (:(). Here's what I'm doing in more depth:

Extract from init_unit.sqf :

_isVeh = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "ARTY_IsArtyVehicle");
_isAC = getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "artilleryScanner");

if (_isVeh == 1 || _isAC == 1) then {  //--- MLRS, StrykerMC and GRAD radar Tracking
if ((missionNamespace getVariable "WFBE_C_STRUCTURES_ARTILLERYRADAR") > 0) then {
	if (sideJoined != _side) then {
		[_unit, _side] ExecVM 'Common\Init\Init_Static.sqf'; 
           //_unit addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}]
	};
};
};

Init_static.sqf:

_defense = _this select 0;
_sideID = _this select 1;

waitUntil {commonInitComplete}; //--- Wait for the common part.
_side = (_sideID) Call GetSideFromID;
if !(local player) exitWith {}; //--- We don't need the server to process it.
waitUntil {clientInitComplete}; //--- Wait for the client part.

_defense addEventHandler ["Fired", {_this execVM "Common\Common_ArtyRadarMarkerUpdate.sqf"}];

["INFORMATION", Format ["Part one Working"]] Call WFBE_CO_FNC_LogContent;

By adding the log function and using two clients i can tell that everything bar the addeventhandler line is working upto this point. By testing with 2 clients and purchasing a GRAD/MLRS on client #1 it will make the appropriate log entry on client #2 only. (note, I removed your line "if !(alive _defense) exitWith {};" as it was throwing up log errors and I figured that a fired eventhandler would need the unit to be alive in the first place to be able to fire :p)

ArtyRadarMarkerUpdate.sqf:

Private ["_marker","_markername","_projectile"];

["INFORMATION", Format ["Part Two working"]] Call WFBE_CO_FNC_LogContent;

_projectile = _this select 6;

_markerName = format["shmarker_%1", _projectile ];
_marker = createMarkerlocal[_markerName,(getPos _projectile)];
_marker setMarkerShapelocal "ICON";
_marker setMarkerTypelocal "DOT";
_marker setMarkerAlphaLocal 0;

while {alive _projectile} do {
//if (ArtilleryRadarInRange) then {
	_marker setMarkerAlphalocal 1;
	_marker setMarkerPoslocal (getPos _projectile);
//} else {
//	_marker setMarkerAlphaLocal 0;
//};
sleep 0.05;
};

deleteMarker _marker;

Here I can tell that the eventhandler is not working as neither client nor the server will show the second log entry that I added at the top here. (Note I've disabled the radar in range check as I know that part works and not having to build a radar each time does speed things up, even with debug on!)

Like I said before, if I remove the sidejoined !=side part then everything works perfectly but it will only mark friendly shells and not enemy ones

Edited by Sari

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

×