Bushmanni Posted February 2, 2014 Posted February 2, 2014 (edited) I happened to have a problem of randomizing routes of groups and figured a very simple and easy to use way to do it and decided to share it as I'd like to see this more on other peoples missions too. Basically there's only one function that you give the name of the group, names of the groups with routes in a table and optionally a number of the new route. Example: You have a group "test" with some waypoints. You add "run script" command to the last wp 'selectRoute("test", {"opt1", "opt2", "opt3"});'. "opt1", "opt2" and "opt3" are the groupnames of the units with alternate routes and each of the alternate route groups have their #1 wp close to the last wp of the group "test". The function will pick one of the routes of the provided groups and start from wp #1. The function uses mist.getGroupRoute so it preserves all the information that it can grab except whats in the first waypoint. I haven't yet tested if enroute tasks are preserved from previous route or if you need to reassign them at the first wp of the new route. I have attached example mission which should demonstrate how to use this. selectRoute example.mizroute.lua Edited February 3, 2014 by Bushmanni Updated route.lua 1 DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community -------------------------------------------------- SF Squadron
Flagrum Posted February 2, 2014 Posted February 2, 2014 I had the idea to have the capability to assign multiple routes (for different conditions) for the ME: http://forums.eagle.ru/showthread.php?p=1943716&highlight=route#post1943716 But this looks already like a very viable work around. Thanks!
ENO Posted February 3, 2014 Posted February 3, 2014 My only issue with get route anything is the issue AI have with bridges. My random routes - when I use them- are generally established through random spawning of groups with the same makeup and same destination with different route- but I think all of us would love a function that reliably mixed it up without having to do that. Keep in mind there are also issues with random zone spawn and group to random zone / teleport etc... In that the servers can see but the clients can't. This causes issues when- what it looks like- an AI unit on the server is killed or affected and the clients don't have that unit... Causes a crash. (My assessment of it) So if you have problems with your function I'm just saying it might not be your function that isn't working. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Bushmanni Posted February 3, 2014 Author Posted February 3, 2014 My function only assigns a new human made route to the group, no teleporting, spawning or randomly placed waypoints. DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community -------------------------------------------------- SF Squadron
Bushmanni Posted February 3, 2014 Author Posted February 3, 2014 There was a bug that made the newly assigned route lose it's tasks, ie. you couldn't daisy chain routes. I fixed the problem and updated the lua file in first post. Using the function in following way will make the route unit-independent, ie. you can send whatever group through the route and it will randomly pick a new route at the end of it. This makes it possible to send multiple groups to the same route network. You can also build routes that link back to other routes in the network and when you send groups to one of the routes it will keep randomly driving around the network indefinitely. local thisGroup = ... groupname = thisGroup:getName(); selectRoute(groupname, {"opt1", "opt2", "opt3"}); DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community -------------------------------------------------- SF Squadron
Bushmanni Posted February 3, 2014 Author Posted February 3, 2014 I managed to test the enroute task persistency and found out that they will be deleted with new route. EPLRS on the other hand will stay as set and as such I presume also other stuff under commands like ROE. DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community -------------------------------------------------- SF Squadron
Recommended Posts