Jump to content
Sign in to follow this  
jimos

Warfare income script

Recommended Posts

Hey all, i am trying to slightly alter a warfare mission, but i was wondering if anyone knows where to find the script used for income, bascially we dont think the income is high enough and would like to change it. Or we would like to reduce the time rate the income is recieved.

Share this post


Link to post
Share on other sites

What mission, what script ? Huh ? If you want help from the community mate, please provide much more information. Better still post in the thread the mission actually comes from.

Share this post


Link to post
Share on other sites

A version of bennys warfare. we are trying to find the script that dictates the amount of income per min or the script for changing the income tick.

In the server SWF files i have found this.

_ncycle = time + _delay;

_west_values = 0;

_east_values = 0;

{

//--- Is the town occupied and not hostile?

_side = (_x getVariable "cti_town_sideID") call CTI_CO_FNC_GetSideFromID;

_value = _x getVariable "cti_town_value";

if (_side != resistance) then { //--- Don't bother with resistance for now

_near = _x nearEntities ["AllVehicles", CTI_MARKERS_TOWN_AREA_RANGE];

if (_side countSide _near > 0) then { //--- The town is occupied by friendlies, but what about enemies?

_hostiles = 0;

{_hostiles = _hostiles + (_x countSide _near)} forEach ([west, east, resistance] - [_side]);

if (_hostiles > 0) then { _value = _value * CTI_TOWNS_UNOCCUPIED_PERCENTAGE }; //--- Hostiles in range, not that occupied heh?

} else { //--- Unoccupied

_value = _value * CTI_TOWNS_UNOCCUPIED_PERCENTAGE;

};

switch (_side) do {

case east: { _east_values = _east_values + _value };

case west: { _west_values = _west_values + _value };

};

};

} forEach CTI_Towns;

{

_side = _x select 0;

_total_values = _x select 1;

_logic = (_side) call CTI_CO_FNC_GetSideLogic;

_commander = _logic getVariable "cti_commander";

_side_units = (_side) call CTI_CO_FNC_GetSideGroups;

_total_players = count (_side_units - [_commander]);

//--- First we deal with the award pool

_percent_award = _logic getVariable "cti_pool_award";

_percent_resources = _logic getVariable "cti_pool_resources";

_pool_award = _total_values * _percent_award; //--- The award pool

//_pool_award = 1750 * 0.1 = 175

_pool_income_total = _total_values - _pool_award; //--- The resources pool overall

//_pool_income_total = 1750 - 175 = 1575

_pool_income_players = _pool_income_total * _percent_resources; //--- The resources pool for the players

//_pool_income_players = 1575 * 0.3 = 472.5

_pool_income_commander = round(_pool_income_total - _pool_income_players);

//_pool_income_commander = 1575 - 472.5 = 1102.5

// _side_players = (_side) call CTI_CO_FNC_GetSidePlayerGroups;

//--- Calculate the total score (minus the commander)

//TODO: Current award to all, commander toggle button (award players / award all (ai))

_total_score = (_side_units - [_commander]) call CTI_CO_FNC_GetUnitsScore;

if (_total_score < 1) then {_total_score = count _side_units};

//--- Calculate the income per player from the resources pool

if (_total_players > 0) then {

_pool_income_player = round(_pool_income_players / _total_players);

//_pool_income_player = 472.5 / 4 = 118

//--- Award units aside from commander

{

//--- This is the award pool

_score = score leader _x;

_value = round((_score / _total_score) * _pool_award);

//--- This is the resources pool

_value = _value + _pool_income_player;

if (_value > 0) then { [_x, _side, _value] call CTI_CO_FNC_ChangeGroupFunds };

} forEach (_side_units - [_commander]);

} else {

_pool_income_commander = _pool_income_commander + _pool_income_players;

};

//TODO: commander income set

if (_pool_income_commander != 0) then { _logic setVariable ["cti_commander_funds", (_logic getVariable "cti_commander_funds") + _pool_income_commander, true] };

} forEach [[west, _west_values], [east, _east_values]];

But i dont know what numbers to change to make the income higher i dont want to break it obviously

Edited by jimos

Share this post


Link to post
Share on other sites

Krem is correct, post in the Arma2 Users Missions 'Bennys Warfare' he talks of his Arma3 version there and he is very helpful :cool:

i'm pretty sure (i assume is Arma3 version) that it is not in this script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×