Jump to content

Recommended Posts

Posted

I've never got this to work to my satisfaction. I must be missing something simple.

 

I want to create 3 separate radio messages containing separate target data for the player. One of these messages will appear when the principal target has been destroyed. I'd like there to be an equal chance of any one of these messages appearing, or for it to be random, but the same message should not show every time, or more often than the others, and more than one message should never be generated. Can someone give me broad-stroke guidance then I will get to work in the ME? Thanks!

Posted

Play Message Conditions > Set Flag 10

 

(Both Switched Condition)

Flag 10 is True && Random 30% && Flag 1 is False > Set Flag 1, Flag 10 Off, Play Message A

Flag 10 is True && Random 30% && Flag 2 is False > Set Flag 2, Flag 10 Off, Play Message B

 

Switched Condition > Flag 1 is True && Flag 2 is False > Flag 1 Off, Flag 2 Off

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 always wondered how to do 3 actions based on 33% chance each, here is what I did:

 

mission start /timemore than 1/ setflag1 false

once / random33 and timemore than 2 / setflag1 true and make (action 1)

once / random33 and timemore than 3 and flag1 is false / setflag1 true and make (action 2)

once / random33 and timemore than 4 and flag1 is false / make (action 3)

 

But I'm not quite sure about the ratio of chance of each condition, can someone confirm it is good or correct me?

L'important n'est pas de tuer, mais de survivre.

[sIGPIC][/sIGPIC]

 

 

 

if you read this you are too curious

 

 

Posted (edited)

But I'm not quite sure about the ratio of chance of each condition, can someone confirm it is good or correct me?

 

Hope this explains things ...

All trigger types, except for "mission start" are evaluated about once every second. A "random 10%" condition means that each time the trigger is evaluated there is a 10% chance it will be true. If the condition is purely "random X" it will keep evaluating until the trigger becomes true. The time it takes is based on the percent chance it can occur.

 

"once", "switched condition", and "Continuous" only governs on how the trigger will react when the condition is true.

 

So there is no "ratio" that exists naturally between multiple random conditions. You can create a ratio... in my first example you could change the % values around to make 1 of them more likely to appear.

 

 

To make something with a 33.33 (repeating of coarse, lol) trigger function simply use my example from the earlier post and give all 3 options an equal percent chance of occurring.

Edited by Grimes

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

Thanks, guys.

 

With your response, Grimes, I think I hit the mother-lode as, having played your missions, I know you are a guru of ME randomised conditions.

 

This stuff does not come easily to me but I'm going to fiddle about with it before I hit you with too many pesky follow-up questions.

 

Just to clarify though:

 

- How many separate left-column entries in the 3-column ME trigger menu does your suggestion involve? I can't tell if it's 2 or 3.

 

- Does your sample above call for 1 of 3 radio messages to play, or 2, i.e. "A" and "B"?

 

If you don't mind, I might send you a screen shot of the entries I make for this, as it might save me HOURS of futzing about.

 

Thank you.

Posted

or just post the screenshot here :)

 

- it may help other people

and/or

- other people may help you

 

so its one of these situations where you can only win by doing it, and not loose anything by doing it ;)

Democracy is choice, not freedom...

Posted

Each line in pseudo code is its own trigger. I simplified my original explanation because I think I miss-read exactly what you were trying to do, but that doesn't matter since its super easy to add an additional message. I'll explain how everything works below:

 

Its a very simple premise where it randomly picks a trigger from a list.

 

In practice the first trigger allows all of the triggers with random values to be evaluated as "true" and once chosen and "choice" prevents another trigger from also becoming true.

 

Play Message Conditions > Set Flag 10

Basically use this trigger to allow a choice to be made. Flag 10 allows all of message selection conditions to be true.

 

(Both Switched Condition)

Flag 10 is True && Random 30% && Flag 1 is False > Set Flag 1, Flag 10 Off, Play Message A

Flag 10 is True && Random 30% && Flag 2 is False > Set Flag 2, Flag 10 Off, Play Message B

Flag 10 is True (Allows it to happen)

Random x% (Allows there to be a choice)

