Jump to content
Ronin[NR]

The new Sector Module

Recommended Posts

Hello!! I have a problem with the sector module. It triggers the reward once the mission startrs without a change in ownership.

I have place a "Sector module" on editor map. I synced the sides that will compete for the sector. After that i synced the "sector" to an area logic and i placed an empty trigger that functions as area, and synced it with area logic.

Then i placed on the expression on Sector my script that is to run. It supposed to get triggered upon ownership change. The problem is that it triggers automatically once as i start the mission. After that it works properly and triggered upon ownership change.

What i am doing wrong?

Regards

Seed

Share this post


Link to post
Share on other sites

The sector fires off at mission start passing sideUnknown as the current owner. Your not doing anything wrong, just the way it is and could most likely do with changing. Maybe start a ticket up for it.

Just check for sideUnknown before running your script. e.g

if !(_this select 1 isequalto sideunknown) then {
    //run your script here
};

Share this post


Link to post
Share on other sites

Thank you again Larrow. You just solved one of my bigger problems. One last question. How can i activate Sector in sequence. For example in order to capture Sector B you need to unlock it by capturing Sector A first etc. The reason of asking because i am connecting the Sector capture module with some mini-missions series and upon completion each task you are getting rewarded based on which owns the sector.

Regards

Seed

Edited by Seed

Share this post


Link to post
Share on other sites

