Jump to content

Recommended Posts

Posted

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

 

 

 

Posted
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.

Posted

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.

Posted

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

 

 

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...