Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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

Posted

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.

Posted

 

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 ServerScripting Wiki

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

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

Posted

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.

Posted
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

Posted

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

Posted
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

  • Recently Browsing   0 members

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