Mercury_1965 Posted September 20, 2020 Posted September 20, 2020 I wont script a training mission and I need continously read and show some flight data. Trying with altitude ...not work start_mes = "START MISSIOIN" trigger.action.outText(start_mes, 10) repeat local aboveSeaLevel = math.floor(Unit.getByName('gmv-1'):getPosition().p.y * 3.28084 , 0) trigger.action.outText(aboveSeaLevel, 3) until( aboveSeaLevel < 7700 ) trigger.action.outText("Passed 7700" , 3) Any suggestion ?
HC_Official Posted September 21, 2020 Posted September 21, 2020 examine your DCS.log No more pre-orders Click here for tutorials for using Virpil Hardware and Software Click here for Virpil Flight equipment dimensions and pictures. .
Grimes Posted September 21, 2020 Posted September 21, 2020 It is stuck in the loop. You need to recheck the altitude at a set time interval. Anything done with while, repeat, etc loops will just keep going until they stop and iterating takes nanoseconds per check. You can either put it in a function that gets scheduled or remove the loop and call the script via triggers. local function altCheck() local aboveSeaLevel = math.floor(Unit.getByName('gmv-1'):getPosition().p.y * 3.28084 , 0) trigger.action.outText(aboveSeaLevel, 3) if aboveSeaLevel > 7700 then timer.scheduleFunction(altCheck, {}, timer.getTime() + 1) end end altCheck() The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Mercury_1965 Posted September 22, 2020 Author Posted September 22, 2020 Thanks for suggestion. I Will try in this way
Recommended Posts