Jump to content
Sign in to follow this  
kelgram

Definitive answer to evaluating the side of a unit?

Recommended Posts

Having a look at the BIKI page for sides

https://community.bistudio.com/wiki/side

I am really confused as to what is what, there seems to be several ways to evaluate what side an object is on.

e.g.


side _player == west; // is object equal to another object?

side _player isEqualTo WEST; // is WEST a const????

side _player == "WEST"; // equal to string?

I've worked with JAVA, JavaScript and PHP and have never seen anything like this before, so what is the correct way?

Also what is the difference between

INDEPENDANT --> GUER --> RESISTANCE and which one is the correct one to use for ArmA 3

As my logic does not seem to work at the moment for this code:

if (side _x isEqualTo EAST || side _x isEqualTo RESISTANCE) then
{
	_x addEventHandler ["Killed", {[_this select 0, _this select 1] execVM "scripts\killed.sqf";}];
	_x setskill ["spotTime",0.5]; _x setskill ["spotDistance",0.15]; _x setSkill ["aimingspeed", 0.30]; _x setSkill ["aimingaccuracy", 0.17];  
};

I am pulling my hair out !

Share this post


Link to post
Share on other sites

isEqualTo and == are almost the same thing, Tajin has a good explanation of the difference in the notes of the isEqualTo wiki, but the isEqualTo command is faster than ==, performance wise.

You can use either INDEPENDENT or RESISTANCE when looking at an object's side, GUERRILLA is the faction, not the side.

And side is basically its own data type in Arma terms. And the side is only a string when used in conjunction with the format command (as the wiki is using it).

Share this post


Link to post
Share on other sites

most definitive way is this

(side group _x == east || side group _x == resistance)

both east and resistance are special variables that contain side and when you query side, query side of the group unit belongs to because dead units become CIV

Share this post


Link to post
Share on other sites
I've worked with JAVA, JavaScript and PHP and have never seen anything like this before, so what is the correct way?

You might have heard of enumeration before then? Sides are a custom data type. Objects are also custom data types, and I believe even dialogs are too

Share this post


Link to post
Share on other sites

Afaik it's always either GUER or WEST or EAST that's always working.

Never used anything else for sidechecks.

And like KK said, dead units belong to civ side.

Cheers

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  

×