maverickturner Posted September 25, 2018 Share Posted September 25, 2018 I'm having trouble finding out how to use lists/dynamic lists of units. I have 10 individual (not grouped) units off to the side of the map that I would like to clone into a zone when a trigger is met. However, I'm looking to set each trigger with a specific number of units to clone from the 10 units available. Example - If flag1 == 1 then grab 6 random units from the unit list and clone in zone1 If flag2 == 1 then grab 4 random units from the unit list and clone in zone2 I've been searching around for this and believe I am just missing something very simple to understand. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
feefifofum Posted September 25, 2018 Share Posted September 25, 2018 Check out the CASCAP Infinity .miz; does exactly this thing. THE GEORGIAN WAR - OFFICIAL F-15C DLC Link to comment Share on other sites More sharing options...
maverickturner Posted September 25, 2018 Author Share Posted September 25, 2018 That is perfect! Thanks for sending me in the right direction. Link to comment Share on other sites More sharing options...
Hardcard Posted September 26, 2018 Share Posted September 26, 2018 (edited) Your question got my curiosity going and I ended up creating the attached demo mission (it uses MOOSE, though). Instead of 10 individual units, there are 8 different group templates (4 group templates of 6 units each and another 4 group templates of 4 units each). The group templates of 6 units are set to spawn randomly in zone1 only. The group templates of 4 units are set to spawn randomly in zone2 only. Flags and flag checkers are used to manage the whole thing, but, for convenience, I've created a simple F10 menu command structure for the two client Su25Ts in the mission , so you can spawn the groups at will. I've also added a cleanup routine, which will remove previously existing groups in the other zone every time a new group template spawns. Try it out, see if you find something interesting that can be used in your mission.Randomized template spawn on trigger - command.mizSpawn random group templates in different zones.lua Edited September 26, 2018 by Hardcard [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Zayets Posted September 26, 2018 Share Posted September 26, 2018 The units are in the same group? Like the initial 10 units because if not then it should be easy to do it but the the drawback is that tasking must be done for each group individually. [sIGPIC]OK[/sIGPIC] Link to comment Share on other sites More sharing options...
fargo007 Posted September 26, 2018 Share Posted September 26, 2018 Your question got my curiosity going and I ended up creating the attached demo mission (it uses MOOSE, though). Instead of 10 individual units, there are 8 different group templates (4 group templates of 6 units each and another 4 group templates of 4 units each). The group templates of 6 units are set to spawn randomly in zone1 only. The group templates of 4 units are set to spawn randomly in zone2 only. Flags and flag checkers are used to manage the whole thing, but, for convenience, I've created a simple F10 menu command structure for the two client Su25Ts in the mission , so you can spawn the groups at will. I've also added a cleanup routine, which will remove previously existing groups in the other zone every time a new group template spawns. Try it out, see if you find something interesting that can be used in your mission. I wasn't interested in the actual topic, but after looking at the lua, I like what you did here. Making a template table and then operating off a SET_GROUP prefix filter based on the values is something I hadn't considered. Thanks for revealing another kung fu move. Have fun. Don't suck. Kill bad guys. https://discord.gg/blacksharkden/ Link to comment Share on other sites More sharing options...
Hardcard Posted September 27, 2018 Share Posted September 27, 2018 @fargo007 Glad you found it useful. Working with SET_GROUPs and iterators makes it all better! Btw, this was my first time using template tables to spawn groups randomly, I like it quite a lot, it's a keeper! :thumbup: [sIGPIC][/sIGPIC] Link to comment Share on other sites More sharing options...
Recommended Posts