Flag Y is False (Used to prevent repeats)

 

Actions

Set Flag 1 [Flag 1 On] is used to remove that option from the list.

Clear Flag 10[Flag 10 off] is used to prevent other options from being chosen.

 

Switched Condition > Flag 1 is True && Flag 2 is True > Flag 1 Off, Flag 2 Off

 

Resets the "list". (I had a typo in there, Flag 2 was supposed to also be true). Technically this trigger is not entirely needed. If you wanted a purely random choice to occur you could get rid of it. But this allows for each message to get played and then resets (allowing all to be randomly played) again.

 

To add "message C" simply copy message B and change a few variables. And also add Flag 3 to match the other flags conditions and variables.

Flag 10 is True && Random 30% && Flag 3 is False > Set Flag 3, Flag 10 Off, Play Message C.

 

 

So you need 1 trigger to start it + X number of options + 1 to reset the list.

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 (edited)

HA, I think I got it!

 

Could I ask you to take a look at this very simple .miz? It contains nothing but the player's aircraft, a trigger zone and the list of triggers, conditions and actions syntax you kindly supplied, applied in the Triggers menu. I was struggling with the first trigger but I think I got it. Would appreciate verification.

 

Thanks, Grimes. You are the resident expert with this stuff and this will add a whole extra layer to my mission design.

Edited by Bahger
Posted

I left it blank because it can be whatever you want it to be. Whenever you want the message to play just set flag 10 to true. If its more than once use a switched condition.

 

You can have a message play whenever an aircraft enters a zone, or when it leaves a zone, or if a specific unit gets killed, or at a pre-defined time interval.

 

Looking at the file everything looks good except you are missing the Flag 2, 3 is false in their respective conditions. Although there is a practical application to doing so. Basically by doing it that way you force message A to be played once but allow the other messages to be played multiple times (given that 1 option is chosen at least twice in a row)

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

Got it, Grimes, thanks for your patience. Your way of doing this works beautifully, the message generation really seems random. Thanks!

 

I made the changes you mentioned in your last para above -- I was in too much of a hurry and left those conditions out by mistake -- and have updated the file in case it is of interest to anyone else as a quick demo of how to trigger random conditions.

  • 3 weeks later...
Posted
Got it, Grimes, thanks for your patience. Your way of doing this works beautifully, the message generation really seems random. Thanks!

 

I made the changes you mentioned in your last para above -- I was in too much of a hurry and left those conditions out by mistake -- and have updated the file in case it is of interest to anyone else as a quick demo of how to trigger random conditions.

 

Thanks for updating your miz. This will really help me for what I am doing

Posted

I am still struggling with a trigger to end the mission:

 

- player has completed 2 mission assignments out of the available three, no more can be given

 

- Player flies back to the hold waypoint to resume CAP

 

- 60 sec after the above, I want to trigger an "RTB" message. I have tried setting unique flags (100, 200 and 300) on completion of each mission and then putting all possible combos of the 3 (100 & 200 OR 100 & 300 OR 200 & 300) in the conditions field with the "Unit in zone plus 60" condition, but it doesn't work. Any ideas?

 

Mia389, since posting the updates posted helps you -- as well as making poor Grimes sob into his breakfast -- I will post another one soon.

Posted

I am doing something very similar. This is what I planed on doing.

 

Trigger

Once / time more than 2/ Flag 350 ON

 

Random mission/task complete trigggers (Im sure you have triggers for each random task completion)

Add this to each ones action

Increase Flag 350, 1 (Adds 1 to 350)

 

Trigger

once/ Flag is more than (350, 2 ) / set flag 351 on

 

Trigger

once/ unit in zone && Flag 351 true / set flag 352 on

 

Trigger

once/ time since flag 352 is 60/ message "RTB"

 

That is what I planed on doing with my mission. I have not gotten that far though. I have 10 task in mine and clients will get 4 out the 10. So my trigger will be 350 is more than 4. I think my theory is correct.

 

You could give it a try. Like I said I have not gotten that far yet. Thanks to this post I got the random stuff down!!

Posted

Mia is mostly correct.

 

