Jump to content
Sign in to follow this  
jandrews

AI spawning with flashlights question

Recommended Posts

I place this in init.sqf and nothing. I assume its not correct. suggestions? I also get error with Guer, some variable error or something.

{

private "_unit";

_unit = _x;

if (side _unit != Guer) then {

_unit addPrimaryWeaponItem "acc_flashlight";

_unit assignItem "acc_flashlight";

_unit enableGunLights "AUTO";

};

} foreach allunits;

thanks

Share this post


Link to post
Share on other sites

Try:

{
private "_unit";
_unit = _x;

if (side _unit != RESISTANCE) then {

_unit addPrimaryWeaponItem "acc_flashlight";
_unit assignItem "acc_flashlight";
_unit enableGunLights "forceon";

};
} foreach allunits;

And you may need to be sure to delete accessories on the weapon already (i.e. a laser) so that the flashlight does get put on and turned on.

Edited by JShock

Share this post


Link to post
Share on other sites
Try:

{
private "_unit";
_unit = _x;

if (side _unit != RESISTANCE) then {

_unit addPrimaryWeaponItem "acc_flashlight";
_unit assignItem "acc_flashlight";
_unit enableGunLights "forceon";

};
} foreach allunits;

And you may need to be sure to delete accessories on the weapon already (i.e. a laser) so that the flashlight does get put on and turned on.

hey JShock, I am wondering if "resistance" is used more, I have faction classnames for AAF

Guer: "IND_F" (AAF), "IND_G_F" (FIA)

So in this mission I have all blufor FIA grouped with Ind leader with 0% presence. So FIA dont have lasers which is nice BUT I am wondering IF I should use GUER since their grouped. Not sure.

Share this post


Link to post
Share on other sites
hey JShock, I am wondering if "resistance" is used more, I have faction classnames for AAF

Guer: "IND_F" (AAF), "IND_G_F" (FIA)

So in this mission I have all blufor FIA grouped with Ind leader with 0% presence. So FIA dont have lasers which is nice BUT I am wondering IF I should use GUER since their grouped. Not sure.

I don't know what would be better either, just depends on your mission/script and what your looking for it to do. If it's small enough and no need for it to be encompassing of the enitre side, I would just use the group, but if you needed the whole side for whatever reason do the side check. But seeing how it's FIA under "command" of an AAF soldier, I would recommend group, just so it's easier.

Share this post


Link to post
Share on other sites

this removePrimaryWeaponItem "acc_pointer_IR"; this addPrimaryWeaponItem "acc_flashlight"; this enablegunlights "forceOn";

I use this in the init of each enemy AI I put down, at least the ones I want to be using a flashlight.

Share this post


Link to post
Share on other sites
I also get error with Guer, some variable error or something.

Just for fun, you can also use "independent" instead of "resistance". Both work, but "guer" doesn't seem to for some reason.

Share this post


Link to post
Share on other sites

@Dread

"guer" does not work, because it never was a valid side. As of this BIKI article, the first sides were "west", "east" and "resistance". In ArmA 3 they changed that to "bluefor", "opfor" and "independent", firstly because "east" and "west" do not apply in geographical or political terms anymore and secondly, because it's politically incorrect to make the "east" the bad guy and the "west" the good guy.

For "resistance" / "independent" I'm not sure, but I'd say it's because there's two independent sides in ArmA 3 - "Altis Armed Forces" (AAF) which are NATO-friendly and "Freedom and Independency Army" (FIA) which does sort of it's own thing. (Source)

Edited by waltenberg

Share this post


Link to post
Share on other sites
@Dread

"guer" does not work, because it never was a valid side. As of this BIKI article, the first sides were "west", "east" and "resistance". In ArmA 3 they changed that to "bluefor", "opfor" and "independent", firstly because "east" and "west" do not apply in geographical or political terms anymore and secondly, because it's politically incorrect to make the "east" the bad guy and the "west" the good guy.

Weirdly using "side unit" will return GUER (at least it did not very long ago), despite the fact that it can't be used.

Share this post


Link to post
Share on other sites

Because the return value of the "side" command is not a side as used in SQF code. If you use that command on a civilian unit, the return value will be "CIV" though you can't use "civ" as a side either. Same goes for "LOGIC" (ambient life), "ENEMY" (some renegade or whatever) and "UNKNOWN". It's rather a coincidence that the return value for west/blufor units is "WEST" and for east/opfor is "EAST".

Don't confuse sides as used in SQF code with the value returned by the "side" command. Those are two different and independent things!

Edited by waltenberg

Share this post


Link to post
Share on other sites
Because the return value of the "side" command is not a side as used in SQF code. If you use that command on a civilian unit, the return value will be "CIV" though you can't use "civ" as a side either. Same goes for "LOGIC" (ambient life) and "ENEMY" (some renegade or whatever). It's rather a coincidence that the return value for west/blufor units is "WEST" and for east/opfor is "EAST".

Don't confuse sides as used in SQF code with the value returned by the "side" command. Those are two different and independent things!

Yeah, figured it was something like that. Always seemed needlessly confusing.

Share this post


Link to post
Share on other sites
If you use that command on a civilian unit, the return value will be "CIV" though you can't use "civ" as a side either. Same goes for "LOGIC" (ambient life), "ENEMY" (some renegade or whatever) and "UNKNOWN". It's rather a coincidence that the return value for west/blufor units is "WEST" and for east/opfor is "EAST".

Don't confuse sides as used in SQF code with the value returned by the "side" command. Those are two different and independent things!

I don't know about logic, enemy, and unknown, but if you want to check sides for civs you should should use "civilian". Excerpt from my simpleicons script:

switch (side _x) do
			{
				case west: {};
				case east: {};
				case independent: {};
				case civilian: {};
			};

  • 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
Sign in to follow this  

×