AKA_Clutter Posted December 17, 2013 Posted December 17, 2013 All, What I would like to do is to setup a mission where the groups that spawn are somewhat random. As an example, I would like to set it up so that there are four different groups, one of which is activated randomly at the mission start. I know that I could use Mission start --> Random 25% --> Flag On 1, or the Condition statement when adding a new unit. However, it is my understanding that I did this for the four groups, there is a chances that more than one group would spawn. I would like to set it up such that ONLY one groups would spawn. The way I have done this in the past is to use two flags with random set to 50% and then do a truth table to set another four flags. Example: Mission Start – Random 50% - Flag On 1 Mission Start – Random 50% - Flag On 2 Mission Start – Flag 1 True & Flag 2 True - Flag On 3 Mission Start – Flag 1 False & Flag 2 True - Flag On 4 Mission Start – Flag 1 True & Flag 2 False - Flag On 5 Mission Start – Flag 1 False & Flag 2 False - Flag On 6 This appears to me to be a brute force way of doing what I want to do and am wondering if there is a better way to do this? Should I look into doing this via Lua? Thanks AKA_Clutter ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
mwd2 Posted December 17, 2013 Posted December 17, 2013 (edited) http://en.wiki.eagle.ru/wiki/Mission_Editor:_Randomization or via lua: http://forums.eagle.ru/showpost.php?p=1176947&postcount=2 Edited December 17, 2013 by mwd2 Playing: DCS World Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof. Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh Ghost0815
AKA_Clutter Posted December 17, 2013 Author Posted December 17, 2013 Thanks! ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
ENO Posted December 17, 2013 Posted December 17, 2013 AKA- a good way I do it is set a flag random value at the mission start- between 1-100. Then I do a flag value less than 26 then flag 1 is true. Flag more than 25 and less than 51 then flag 2 is true... etc. That way you can ensure that only 1 ever spawns in- and you can set the values for how ever many groups you want. Just remember when you are setting a "more than" it is not "equal to and more than... so if you want to set 25, you need to do equals 25 or "more than 24" and "less than 26." I find that works. Normally I would teleport groups to random zones, or move groups to random zones... but that isn't working reliably in MP... the server side works, but then clients don't see the units unless they came in after the move happened. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Wrecking Crew Posted December 17, 2013 Posted December 17, 2013 If you want four states then try this - Mission Start, Action Flag 4 Random Min 1 Max 4. Flag 4 will then be 1-4. WC Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
Grimes Posted December 18, 2013 Posted December 18, 2013 http://en.wiki.eagle.ru/wiki/Mission_Editor:_Randomization or via lua: http://forums.eagle.ru/showpost.php?p=1176947&postcount=2 Druid's code was created on an older version of the scripting engine, actually its a version that was before the scripting engine was a supported feature. So its slightly out of date. Specifically trigger.setUserFlag needs to be changed to trigger.action.setUserFlag From the wiki article and to answer the main question of the thread; triggers are a quick and easy way to accomplish randomization. You can use more complex possibilities with lua like changing the spawn position of a specific group or making the group travel to a random position once they spawn. But generally speaking triggers will be enough to get the results you are looking for. I personally think the true/false method is overly complex and I much prefer any of the "from list" set of triggers to accomplish the same sort of thing but with more flexibility. 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
AKA_Clutter Posted December 18, 2013 Author Posted December 18, 2013 I agree that the TRUE/FALSE method is overly complex. I originally used that back when there was ONLY KA-50, so haven't looked into the new options in the ME. Thanks for all the great ideas! ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
ENO Posted December 18, 2013 Posted December 18, 2013 If you want four states then try this - Mission Start, Action Flag 4 Random Min 1 Max 4. Flag 4 will then be 1-4. WC I feel like an idiot... That's definitely easier than my way- and will be the way I do it from now on lol. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
MagicBra Posted December 18, 2013 Posted December 18, 2013 You can also use a simple mist respawninzone() function and specifying more than one zone at mission start. It will place your group in one of those zone and can also randomize the units positions. VEAF - Virtual European Air Force- www.veaf.org Association européenne de simulation évoluant sur DCS, BMS et ArmA3. Nous rejoindre : http://www.veaf.org/fr/association/formulaire-de-contact
Wrecking Crew Posted December 18, 2013 Posted December 18, 2013 That's a funky chicken, MB! Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.
ENO Posted December 18, 2013 Posted December 18, 2013 It is cute in a cutesy sort of way. And yes chicken, I had mentioned that but also there were issues with that function in the MP environment. Hopefully 1.2.7 fixed those issues! "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
number3 Posted December 20, 2013 Posted December 20, 2013 It is cute in a cutesy sort of way. And yes chicken, I had mentioned that but also there were issues with that function in the MP environment. Hopefully 1.2.7 fixed those issues! That's correct. Basically anyone how joins after the respawn occurs, will see a message saying that they destroyed a building. While the host sees a message that they destroyed the actual unit. I haven't tested this with 1.2.7 however. My workaround was to create a group for every possible zone where units could appear. Set each of those groups to late activation in the ME. Then in my script if the event it triggered I activate the unit using trigger.action.activateGroup(Group group). 314-я смешанная авиационная дивизия 314th Mixed Aviation Division: The "Fighting Lemmings"- Forums: http://314thsquadron.enjin.com/ - ED Forum Group: http://forums.eagle.ru/group.php?groupid=119
Recommended Posts