chronicsilence 12 Posted November 6, 2014 Hi everyone, I'm creating lights to attach to a vehicle (emergency lights), using the following script: _newlight = "#lightpoint" createVehicle [100000,100000,100000]; _newlight setLightColor [1,1,1]; _newlight lightAttachObject [_vehicle, [-0.45, 0.0, 0.56]]; This is a simplified version, but you get the point. The light shows up in the correct spot and functions properly when the vehicle is stopped. However, as soon as the vehicle starts moving, the light bounces around on the vehicle and doesn't stay in its attached location. Once the vehicle stops again, it returns to its correct location. Anyone know why? Share this post Link to post Share on other sites
Tajin 348 Posted November 7, 2014 I found that the regular attachTo command works at least a bit better than "lightAttachObject". You'll still get some bouncing though. Share this post Link to post Share on other sites
chronicsilence 12 Posted November 7, 2014 Yeah, after some more looking I found this: http://feedback.arma3.com/view.php?id=18337 Looks like BI knows but don't care. What about some creative thinking though, this is something that would benefit a lot of missions/mods if we could find a workaround. Any thoughts? Share this post Link to post Share on other sites
Tajin 348 Posted November 7, 2014 (edited) Like I said, attachTo helps to some extend. Only other workaround I can think of would be to update the position of the light manually on each frame with modelToWorld. Though that would be a bit resource intensive. Edited November 7, 2014 by Tajin Share this post Link to post Share on other sites
zgmrvn 95 Posted November 7, 2014 i had (have) the same problem on my Mohawk script (in my sign), seem to be how the engine handles lights, probably no way... Share this post Link to post Share on other sites
kovvalsky 13 Posted November 7, 2014 Only other workaround I can think of would be to update the position of the light manually on each frame with modelToWorld. Though that would be a bit resource intensive. Very expensive, plus I think they must be local, for use in multiplayer you should use BIS_fnc_MP to create them on each computer Share this post Link to post Share on other sites
iceman77 18 Posted November 7, 2014 Yeah, after some more looking I found this: http://feedback.arma3.com/view.php?id=18337Any thoughts? Make an addon instead. Share this post Link to post Share on other sites
chronicsilence 12 Posted November 8, 2014 Very expensive, plus I think they must be local, for use in multiplayer you should use BIS_fnc_MP to create them on each computer Wouldn't they be local though? If a function is run using BIS_fnc_MP, then that function will be run on every computer. If the function is run on every computer, then that function should create local lights. If you create global lights on each computer, well now you've created 'NUM LIGHTS' * 'NUM PLAYERS'. Share this post Link to post Share on other sites
chronicsilence 12 Posted November 8, 2014 (edited) Like I said, attachTo helps to some extend.Only other workaround I can think of would be to update the position of the light manually on each frame with modelToWorld. Though that would be a bit resource intensive. Hilariously enough, this doesn't even work. It looks like the engine doesn't provide accurate position data on the vehicle every frame, so even if I force the position every frame, I can't force it to the proper location because I can't GET the exact proper location of the vehicle. EDIT: ok, I have more info on how this works. The modelToWorldVisual command will get the current, interpolated position of the vehicle with the given offset. However, using the setPos function with that position onEachFrame will still cause the jitter because the light's position isn't interpolated every frame like the vehicle is. So, what I need is a way to force the light's position to be updated every render frame instead of every simulation step. Similar to how the drawIcon3D function works. Edited November 8, 2014 by ChronicSilence Share this post Link to post Share on other sites
Harzach 2507 Posted November 10, 2014 Maybe take a look at setVelocityTransformation. Share this post Link to post Share on other sites