MadMonk 1 Posted March 7, 2013 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
pappmensch 1 Posted March 7, 2013 You might need to assign the item too. You could try: this assignitem "acc_flashlight"; Share this post Link to post Share on other sites
frag 0 Posted March 7, 2013 I am interested in that too!!! Let us know if it worked! Share this post Link to post Share on other sites
MadMonk 1 Posted March 7, 2013 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
pappmensch 1 Posted March 7, 2013 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
duhsveti 1 Posted March 7, 2013 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
pappmensch 1 Posted March 7, 2013 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
MadMonk 1 Posted March 7, 2013 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
duhsveti 1 Posted March 7, 2013 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
This kid 1 Posted July 1, 2013 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
cobra4v320 27 Posted July 2, 2013 http://forums.bistudio.com/showthread.php?153141-enableGunLights-correction-for-wiki Share this post Link to post Share on other sites
thy_ 148 Posted April 18 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: Share this post Link to post Share on other sites