spinter Posted May 21, 2014 Posted May 21, 2014 Where am I wrong? local pos = Unit.getByName('Pilot 1'):getPosition().p Vec3 = { x = pos.point.x, y = pos.point.z, z = pos.point.y } --atmosphere.getWind(Vec3) trigger.action.outText(atmosphere.getWind(Vec3), 20) ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
RagnarDa Posted May 21, 2014 Posted May 21, 2014 Where am I wrong? local pos = Unit.getByName('Pilot 1'):getPosition().p Vec3 = { x = pos.point.x, y = pos.point.z, z = pos.point.y } --atmosphere.getWind(Vec3) trigger.action.outText(atmosphere.getWind(Vec3), 20) You are confusing variables and variable-type. Vec3 is a type, not a specific variable. Also, I don't think Vec3 variables can be directly outputted without using the string.format() function. Try local pos = Unit.getByName('Pilot 1'):getPosition().p local wind = atmosphere.getWind(pos) trigger.action.outText(string.format("Wind x: %d, y: %d, z: %d", wind.x, wind.y, wind.z), 20) DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
spinter Posted May 21, 2014 Author Posted May 21, 2014 thanks!! ok sorry ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
RagnarDa Posted May 21, 2014 Posted May 21, 2014 atmosphere.getWind thanks!! ok sorry Why sorry? If you don't ask how will you learn? :) DCS AJS37 HACKERMAN There will always be bugs. If everything is a priority nothing is.
spinter Posted May 21, 2014 Author Posted May 21, 2014 Why sorry? If you don't ask how will you learn? :) :) ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
spinter Posted May 21, 2014 Author Posted May 21, 2014 (edited) could you also tell me to find the direction and velocity? Edited May 21, 2014 by spinter ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
spinter Posted May 22, 2014 Author Posted May 22, 2014 for get direction wind function get_wind(unit1) local BRA = nil local wind = nil if Unit.getByName(unit1) then local pos1 = Unit.getByName(unit1):getPosition().p if pos1 ~= nil then wind = atmosphere.getWind(pos1) local dir = math.atan2(wind.z, wind.x) * 180 / math.pi if dir < 0 then dir = 360 + dir end BRA = dir end end BRA = string.format("Wind: %d, y: %d,", BRA, wind.y) return BRA end trigger.action.outText(get_wind('Pilot #1'), 2) ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net
Recommended Posts