However, if you want 4 missions to run, "flag is more than 3 means that 4 run"

Flag is more than 4 = 5

 

Bahger, post what you have now and I can take a look at it sometime today to figure out what might be wrong.

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 (edited)

Thanks very much indeed, Grimes. I think I have solved the RTB trigger using three-line OR conditions -- it worked when tested today -- but I'd be grateful for your input re. the other (and probably only remaining) issue, which I mentioned in the another thread here, i.e. whether ambiguity in the logic pertaining to Flag 10 can, in certain circumstances, cause the player to be assigned another target before he has completed the previous assignment. My intent is for the player to have to return to the CAP and remain there for 30 seconds before another target is given. Posting file now, thanks, as ever.

 

(The file is 1.97 MB because it is almost finished and contains 2/3 of the radio voice files.)

Edited by Bahger
Posted

Say, we have two FLAGs --> 4 possible Missions, the randomize will give you Mission 3 for the first run.

For the 2nd. run you want on of this left three missions - is it possible to jump up on the trigger list in the ME or must i define this in a new trigger?

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

Posted

Thanks for clearing that up Grimes. I cant wait to get that far haha. Bahger are you gonna share that when your done? I can't wait to give it a try!

Posted (edited)

Mia, see above, .miz uploaded. I don't think I am as mathematically advanced as you...and Grimes is in a whole other league.

 

Mwd2, see Grimes' response to my similar question re. randomised mission allocation in another thread here. He lays it out pretty clearly.

Edited by Bahger
Posted

Well you need to change the conditions that activate flag 10.

 

Here is an idea... Once the player takes off (or just make it time more than 1 second) You set Flag 50 to true.

 

Edit the "Trigger Trigger" Trigger (heh) to be "Player inside zone AND flag 50 is true> Flag 10 On (Delete Flag 50 on in this trigger)

 

In each selection trigger delete the "Flag 50 is true" condition, but keep the "flag 50 off" action.

 

This means that flag 50 represents whether a mission can be chosen. At the start flag 50 is true, thus it can pick a mission. Once a mission is chosen flag 50 is turned off. Once said mission is completed, 50 is turned back on again.

 

 

On a side note you do have some over complicated bits of triggers set up. For instance the "time since flag 4 is 30" and "Flag 20 is less than 2" conditions can each be moved to the "Play mission" trigger. This is because they are the same between the 3 triggers they are used in. Essentially moving them to that trigger collapses them into a single flag value, in this case "10." When flag 10 is true, since its only set by those conditions, it means that those conditions are also true. Does that make sense?

 

Flags 11, 12, and 13 don't actually do anything as flag 1, 2, and 3 void their purpose. Although I really liked the idea you used there of iterating the "teens." Wherein the value of the flag indicates different stages for a given mission. Kudos on the good idea :D

 

For the "RTB" trigger you could simply use "time since flag 4..." and Flag 21 is greater than 1. Make it so flag 4 only gets cleared when flag 10 gets set to true and flag 21 iterates +1 whenever a mission gets completed. This simplifies it so it makes adding additional missions alot easier to set RTB conditions for. The more missions you add the bigger the headache to figure out a combination, simple "blanket" triggers tend to work the best to get around this.

  • Like 1

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

Thanks so much, Grimes, I genuinely understand most of this logic, patiently explained by you, so I think I may be getting the hang of it, although I will never be a logician. Just to verify: when you refer to the "Play mission" trigger, this is my "Trigger trigger" trigger, right?

 

Thanks again.

Posted
Thanks so much, Grimes, I genuinely understand most of this logic, patiently explained by you, so I think I may be getting the hang of it, although I will never be a logician. Just to verify: when you refer to the "Play mission" trigger, this is my "Trigger trigger" trigger, right?

 

Thanks again.

 

 

Lol, yes. The one with the "'trigger trigger' trigger zone". :P

 

Learn next, will you, naming conventions padawan.

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've already named every individual in a squad of grunts after my high school class of --- gulp --1976. It makes the debrief more meaningful if your danger-close CBU delivery killed half of them.

  • Recently Browsing   0 members

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