scrapple Posted August 25, 2017 Posted August 25, 2017 I've run into something unexpected when using the mist.respawnGroup function to respawn AI aircraft groups in the air. It may just be something I don't understand, or that I'm doing wrong. If the aircraft waypoint altitudes are entered as MSL in the mission editor, the aircraft respawns at the same altitude each time which is the behavior I would expect. However, if the altitudes are entered as AGL, the aircraft respawns at the correct location, but at higher and higher altitudes each time. The altitude increase each time seems to equal the ground height below the starting waypoint. For example, if the ground below the waypoint is 1500 ft above sea level, the aircraft would respawn 1500 ft higher each time. So of course this is a lot more noticeable when the aircraft is respawning over mountainous terrain. I've attached a very simple 1.5.7 mission file that demonstrates the issue. There are two AI aircraft in separate groups (Group #001 and Group #002) that spawn at approx 5000 ft. In Group #001 all the waypoint altitudes are entered as MSL in the mission editor. Group #002 is identical, except I changed the starting waypoint to be AGL. Mission start time is 12:00:00. The lua script respawns the two groups every 30 seconds. 12:00:00 (mission start) - Both aircraft spawn at ~5000 ft. 12:00:40 (first respawn) - Both aircraft again spawn at ~5000 ft. 12:01:10 (second respawn) - Group #001 spawns at ~5000 ft, Group #002 spawns at ~6800 ft. 12:01:40 (third respawn) - Group #001 spawns at ~5000 ft, Group #002 spawns at ~8600 ft. 12:02:10 (forth respawn) - Group #001 spawns at ~5000 ft, Group #002 spawns at ~10400 ft. And so on... And here's the lua script: function respawnAI(arg, time) mist.respawnGroup("Group #001", true) mist.respawnGroup("Group #002", true) return time + 30 end do timer.scheduleFunction(respawnAI, nil, timer.getTime() + 30) end Respawn Testing.miz
Grimes Posted August 25, 2017 Posted August 25, 2017 I roughly know what the problem is, it is just a matter finding where it is screwing up at. If I fix it tonight I'll push an update on the github for it. 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
scrapple Posted August 25, 2017 Author Posted August 25, 2017 (edited) Thank you sir! And I just noticed that I seem to get the same behavior if a an AI aircraft group is set to late activation or a delayed start time in the mission editor. Each time the group respawns at a higher and higher altitude. This occurs even if all the waypoint altitudes are entered as MSL. Edited August 25, 2017 by scrapple
Recommended Posts