Does the Modules only work in Stratis, If i run in on Altis map, the icons don`t appear on the right of the screen...... But i can still capture bases (window pops up saying BLUFOR have captured )

Thank you

 

**EDIT**   Had to add a OPFOR player to map before they would show

Share this post


Link to post
Share on other sites

  • ok after about 3 weeks of google searches, reading and so on... I cannot figure out a way to get sector modules to work on a dedi server. Everything else in my scripts works fine. Units spawn and well look for uncreated sectors so its all caotic. Kinda funny they spawn basically right on top each other and fight.

I guess my question is..... Drum roll please. Does the sector module work on a dedi server at all and if so what do I need to do. Here is a snippet of code This is probably edit number 50. So you will see strange things in this code. lol My 1st one worked great in sp and lan. anyways here is my code:

 

waitUntil {time > 9};

//if !(isServer) exitWith {};

//hint "Sector";

_location = [];

_mark = [];

_logic = [];

//if (isServer) then {

private ["_Loc","_side","_NearLoc","_owner","_pos"];

_Loc = _this select 0;

_side = _this select 1;

_NearLoc = _this select 2;

_owner = switch _side do {

case EAST: {"0"};

case WEST: {"1"};

case Resistance: {"2"};

case Civilian: {"3"};

case sideLOGIC: {"-1"};

default {"-1"};

};

//_localcount = _this select 3;

//_yes = _this select 3;

_pos = getPos _Loc;

hint format ["Locations:P %1",_NearLoc];

sleep 2;

//if (_yes == "true") then {

//_location = createLocation ["Strategic",_pos , 25, 25];

//_location setText "Staging area";

//_NearLoc pushBack _location;

//};

_NearLoc = [_NearLoc,[],{_pos distance _x},"ASCEND"] call BIS_fnc_sortBy;

//_Lcount = 0;

BL_ALL_Secs = missionnamespace getvariable ["BIS_fnc_moduleSector_sectors",[]];

{

_logic = [];

_logicB = [];

_logicO = [];

_logicR = [];

_logicArea = [];

_trg = [];

_trigger = [];

if (isServer) then {

_ALL_Secs = if (count BL_ALL_Secs > 0) then {

missionnamespace getvariable ["BIS_fnc_moduleSector_sectors",[]];

} else {[]};

//hint str _ALL_Secs;

//_Lcount = _Lcount + 1;

//if ( _localcount >= _Lcount) then {

private ["_loca","_ALL_Secs","_type","_logic"];

_loca = _x;

_Sec_check = if (count _ALL_Secs>0) then {{getPos _x distance _loca < 150}count _ALL_Secs == 0} else {true};

//hint str ({getPos _x distance _loca < 100}count _ALL_Secs);

if (_Sec_check) then {

//sleep 1;

_type = type _loca;

_name = text nearestLocation [position _loca, _type];

if (_name == "") then {_name = _type};

//hint str _name;

//_unitL = [(configFile >> "CfgVehicles" >> _type)]call BIS_fnc_returnConfigEntry;

//hint str _unitL;

/*_mark = format ["%2_%1", _Lcount,_type];

_mark = createMarker [_mark,position _x];

_mark setMarkerShape "ICON";

_mark setMarkerType "Empty";//"hd_flag";

//_mark setMarkerText str _mark;*/

//_pos = getPos _loca;

_pos = _loca call BIS_fnc_position;

//hint str _pos;

if (surfaceIsWater _pos) then {

_pos = [_pos, 1, 350, 3, 0, 20, 0] call BIS_fnc_findSafePos;

} else {_pos = [_pos, 1, 50, 3, 0, 20, 0] call BIS_fnc_findSafePos;};

_logic = (createGroup sideLogic) createUnit ["ModuleSector_F",_pos,[],0,"NONE"];

_logicB = (createGroup sideLogic) createUnit ["SideBLUFOR_F",_pos,[],0,"NONE"];

_logic synchronizeObjectsAdd [_logicB];

_logicO = (createGroup sideLogic) createUnit ["SideOPFOR_F",_pos,[],0,"NONE"];

_logic synchronizeObjectsAdd [_logicO];

_logicR = (createGroup sideLogic) createUnit ["SideResistance_F",_pos,[],0,"NONE"];

_logic synchronizeObjectsAdd [_logicR];

_logicArea = (createGroup sideLogic) createUnit ["LocationArea_F",_pos,[],0,"NONE"];

_logic synchronizeObjectsAdd [_logicArea];

_trg = createTrigger ["EmptyDetector", _pos];

_trg setTriggerArea [150, 150, 0, false];

_trg setTriggerActivation ["LOGIC", "PRESENT", true];

_trg setTriggerStatements ["this", "hint 'LOGIC is present'", "hint 'no LOGIC present'"];

_logicArea synchronizeObjectsAdd [_trg];

_trigger = createTrigger ["EmptyDetector", _pos];

_trigger setTriggerArea [150, 150, 0, false];

_trigger setTriggerActivation ["LOGIC", "PRESENT", true];

_trigger setTriggerStatements ["this", "hint 'LOGIC is present'", "hint 'no LOGIC present'"];

_trigger setTriggerTimeout [1, 1, 1, false];

_logic synchronizeObjectsAdd [_trigger];

//_activated = [_logic,2,true,[true]] call bis_fnc_param;

//Default setting, which are optional

_logic setVariable ["CostAir","2",true];

_logic setVariable ["CostInfantry","1",true];

_logic setVariable ["CostPlayers","2",true];

_logic setVariable ["CostTracked","4",true];

_logic setVariable ["CostWater","0",true];

_logic setVariable ["CostWheeled","2",true];

_logic setVariable ["DefaultOwner",_owner,true];

_logic setVariable ["Designation","",true];

_logic setvariable ["name",_name,true];

_logic setVariable ["OnOwnerChange","",true];

_logic setVariable ["OwnerLimit","0",true];

_logic setVariable ["ScoreReward","0",true];

//_logic setVariable ["TaskDescription","",true];

//_logic setVariable ["TaskOwner","",true];

//_logic setVariable ["TaskTitle",_name,true];

//hint format ["whatreally : %1 Mode : %2",_logic getVariable "finalized",_logic];

if (isDedicated) then {[ _logic, _side, true, _logic ] call BIS_fnc_moduleSector;};

_NearLoc = _NearLoc - [_x];

missionNamespace setVariable ["BL_all_Locations",_NearLoc,true];

};

};

} forEach _NearLoc;

 

ok Figured it out it was the way I was starting it up. Now gotta get it were only server spawns sectors and units and all will be right with the world!

Edited by mikey74

Share this post


Link to post
Share on other sites

I see you have it sorted now, anyway here is some code i was testing trying to work out what you were trying to do. Basically was just using it in the initServer.sqf to spawn sectors on Stratis. Maybe a few snippets you can take from it like default logic grp, BIS_fnc_sideID for side number and bis_fnc_init for timing when the mission is loaded and ready.

mapRadius = getNumber( configFile >> "CfgWorlds" >> worldName >> "mapSize" ) / 2;
locs = nearestLocations [ [ mapRadius, mapRadius ], [ "NameVillage", "NameCity", "NameCityCapital" ], mapRadius ];

h = [ [ mapRadius, mapRadius ], east, locs ] spawn {

	private ["_pos","_owner","_nearLoc","_loca","_ALL_Secs"];

	if !( isServer ) exitWith {};

	waitUntil { !isNil "bis_fnc_init" && { bis_fnc_init } };

	params[
		"_loc",
		[ "_side", sideUnknown, [ sideUnknown ] ],
		[ "_nearLoc", [], [ [] ] ]
	];

	_pos = _loc;
	_owner = _side call BIS_fnc_sideID;

	_nearLoc = [_nearLoc,[_pos],{_input0 distance _x},"ASCEND"] call BIS_fnc_sortBy;

	{
		_loca = _x;

		_ALL_Secs = missionNamespace getVariable ["BIS_fnc_moduleSector_sectors",[]];

		if ({getPos _x distance _loca < 150}count _ALL_Secs == 0) then {

			_type = type _loca;
			_name = text _loca;

			if (_name == "") then {_name = _type};

			_pos = _loca call BIS_fnc_position;


			if (surfaceIsWater _pos) then {
				_pos = [_pos, 1, 350, 3, 0, 20, 0] call BIS_fnc_findSafePos;
			} else {
				_pos = [_pos, 1, 50, 3, 0, 20, 0] call BIS_fnc_findSafePos;
			};

			_logic = group bis_functions_mainscope createUnit ["ModuleSector_F",_pos,[],0,"NONE"];

			_logic setVariable ["CostAir","2"];
			_logic setVariable ["CostInfantry","1"];
			_logic setVariable ["CostPlayers","2"];
			_logic setVariable ["CostTracked","4"];
			_logic setVariable ["CostWater","0"];
			_logic setVariable ["CostWheeled","2"];
			_logic setVariable ["DefaultOwner",_owner];
			_logic setVariable ["Designation",format[ "%1", _forEachIndex ]];
			_logic setVariable ["Name",_name];
			_logic setVariable ["OnOwnerChange",""];
			_logic setVariable ["OwnerLimit","0"];
			_logic setVariable ["ScoreReward","0"];
			_logic setVariable ["sides",[ east, west, independent ]];

			waitUntil {
				!isNil { _logic getVariable [ "finalized", nil ] } &&
				{ !( _logic getVariable [ "finalized", true ] ) }
			};

			_trgSize = 150;
			_logic setVariable [ "size", _trgSize ];
			[ _logic, [], true, "area" ] call BIS_fnc_moduleSector;

			_trg = ( _logic getVariable "areas" ) select 0;
			_mrk = ( _trg getVariable "markers" ) select 0;
			_mrk setMarkerSize [ _trgSize, _trgSize ];

		};

	} forEach _nearLoc;
};
  • Like 1

Share this post


Link to post
Share on other sites

Thanks Larrow. :)

 

You've been a big help on this thread and others. I'm actually making a new mod. I have mod made, but am currently just testing scripts in mission without mod. Then when that works I'll put scripts back into mod and release. Its getting close. Me and Dedi's really don't mix, but it seems the ones that like my mods want them to work on Dedi. So with this one I'm trying to let it sink it. Still have a long way to go. lol Anyways.

 

What this mod will do. You will have 3 modules. 1 for init sector, 1 for base of each groups, and a location mod where you create your own location on the map. The modules init and base are basically the same except init will call the init script. They take into account side and radius of init and base module. They will search for locations within there respective radius. If 1 or more is found they will make it into a sector, and if not create a location and a sector. Then it will spawn random units based on Vanilla and what ever Unit mods you have running in Arma. Then it will randomly assign sectors to attack defend or patrol. I'm not a big fan of whole map domination. lol but you can set it up for that.

 

Basically the point is to make the battle as realistic as possible. Say you have 2 towns and an airport. You can set it up as a meeting engagement type mission or an assault defend mission. Makes it feel more like a real battle and engagement. You don't have to wonder the map all day easily capturing sectors. You side will bash it out with enemies over 1 or 2 sectors with platoon to battalion sized forces.

 

Anyways if you want I'll send ya the test mission. Probably after I clean scripts a bit. lol As you can imagine right now they are a mess. Thanks for the snippet I will have a look and test it and figure out what all that means. ;) Thanks again.

Share this post


Link to post
Share on other sites

I think it should be noted that at the time i post this at least, this module is no longer necessary for the ticket system sector control. Also that for those that are looking for modules to create a simple sector control should just learn to write code. Bleed tickets module parameter "dominance ratio" does not work, nor does the time (well it does but it will decrease by half for no known reason). Nor does the tickets parameter (description says the amount of tickets to bleed during full dominance) say if set at 4 once you control 100% sectors you only bleed 3 from other teams. I feel like if the bleed tickets module actually worked and the module could bleed based off of dominance %, and actually be compatible with 3 teams. Example 4 sectors with a .5 dominance ratio (in bleed tickets module) set to bleed 2 tickets. if BLU has 2 and OP has 2 only IND should bleed 2. OR if Blu has 2 sectors ind has 1 sector and op has 1 sector op and ind should only bleed 1, OR if blu has 2 sectors and op has 1 sector and ind has 0 sectors blu should not bleed, op should bleed 1 ticket ind should bleed 2 tickets (or by dominance %).

 

Ive actually done well over 40 hours testing almost 100 different configurations to module parameters and placement in a mission dedicated to testing, used zues to control the inputs of factions to sectors. This module does not work...well maybe to a significantly limited extend. If im wrong please correct me but as I stand now I have the data that shows otherwise in most configurations. Hoping someone that is looking to setup a 3 faction scenario will find this and save them some time and just open up notepadd ++ and do it themselves.

 

I can certainly provide a large portion of my data if requested granted its not before I get bored and forget about it. mostly just records and drawings of layouts for the syncing and modules placement and various parameter change attempts.

For testing I used 4 sectors with necessary areas and triggers, respawn tickets module, bleed tickets module, and used without and with sector control module with actually the same results.

Share this post


Link to post
Share on other sites

Hello, i have a question. How can i make this, that a Sector unlocks a Sector. So that when i have 7 sectors you only can attack one sector after another? 

Thanks for help! 

Share this post


Link to post
Share on other sites
On 17/07/2013 at 9:29 PM, kylania said:

Click on the Module and click Show Info at the bottom. There's a nice description of what you need to make it work on that page.

tMsOxif.jpg

Can you post the link of this wiki page?

I couldn't find it!? :(

Share this post


Link to post
Share on other sites
22 minutes ago, avengerarts said:

Can you post the link of this wiki page?

I couldn't find it!? :(

 

Well, while that post is nearly 4 years old, it's not a link. It's a screenshot of what it looks like when you bring up the info for a module when you're in the editor. 

Share this post


Link to post
Share on other sites
12 minutes ago, beno_83au said:

It's a screenshot of what it looks like when you bring up the info for a module when you're in the old editor.

Press ctrl+O on the map selection screen to open the old editor. Press F7 and double click on the map to show the module insert ui and you will see the info as described.

Although some module info has made it to the new editor, it is not as extensive as what was previously available, which gave you a description for each synchronised/optional piece.

  • Like 1

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

×