Rakuzard Posted January 20, 2016 Share Posted January 20, 2016 Hey all, I didn't want to always go into the mission editor and place just one or two aircraft in order to just try something out. So I wrote a script to dynamically spawn (hostile) aircraft with a certain difficulty. I call it "RTS" for "Rakus Training Spawns" - quite selfish and mostly a working title, but in lack of a more creative name I will just stay with it... for now, at least. :D With the goal of high configurability in mind I may present the first version of this script to you. Features: configure aircraft types to your likings: type, flight size, loadout, liveries dynamically spawn aircraft - when and where you want it four different difficulties configurable/translatable messages removing of spawned aircraft after a certain timeout ... Dependencies: Mist 4.0.57 (a higher version should work, too) Usage: Use the exposed function void RTS.spawnAircraft(table difficulty, table coal, table spawnZones, string flyToZone) difficulty - One of RTS.Easy, RTS.Medium, RTS.Heavy or RTS.Hard coal - coalition to spawn the aircraft under. either coalition.side.BLUE or coalition.side.RED spawnZones - a table of the names of triggerzones the aircraft can spawn in. actual zone will be taken from the table at random. flyToZone - name of a triggerzone the aircraft will get a waypoint in. The difficulty determines the capabilities (and type) of the aircraft. You can tell the script which types can be spawned for one of the four difficulties. RTS.Easy will spawn the aircraft without weapons/countermeasures and they won't attack RTS.Medium will spawn the aircraft with a gun only, but this time they will attack RTS.Hard will spawn the aircraft with its full, configured loadout RTS.Heavy is used for heavy aircraft like awacs and bombers The coalition should be obvious. If you fly for the blue coalition and want to spawn some targets, then you should put coaltion.side.RED here ;) Oh, no neutral coalition for now! We don't want to shoot innocent neutrals. The spawn zones parameter is a table, because you can give more than one spawn zone. The script will choose a random zone from this table to determine where to spawn the aircraft. The parameter flyToZone is used by the script to give the spawned aircraft a waypoint. Between the spawning point and this waypoint the plane will fly a racetrack pattern at the configured altitude. So, for example a call like this RTS.spawnAircraft(RTS.Easy,coalition.side.RED,{'Spawn1','Spawn2'},'WaypointHub') will spawn a flight of "easy" aircraft for the red coalition in a random point in either the trigger zone named "Spawn1" or the trigger zone "Spawn2". The spawned group will get a waypoint at a random point in the "WaypointHub" trigger zone and will fly a racetrack pattern between this waypoint and the spawn point. Now, how you actually use this is completely up to you. For training purposes I built myself a mission where I can call above function by radio. I think this would be pretty neat for a multiplayer training mission and maybe I can create one for you in the next few days. Most parts of the script, especially the configuration is very well commented. The biggest part (in terms of lines in the file) is taken up by the actual aircraft-type configuration (man there are so many different aircraft in DCS!). I hope this thread and the comments in the script explain everything you need to know. After the few days getting this to work I'm too much into this to be able to judge if my explanations make any sense. :D Future: For me, this isn't the end. I want to implement the country/livery determination, because for now the livery will be chosen completely random... so you may see Swiss Hawks for the red coalition, even if Switzerland is in the blue coalition in the mission. Shouldn't be too hard to implement the livery-choosing-logic, but this comes at the risk of the user choosing to spawn an aircraft for a coalition where this coalition has no countries the aircraft can fly for. I'm sure I will find a solution to this. Furthermore I would love to implement the same thing for ground units, but obviously this has WAY MORE things to be configurable (target type, JTAC yes/no and if yes the JTAC options, and so on...). Nothing impossible, but time consuming. So I first wanted to see how you guys react to the very first version of this... ;) Happy flying!RakusTrainingSpawns_v0.6.lua 1 - Deutsche Tutorials und DCS Gameplay: youtube.com/Rakuzard | raku.yt/discord - Link to comment Share on other sites More sharing options...
wolf5 Posted January 20, 2016 Share Posted January 20, 2016 Nice, i was thinking to make something like that. You were faster :) I hope you can include CAS and JTAC. Maybe we can select 4 or more aircrafts to fight like in GCICAP script, with custom loadout; People fly planes, pilots fly helicopters Link to comment Share on other sites More sharing options...
Rakuzard Posted January 21, 2016 Author Share Posted January 21, 2016 Maybe we can select 4 or more aircrafts to fight like in GCICAP script, with custom loadout; The flight size and loadout is configurable. Still looking for some way to make the loadout more human-readable. Actually you could let two flights spawn (not RTS.Easy!), one flight for red, one flight for blue and just give them the same flyToZone. This way they should actually fly towards and engage each other. Never tried it, though :D - Deutsche Tutorials und DCS Gameplay: youtube.com/Rakuzard | raku.yt/discord - Link to comment Share on other sites More sharing options...
wolf5 Posted January 21, 2016 Share Posted January 21, 2016 Ok but i was thinking a way to choose livery and loadout as in GCICAP script where you have just to add aircraft on ME. Maybe with MIST and "mist.respawnGroup" :thumbup: People fly planes, pilots fly helicopters Link to comment Share on other sites More sharing options...
Rakuzard Posted January 21, 2016 Author Share Posted January 21, 2016 I thought about mists respawnGroup, too. Imho this would lack the randomness of my approach. But nevertheless I might implement your idea as a second way of spawning things. This way you could choose to set up a group in the ME and let it respawn or to spawn some pre-configured random aircraft in. - Deutsche Tutorials und DCS Gameplay: youtube.com/Rakuzard | raku.yt/discord - Link to comment Share on other sites More sharing options...
Yurgon Posted January 21, 2016 Share Posted January 21, 2016 Wow, sounds really cool! :thumbup: Link to comment Share on other sites More sharing options...
wolf5 Posted January 21, 2016 Share Posted January 21, 2016 Easy, medium and hard may be same aircrafts so maybe put 6-8 aircrafts in ME then use a random. Or name each aircraft in group name "RTS_aircraft1", "RTS_aircraft2", etc. Put them in a table and use a random to spawn a group. People fly planes, pilots fly helicopters Link to comment Share on other sites More sharing options...
Recommended Posts