Jump to content
Sign in to follow this  
alleycat

How to reference a sector?

Recommended Posts

When referencing a sector module (named sec1 in the top most name field) it displays an error

if ((sec1 select 1) == east) then 
{
diag_log text format["%1 is owned by CSAT", sec1];
};

Error select: Type Object, expected Array,Config entry

However this works in the sector expression

if ((_this select 1) == east) then {(_this select 0) enableSimulation false}

Share this post


Link to post
Share on other sites
if (sec1 getvariable ["owner", sideUnknown] == east)

Will work anywhere. The select way only works inside the expression as this piece of code is evaluated by the module itself.

Share this post


Link to post
Share on other sites

If I want to set the side of a sector, why doesnt this work:

sec1 setVariable ["owner", west, true];

Share this post


Link to post
Share on other sites

It won't work, because the sector system calculates owner automatically and will replace your value in the next cycle.

However, forcing a sector owner could be quite useful - I expanded the sector function so it can be used for it:

[<sector>,<side>] call BIS_fnc_moduleSector;

It will be available in the next dev branch update. Thanks for suggestion :)

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  

×