Jump to content
MadMonk

Switching on a weapon mounted light

Recommended Posts

I have placed this script in the player unit initialisation to add a weapons mounted light. The item appears in the inventory and is attached to the weapon but I cant switch it on. I have tried the

headlight control L by default but it has no effect. Does anyone have any ideas?

this addPrimaryWeaponItem "acc_flashlight";

Share this post


Link to post
Share on other sites

I am interested in that too!!! Let us know if it worked!

Share this post


Link to post
Share on other sites

Thanks for the suggestion, it didnt work here. Is the headlight control the right action, Ive gone through the controls and it seems to be the obvious choice.

Share this post


Link to post
Share on other sites

Weird. Pressing the L Key should turn on the flashlight. Works for me with your code, tested it with the Light Solder Unit BLUE. Might be a stupid question, but are you there wasn't an attachment mounted already? Like the IR Laser?

Share this post


Link to post
Share on other sites
Weird. Pressing the L Key should turn on the flashlight. Works for me with your code, tested it with the Light Solder Unit BLUE. Might be a stupid question, but are you there wasn't an attachment mounted already? Like the IR Laser?

It works for me too, and there even is an attachment on the weapon already but "this addPrimaryWeaponItem "acc_flashlight"" simply replaces it.

I'm wondering if there is a way for AI to use that flashlight?

Share this post


Link to post
Share on other sites
It works for me too, and there even is an attachment on the weapon already but "this addPrimaryWeaponItem "acc_flashlight"" simply replaces it.

I'm wondering if there is a way for AI to use that flashlight?

this enableIRLasers true;

does it for me. But only if they are engaging -> *blink blink blink* morsecode :D

Share this post


Link to post
Share on other sites

Thanks for the replies, It seems to work now with the original line of code for the unit initialization with nothing different. I did have an arma crash to desktop though just after windows telling me I was nearly out of memory (4.7 gig used out of 8 gig) so there might be a memory leak somewhere. Next step is to equip some AI with flashlights.

Share this post


Link to post
Share on other sites
this enableIRLasers true;

does it for me. But only if they are engaging -> *blink blink blink* morsecode :D

Hmm doesn't work even if they are engaging. What is the possibility of that being connected to them having night vision?

Share this post


Link to post
Share on other sites

Hi guys!

This will make a unit use his weapon mounted flashlight:

this unassignItem "NVGoggles";

this removeItem "NVGoggles";

this removeWeapon "Binocular";

this unassignItem "acc_pointer_IR";

this removePrimaryWeaponItem "acc_pointer_IR";

this addPrimaryWeaponItem "acc_flashlight";

this assignItem "acc_flashlight";

this enableGunLights "ForceOn";

You can put this code in the unit's init field.

Share this post


Link to post
Share on other sites
On 3/7/2013 at 9:58 AM, MadMonk said:

I have placed this script in the player unit initialisation to add a weapons mounted light. The item appears in the inventory and is attached to the weapon but I cant switch it on. I have tried the

headlight control L by default but it has no effect. Does anyone have any ideas?

this addPrimaryWeaponItem "acc_flashlight";

 

 

CSWR script already has an option where you easily define if the AI should use a flashlight or night vision. Also, if they can even have them in their loadout. Check this out:

 

8aEaFxH.jpeg

 

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

×