semedar 0 Posted September 23, 2011 (edited) Is there a way to addAction a player that will create an IR Stobe and attach it to said player? My goal: Player is in thick woods at night while buddy is flying overhead with a littlebird but doesnt want to kill me. So I scroll my action menu and select "Turn IR On" and an IR Strobe follows me everywhere I go until I die. This is the closest I found but it's for ACE, which I don't want to use: http://ace.dev-heaven.net/wagn/IR_Strobes+notes Something like this perhaps? Just an idea. :rolleyes: Player Init p1 addAction [("<t color=""#EEEE00"">" + ("Turn IR On") +"</t>"), "Scripts\IR_Strobe.sqf"]; IR_Strobe.sqf _irstrobe = "ACE_IRStrobe_Object" createVehicle getPos p1; _irstrobe attachTo[p1,[0,0,0],""]; ["ace_sys_irstrobe_aradd", [_irstrobe]] call CBA_fnc_globalEvent; Edited September 25, 2011 by Semedar Change Title Share this post Link to post Share on other sites
semedar 0 Posted September 23, 2011 (edited) This is what I have so far. It works, but when you start to run, the strobe eventually detaches from the character and is stuck on the ground. //Strobe.sqf //By Semedar //Player Init: p1 addAction [("<t color=""#FFFFFF"">" + ("Strobe") +"</t>"), "Scripts\Player\Strobe.sqf"]; while { true } do { _irstrobe = "IR_Strobe_Marker" createVehicle getPos player; _irstrobe attachTo [player,[0,0,1],""]; Sleep 5; deleteVehicle _irstrobe; }; Edit: I found out it detaches when the model disappears but the strobe is still on. Anyone know how to make the strobe light follow the character? Edit 2: I also found out that the IR Strobe model disappears somewhere around 13-15 seconds. So maybe having it delete the IR Strobe and then creating a new one every 12-13 seconds? Another Edit: I can't seem to delete the IR Strobe that I created via createVehicle with deleteVehicle. Anyone help me here? Edited September 23, 2011 by Semedar Share this post Link to post Share on other sites
sxp2high 23 Posted September 23, 2011 (edited) Hi, if attachTo doesn't work, you can use this alternative: stroboDrop = false; _irstrobe = "IR_Strobe_Marker" createVehicle (getPos player); while {!stroboDrop} do { _irstrobe setpos [(getPos player select 0), (getPos player select 1), 1]; _irstrobe setDir (getDir player); sleep 0.01; }; _irstrobe setpos [(getPos player select 0), (getPos player select 1), 0]; This way, to drop the strobo, you just have to set stroboDrop to true. stroboDrop = true; Then you can call it again, and so on. Edited September 23, 2011 by sxp2high Share this post Link to post Share on other sites
semedar 0 Posted September 23, 2011 (edited) Hi,if attachTo doesn't work, you can use this alternative: stroboDrop = false; _irstrobe = "IR_Strobe_Marker" createVehicle (getPos player); while {!stroboDrop} do { _irstrobe setpos [(getPos player select 0), (getPos player select 1), 1]; _irstrobe setDir (getDir player); sleep 0.01; }; _irstrobe setpos [(getPos player select 0), (getPos player select 1), 0]; This way, to drop the strobo, you just have to set stroboDrop to true. stroboDrop = true; Then you can call it again, and so on. Tried yours but it just makes the strobe spawn and stay on the ground. :( I think we're going to have to send a bug report because I don't think we can move/delete/mess around with an IR Strobe once it's been "deployed". As in the model disappears and all it leaves behind is the strobe light. Edited September 24, 2011 by Semedar Share this post Link to post Share on other sites
semedar 0 Posted September 24, 2011 Someone reported this bug already. Go here and thumbs up it! :) http://dev-heaven.net/issues/13742 Share this post Link to post Share on other sites
.kju 3245 Posted September 25, 2011 setPos it to [-10000,-10000,100000] before you delete it Share this post Link to post Share on other sites
semedar 0 Posted September 25, 2011 (edited) setPos it to [-10000,-10000,100000] before you delete it Won't work either. :( while { true } do { _irstrobeplayer = "IRStrobe" createVehicle getPos player; _irstrobeplayer attachTo [player,[0,0,2],""]; Sleep 10; [b]_irstrobeplayer setPosATL [-10000,-10000,100000];[/b] deleteVehicle _irstrobeplayer; }; My test mission: Strobe_Test.utes.zip Edited September 25, 2011 by Semedar Share this post Link to post Share on other sites
.kju 3245 Posted September 25, 2011 you need to detach it first I guess Share this post Link to post Share on other sites
semedar 0 Posted September 25, 2011 (edited) you need to detach it first I guess Hah, it was that simple, huh? :D It worked, though! :D while { true } do { _irstrobeplayer = "IRStrobe" createVehicle getPos player; _irstrobeplayer attachTo [player,[0,0,1],""]; Sleep 15; detach _irstrobeplayer; _irstrobeplayer setPosATL [-10000,-10000,100000]; Sleep 0.1; deleteVehicle _irstrobeplayer; Sleep 0.1; }; Question now, though: How would I be able to start/stop this script via Action Menu How to stop it when the player dies ---------- Post added at 03:01 AM ---------- Previous post was at 02:26 AM ---------- Would something like this work? // Strobe2.sqf // By Semedar // Player Init: p1 addAction [("<t color=""#FFFFFF"">" + ("Strobe") +"</t>"), "Strobe2.sqf"]; strobe = true; while { strobe } do { _irstrobeplayer = "IRStrobe" createVehicle getPos player; _irstrobeplayer attachTo [player,[0,0,2],""]; Sleep 14.8; detach _irstrobeplayer; _irstrobeplayer setPosATL [-10000,-10000,100000]; Sleep 0.1; deleteVehicle _irstrobeplayer; Sleep 0.1; }; WaitUntil{not isNull player}; player addEventHandler ["killed", {strobe = false}]; Edited September 25, 2011 by Semedar Share this post Link to post Share on other sites
HeinBloed 0 Posted September 25, 2011 You can use the Strobe Effect instead of the IR-Marker model (ammo). _irstrobe = "NVG_TargetW" createVehicle getpos unitName; _irstrobe attachTo [unitName,[0,0,0.2],"neck"]; You can choose between three IR-Targets: "NVG_TargetC": Independent AI will attack this. "NVG_TargetW": West AI will attack this. "NVG_TargetE": East AI will attack this. Share this post Link to post Share on other sites
semedar 0 Posted September 25, 2011 (edited) Mission Init: strobeOn = player addAction ["MS-2000 On","strobeStart.sqf"]; strobeStart.sqf: (Working Now) // strobeStart.sqf // By Semedar // Player Init: unit addAction ["MS-2000 On", "strobeStart.sqf"]; player removeAction strobeOn; Sleep 0.1; strobeOff = player addAction ["MS-2000 Off", "strobeStop.sqf"]; strobe = true; while { strobe } do { _irstrobe = "NVG_TargetC" createVehicle getpos player; _irstrobe attachTo [player,[0,0,0.2],"neck"]; Sleep 0.8; detach _irstrobe; deleteVehicle _irstrobe; Sleep 0.1; }; WaitUntil{not isNull player}; player addEventHandler ["killed", {strobe = false}]; strobeStop.sqf: (Working Now) // strobeStop.sqf // By Semedar // Player Init: unit addAction ["MS-2000 Off", "strobeStop.sqf"]; player removeAction strobeOff; Sleep 0.1; strobeOn = player addaction ["MS-2000 On","strobeStart.sqf"]; strobe = false; detach _irstrobe; _irstrobe setPosATL [-10000,-10000,100000]; deleteVehicle _irstrobe; Strobe_Test.utes.zip Edit: Fixed :D Reason being the actions were local Edited the script I posted in case someone wants to use it. :D Edited September 26, 2011 by Semedar Share this post Link to post Share on other sites
GeeBee 0 Posted September 27, 2011 Would be nice to have this work during the day time aswell. Somthing like the AC-130 script with the thermal image. Share this post Link to post Share on other sites
HeinBloed 0 Posted September 27, 2011 Mission Init: while { strobe } do { _irstrobe = "NVG_TargetC" createVehicle getpos player; _irstrobe attachTo [player,[0,0,0.2],"neck"]; Sleep 0.8; detach _irstrobe; deleteVehicle _irstrobe; Sleep 0.1; }; This is needless. "NVG_TargetC" is blinking by itself. Share this post Link to post Share on other sites
nephros 23 Posted May 24, 2013 (edited) If you want to have this function active only if a player has an IR strobe in their inventory: Don't add any code to the mission init (or remove it if you've already placed it) - because it will be in the trigger. Create a trigger with the following parameters: axis a: 0 axis b: 0 condition: "IRStrobe" in magazines player On Activation: strobeOn = player addAction ["MS-2000 On","strobeStart.sqf"]; On Deactivation: player removeAction strobeOn; Edited May 25, 2013 by nephros Share this post Link to post Share on other sites