Jump to content

Direct LUA scripting to modify speeds in all waypoints


ralch

Recommended Posts

Hi,

I am writing a fun mission with several waypoints and triggers and all is working fine without LUA scripting.

However when I change AI planes to try versus different enemies, the speeds of the waypoints automatically change and that causes problems with my mission.

How can I add a simple startup LUA script (direct SDK without frameworks) to modify all waypoints for all planes at to have them all with the same speed, lets say 795Km/h ?

 

Thank you!

Link to comment
Share on other sites

Yes and no. 

No, in the sense that lua doesn't modify the actual mission file itself. I mean you could do that externally from DCS, but as far as the API goes that isn't what it does. You could also do that manually push comes to shove. 

Yes, because you could get the data from the mission, modify whatever you need, and spawn in that group with the changes or just assign the task while the mission is running. Spawning a new group might mess with the triggers however. 

The "direct SDK" as you put it used within mist to get a group route can be seen here: https://github.com/mrSkortch/MissionScriptingTools/blob/master/mist.lua#L8165

It literally just parses the big ol' mission table to find the route associated with a group. All it would take to modify the speed value is just that, change the speed table entry that it is using. Pass that table to Controller.pushTask or spawn a group with the change. Viola. 

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Also bear in mind that the speeds on the tasking are in metres per second (i think) and the altitude is in metres, so you’ll have to make appropriate conversations when creating a new or modifying existing tasks. 

Creator & Developer of XSAF ::An AI model that wants to kill you, and needs no help from humans.

Discord: PravusJSB#9484   twitch.tv/pravusjsb  https://www.patreon.com/XSAF  https://discord.gg/pC9EBe8vWU https://bmc.link/johnsbeaslu

Work with me on Fiverr: https://www.fiverr.com/pravusjsb

Link to comment
Share on other sites

  • Recently Browsing   0 members

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