St3v3f Posted May 3, 2013 Posted May 3, 2013 (edited) I'm getting into mission building using scripts and have made some good progress. Now I want to get a unit's speed and I am unsure about how to do that. Using my somewhat rusty bits of math, I would go with something like: speed = Object.getVelocity(unit) speed = math.sqrt(speed.x^2 + speed.y^2 + speed.z^2) Is that correct? If not, how does it work? And on this note: Thanks to Grimes and Speed for their contribution with MIST and Slmod and the scripting documentation on the wiki! :thumbup: Edit: Another question that came up: I want to build an event handler, that reacts to pilot ejections. The function is properly called with event.id == world.event.S_EVENT_PILOT_DEAD, but I can't seem to get the unit that ejected. I've tried event.initiator, event.target, and event.place, but they're all set to nil. Any way to do that? Edited May 3, 2013 by St3v3f aka: Baron [sIGPIC][/sIGPIC]
NightMan Posted April 28, 2021 Posted April 28, 2021 And how about changing a unit's speed? Is it possible?
cfrag Posted April 28, 2021 Posted April 28, 2021 Not directly, no. Currently almost all accessors to a Unit are getters only, and we can only set (change) very things once a unit is added to the mission.
Kappa-131st Posted November 19, 2023 Posted November 19, 2023 There is only one way to be sure : Testing. Put a trigger on a IA to show speed, and compare the speed return by the trigger and the speed display on DCS interface...
Kappa-131st Posted November 19, 2023 Posted November 19, 2023 After a try : Your function seem to be accurate !
Recommended Posts