Purzel 35 Posted October 9, 2013 Hi, how do i attach a chemlight from the module to a certain object? I want to have a kind of "traffic light" for the players to start the mission. Unfortunately the module-effects-chemlight is not able to spawn in a certain high (only on the floor), so I tried the "setpos/getpos" -and in my desperation even the "this flyInHeight"-syntax (but of course the last did not work.) Same is with the "attach"-command. Can anybody please help me with that issue...? "Chemlight name" Which-command-need-I-to-attach-to-the-following "object"...? Thanx! Share this post Link to post Share on other sites
Gekkibi 11 Posted October 9, 2013 Use the chemlights under empty -> mines. You can attach them by using attachTo command. Share this post Link to post Share on other sites
Purzel 35 Posted October 10, 2013 thank you!!!!!! It works, but not as desired... *grmpfl* but now the next question...: How do I switch them on and off? My intention was to stick them at one radio, and when radio Alpha was triggered, the red light switches to green (and vice versa on radio beta.) Or can I use a light and how? I just need a little glowing point in red or green. Greetz Purzel Share this post Link to post Share on other sites
kylania 568 Posted October 10, 2013 Chemlights don't have an on/off switch. You break them they mix chemicals and produce light. Just have your radio command delete the red light and spawn in a green light just the same way. Share this post Link to post Share on other sites
Gekkibi 11 Posted October 10, 2013 Create lights.sqf: _obj = _This select 0; _rate = _This select 1; _light1Pos = _this select 2; _light2Pos = _this select 3; while {true} do { _light = createVehicle ["#lightpoint", getPos _obj, [], 0, "NONE"]; _light lightAttachObject [_obj, _light1Pos]; _light setLightBrightness 0.2; _light setLightAmbient [1.0, 0.0, 0.0]; _light setLightColor [1.0, 0.0, 0.0]; sleep _rate; deleteVehicle _light; _light = createVehicle ["#lightpoint", getPos _obj, [], 0, "NONE"]; _light lightAttachObject [_obj, _light2Pos]; _light setLightBrightness 0.2; _light setLightAmbient [0.0, 1.0, 0.0]; _light setLightColor [0.0, 1.0, 0.0]; sleep _rate; deleteVehicle _light; }; Put this to your trigger activation: nul = [object, 1, [pos1], [pos2] execVM "light.sqf"; Tweak it before you're satisfied. Share this post Link to post Share on other sites
Purzel 35 Posted October 11, 2013 nul = [object, 1, [pos1], [pos2] execVM "light.sqf"; Does not work: "missing ]" A Question to that code: How does that code know, which object is the one I wanna attach it to? (In my case "Heli1") Where do i have to exchange/insert the "Heli1"...? Sorry but I have no clue, what that code exactly means, please can someone explain the following: _obj = _This select 0; _rate = _This select 1; _light1Pos = _this select 2; _light2Pos = _this select 3; _light = createVehicle ["#lightpoint", getPos _obj, [], 0, "NONE"]; sleep _rate; Thank you Share this post Link to post Share on other sites
xyberviri 1 Posted October 11, 2013 because that should have been typed as : nul = [object, 1, [pos1], [pos2]] execVM "light.sqf"; Share this post Link to post Share on other sites
Gekkibi 11 Posted October 11, 2013 How does that code know, which object is the one I wanna attach it to? (In my case "Heli1") nul = [Heli1, 1, [1, 0, 0], [-1, 0, 0]] execVM "lights.sqf"; Share this post Link to post Share on other sites
Purzel 35 Posted October 11, 2013 (edited) Aah, that easy! Thank you... ok, but this light changes color continuesly from red to green. It just should switch. Edited October 11, 2013 by Purzel Share this post Link to post Share on other sites
Gekkibi 11 Posted October 11, 2013 Aah, that easy! Thank you...ok, but this light changes color continuesly from red to green. It just should switch. _obj = _This select 0; _light1Pos = _this select 1; _light2Pos = _this select 2; _light = createVehicle ["#lightpoint", getPos _obj, [], 0, "NONE"]; _light lightAttachObject [_obj, _light1Pos]; _light setLightBrightness 0.2; _light setLightAmbient [1.0, 0.0, 0.0]; _light setLightColor [1.0, 0.0, 0.0]; waitUntil {!isNil "yourVariableNameHere"}; deleteVehicle _light; _light = createVehicle ["#lightpoint", getPos _obj, [], 0, "NONE"]; _light lightAttachObject [_obj, _light2Pos]; _light setLightBrightness 0.2; _light setLightAmbient [0.0, 1.0, 0.0]; _light setLightColor [0.0, 1.0, 0.0]; nul = [Heli1, [1, 0, 0], [-1, 0, 0]] execVM "lights.sqf"; Create a trigger, add desired condition and put yourVariableName = true to the on-activation field. Didn't test, might contain typos. Share this post Link to post Share on other sites