Jump to content

Recommended Posts

Posted (edited)

In a downloaded single mission I've seen groups randomization using flags in this way:

 

1st step = Flag 1 50% random + Flag 2 50% random

 

2nd step = if both Flags are true so start group A; if both false start group B; if F1 true and F2 false start group C; if F1 false and F2 true start group D.

 

I believe this is complex a bit. Making a dynamic mission in this way needs to spend a lot of time in programming.

Into old Janes' Fleet Command there were dynamic groups and to do this was quite easy:

 

1st step = create two groups with either different number and type of units and different position, each one with a X% of existence possibility.

 

2nd step = create one main group with 100% of existence possibility and the first two groups as unit into this one.

 

In this simple way, giving 50% of possibility for each group, you could have either one group or the other in the mission, changing mission's layout every time.

I'm not sure this could be achieved with triggering too and however not in a esasyer way.

Edited by Charlie_01
Posted

You cant randomize a location. You have to make a bunch of seperate groups around the map, then at mission start set a bunch of random flags to activate. Once the right flag is active then activate a specific group. It is rudimentary but it can work and with speeds stuff you can even get coordinates or location info to the correctly spawned group.

 

As far as a groups strength set each unit as skill "random". You cannot specify how many units will be in the group. However with each separate group you make in the editor at each different location you could make those a different size. So depending on which group gets activated, then each group is a different "strength".

 

Good luck.

Posted (edited)

You cant randomize a location. You have to make a bunch of seperate groups around the map, then at mission start set a bunch of random flags to activate.

 

It's just the same way you can do with dynamic groups too, as I said. The only difference to triggering flags is that with dg is a lot more simple way.

 

However with each separate group you make in the editor at each different location you could make those a different size. So depending on which group gets activated, then each group is a different "strength".

 

As I said again, it's the same that happens with dg.

The real difference between triggers and dg is about the programming effort to achieve this.

Using dg if having two groups, each with different location, size and kind of units and giving both a 50% of existence within a main group setted to 100% of existence probability, you are sure you'll find either one or another in the mission.

Triggering flags giving each group random existence at 50% doesn't make you sure you find at least one group in a mission. To achieve this you need to set 4 flags, each one for every flags' status combination (true-true; false-false; true-false; false-true).

I only hope ED would find an easyer way for next DCS module to make more simple ME programming...

Edited by Charlie_01
Posted

Ok so really there was no question. You just posted merely to voice that we dont have a dynamic setting of anykind.

 

Ok well one, these forums have a wish list thread, so if your complaining about something the game doesnt have that kind of stuff usually goes there. Although I will entertain your discussion for a few moments.

 

 

Janes is dead. We like to say its history. Old news. Falcon albeit still playable has been in the ground for a while. The simple fact is that dynamic engines are hard to build and we as players think it was easy but we had no idea about the nuts and bolts behind it. Turns out its really hard and time consuming and companies just cant justify spending (read wasting) money on it.

 

So its NOT going to happen. Its a dead request, the ED people have already stated that.. However what the game does have is to name a few: more realistic flight model, more realistic damage model, more realistic avionics, more realistic SAMs/AAA, better looking graphics, more realistic beautiful weather, more realistic failures, less forgiving realistic air-frame, more realistic munitions and some actual modeled systems. Not to mention the AI is the most advanced I've ever seen, even though they still kind of suck. When given orders, my wingman can clean house by himself!

 

Just to name a few.... More to the point, look those games sucked. And this ones doesnt, and you probably paid the same price for it too. 15+ YEARS AGO.:music_whistling:

Just my two cents, you may have a completely different opinion of the game than I. sorry I thought you were actually asking a question, guess I totally misunderstood.

Posted (edited)

Just my two cents, you may have a completely different opinion of the game than I. sorry I thought you were actually asking a question, guess I totally misunderstood.

Sorry, it's my fault: the thread's title should have to be "How randomize group's strenght and position IN A SIMPLE WAY?"

This only was the real queston I had, but my english is not good and I couldn't explain enough the real title question's content into the post.

 

I'd like to point out the ED mission is still far better and has more functionality and flexibility than the Jane's mission editors.

I agree too the DCS ME is more finctional than Jane's one, at least that's why the second is more than 10 years older!! I only need to know how I could build my own-built missions dynamic enough to enjoy playing it another time if I should fail the first flight.

I've played some downloaded SP missions, but rarely I've found one that shows enough changes when I fly it again after I was shot down on the first flight. Sometimes I had even to modify the original mission to give it a lot of "life" just from beginning!!

 

The simple fact is that dynamic engines are hard to build and we as players think it was easy but we had no idea about the nuts and bolts behind it. Turns out its really hard and time consuming and companies just cant justify spending (read wasting) money on it.

I'm not sure about this. As stated, Fleet Command is a very old game and it was very light in MBs but it had that.

 

However, hoping in next DCS module ED would find some way to make easyer the ME's programming, at this time I would know, e.g., if there is an easy way to randomize a doubled group. Unfortunately using "Random" Rule is not enough for full randomizing. Even setting 50% for both sub-groups this doesn't assure either one or another.

As I said, the only way I found into an heavy-triggered SP mission I've downloaded is as I said: flags, true-true, false-false, false-true, etc.

Out of all, as stated by ED itself in GUI manual (p. 74), "In a trigger-heavy mission, this can cost considerable CPU cycles and affect gameplay performance" and Event field's options list doesn't seem enough to avoid this issue at all.

Edited by Charlie_01
Posted (edited)

"Fleet Command is a very old game and it was very light in MBs but it had that."

 

A very major part of the difference in "MB's" between games now and then (though not all of it, of course) is the change in art assets. Higher detail = more megabytes of pictures, not code.

 

Also, "megabytes" is not a good way to figure out how complicated or difficult something is. Many freelance journalists get paid "per line" (I've worked on that format previously), but you do NOT want to judge programmer productivity in lines of code and resulting program size. Why? Because the hard part in programming isn't to make something do it's job - that's called a "hack" and works. The hard part is to make something do it's job efficiently. There's a similarity in software engineering and industrial engineering here: the engineers job isn't done when he finished adding parts; it's done when he finished removing the parts that weren't needed.

 

As for randomizing to get one or another group:

 

Flag1 = random50%

Flag1 = true -> Activate Group A

Flag1 = false -> Activate Group B

 

Many ways to do it and they're all very easy to do in the ME interface once you've figured out what things mean. The ME doesn't actually use "programming", all it asks you to do is to make a few logic statements. Something is on or off, and depending on what it is you cause something to happen.

 

EDIT:

As an aside to illustrate that you shouldn't stare yourself blind at size, consider the below picture:

 

full5.jpg

 

The pictureis 79 kilobytes in size, and is a screenshot of a game that is only marginally bigger than that: the WHOLE game is 97 kilobyte: graphics, sounds, everything. How they did that? Black magic pretty much. :P

Edited by EtherealN

[sIGPIC][/sIGPIC]

Daniel "EtherealN" Agorander | Даниэль "эфирныйн" Агорандер

Intel i7 2600K @ 4.4GHz, ASUS Sabertooth P67, 8GB Corsair Vengeance @ 1600MHz, ASUS GTX 560Ti DirectCU II 1GB, Samsung 830series 512GB SSD, Corsair AX850w, two BENQ screens and TM HOTAS Warthog

DCS: A-10C Warthog FAQ | DCS: P-51D FAQ | Remember to read the Forum Rules |

|
| Life of a Game Tester
Posted

Sorry again EtherealN, but I'm still looking for the simplest way to randomize group's location and composition.

I'm trying to follow your hint about random flag, but maybe I've lost some step. Maybe I'm going wrong, but seems impossible to make a random flag in one step only.

The only way I've found to achieve that needs at least three triggers a you wrote three lines:

1- TRIGGER - type=mission start; RULE - type=random, %=50; ACTION - action=set flag, flag=1.

2- TRIGGER - type=once; RULE - type=rflag is true, flag=1; ACTION - action=group activate, group=#1.

3- TRIGGER - type=once; RULE - type=rflag is false, flag=1; ACTION - action=group activate, group=#2.

 

Is that you meant or is there some more simple way with one trigger only? Maybe group activation trigger's type should be "mission start" too?

Apologize me, but flags' working is still something hard to fully understand for me... :cry:

Posted

That is fully correct as it stands. I don't think you need mission start on the groups either, that trigger will be "set off" by the first one switching the flag which is already at mission start. Setting the groups at mission start might however cause both to spawn at the beginning if the sim executes things in a wonky order for some reason.

 

Now, flags really aren't difficult once you get to know them. Down below they're just what's called a "Boolean" ( http://en.wikipedia.org/wiki/Boolean_data_type ), that is: a variable that can have one of two values: true or false (in computer speak: 1 or 0).

 

Flags operate triggers in the game simply through setting conditions, same way you might have a trigger set with trigger zone X, a unit in zone condition for the trigger, and then it activates something. In this case the "trigger", the "thing that sets it off", is the unit in zone. The flag is just an on-off switch that you can also use to set off triggers. (The light switch in your room is a boolean too: on or off. And the physical wiring of your electrical system makes it so that when that switch is "on", the light shines.)

 

The neat thing with flags is that using them you can create more complex behaviours, set multiple things off with a single trigger, so on and so forth. Could be multiple lights in your room, or multiple groups of tanks in the simulator. For example (if you excuse the presudocode):

 

Trigger Zone A: covering east approach

Trigger Zone B: covering west approach

 

Player in Zone A: Flag 1 True

Player in Zone B: Flag 2 True

 

Flag 1 True AND Flag3 false: Activate group A, Flag3 True

Flag 2 True AND Flag3 false: Activate group B, Flag3 True

Flag 3 True: Activate group C

 

The above would spawn different units on different flanks depending on which route the player takes (and can of course be adjusted to use more groups and more zones or whatever), effectively making the enemy commander respond to what the player is doing, and we also use the Flag3 condition such that only one flank can be activated: it is now possible for the player to "feint" the enemy into commiting to one flank, and then fly around and strike from the other. Then finally we use Flag 3 to activate a third unit, which might be SHORAD assets for the area or the target we want to kill or whatever.

 

But at it's simplest, a flag is just "on" or "off", that's all it is, and what will happen as a result of those flags is all up to you. You can actually make extremely complex things with it if you work hard - remember, computers are also just a collection of switches that can be on or off. (It's just that there's a couple hundred million of them, arranged brilliantly, and they switch really fast. :P )

 

I would however love to have some more freeform variable saving in the system, like custom numbers, custom text, and so on. Perhaps in the future. :)

[sIGPIC][/sIGPIC]

Daniel "EtherealN" Agorander | Даниэль "эфирныйн" Агорандер

Intel i7 2600K @ 4.4GHz, ASUS Sabertooth P67, 8GB Corsair Vengeance @ 1600MHz, ASUS GTX 560Ti DirectCU II 1GB, Samsung 830series 512GB SSD, Corsair AX850w, two BENQ screens and TM HOTAS Warthog

DCS: A-10C Warthog FAQ | DCS: P-51D FAQ | Remember to read the Forum Rules |

|
| Life of a Game Tester
Posted (edited)

This is my way of randomizing which one out of n groups will spawn. Only one group will spawn, each with the same chance to spawn. I do this with randomly located SAM sites in my missions.

 

At each trigger, perform random with a chance of 1/n to succeed, where n is the total number of groups in this randomization REMAINING to be picked, and if it is true, AND Flag1 is false, then spawn a group, and set Flag1 to true. Do this for the remaining groups, one trigger per. Make sure to put them in order, or it will not work. Examples follow:

 

Three groups:

MissionStart; FlagIsFalse(Flag1) And Random(33); GroupActivate(Group1), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(50); GroupActivate(Group2), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(100); GroupActivate(Group3), SetFlag(Flag1)

 

Six groups:

MissionStart; FlagIsFalse(Flag1) And Random(17); GroupActivate(Group1), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(20); GroupActivate(Group2), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(25); GroupActivate(Group3), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(33); GroupActivate(Group4), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(50); GroupActivate(Group5), SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(100); GroupActivate(Group6), SetFlag(Flag1)

 

The first FlagIsFalse test and last Random test may be omitted.

 

If you want to do the same thing, except for events happening later than mission start, e.g. activate group at time t, you can replace Flag1 with numerous flags, each mapping to separate events, then in the following trigger, test whether the previous flag was set.

 

Randomize the events:

MissionStart; Random(25); SetFlag(Flag1)

MissionStart; FlagIsFalse(Flag1) And Random(33); SetFlag(Flag2)

MissionStart; FlagIsFalse(Flag2) And Random(50); SetFlag(Flag3)

MissionStart; FlagIsFalse(Flag3) And Random(100); SetFlag(Flag4)

 

The last Random test may be omitted.

 

Perform the events:

Once; FlagIsTrue(Flag1) And WhateverRule(); PerformEvent()

Once; FlagIsTrue(Flag2) And WhateverRule(); PerformEvent()

Once; FlagIsTrue(Flag3) And WhateverRule(); PerformEvent()

Once; FlagIsTrue(Flag4) And WhateverRule(); PerformEvent()

 

Having said that, I agree with the fact that it would be nice with a cleaner way of doing this, where flag functionality could be extended to include more integer operations and boolean expressions.

Edited by LostOblivion

Nice plane on that gun...

OS764 P930@4 MBUD3R M6GB G5870 SSDX25 CAntec1200 HTMHW

Posted

Sorry EtherealN, but I've made a lot of tests and the random flag definitely doesn't work for me!!! Tryed either with "once" and "mission start" for groups trigger, but... nothing!!

 

Thx L.O, but I don't need to make many altenate groups with a lot of flags until I couldn't alternate only a doubled group!! They still spawn together every time!! It's very frustrating!!:cry::cry:

I hope at least ED would improve on next patch the "Practical Exercise" section into GUI manual with more examples about multiple flags settings... :(

 

I'll continue to examine a lot of downloaded missions trying to understand how to achieve my objective... If someone could help me in the meantime I would appreciate a lot.:helpsmilie::helpsmilie:

Posted

Charlie, on the properties of the group, ensure that you have delayed their activation time. There's a timer there already. If you do not do this, they will be spawned before the engine even starts looking at your triggers.

[sIGPIC][/sIGPIC]

Daniel "EtherealN" Agorander | Даниэль "эфирныйн" Агорандер

Intel i7 2600K @ 4.4GHz, ASUS Sabertooth P67, 8GB Corsair Vengeance @ 1600MHz, ASUS GTX 560Ti DirectCU II 1GB, Samsung 830series 512GB SSD, Corsair AX850w, two BENQ screens and TM HOTAS Warthog

DCS: A-10C Warthog FAQ | DCS: P-51D FAQ | Remember to read the Forum Rules |

|
| Life of a Game Tester
Posted (edited)

You cannot use Random with anything other than MissionStart, because Once will run every second or so until the conditions have been met. This means that if you put say Random(33) And TimeMore(600), the engine will test those conditions until they are true, i.e., Random(33) will run until it is true. This means you will have you to use Random in a MissionStart type of trigger, which will only run once, at the start.

 

I have a question. What is it you want to achieve?

Edited by LostOblivion

Nice plane on that gun...

OS764 P930@4 MBUD3R M6GB G5870 SSDX25 CAntec1200 HTMHW

Posted
You cannot use Random with anything other than MissionStart, because Once will run every second or so until the conditions have been met. This means that if you put say Random(33) And TimeMore(600), the engine will test those conditions until they are true, i.e., Random(33) will run until it is true. This means you will have you to use Random in a MissionStart type of trigger, which will only run once, at the start.

 

I have a question. What is it you want to achieve?

 

 

Once> Random && Flag X is False > Activate group && Flag X On.

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

Urgh, Once is so misleading in that aspect. Implies its only going to check the condition ONCE and thats it, not that it only executes the action once. <_< What if you want something to be determined by random ONCE and then not check it again, but not happen at mission start?

Posted (edited)
Once> Random && Flag X is False > Activate group && Flag X On.

The conditions in your trigger will eventually be true, and the group will always be activated, although it will only be activated once. In other words, this trigger is useless in that it does exactly the same as activating a group at start. To convince you this is the case, I invite you to try the following trigger. I have not tried it myself, but I am pretty sure the group will be activated eventually, although it might take as much as a couple of minutes before Random picks something that rare, seeing as Once appears to run every second or so.

 

Once; Random(1) And FlagIsFalse(Flag1); GroupActivate(Group1), SetFlag(Flag1)

 

Urgh, Once is so misleading in that aspect. Implies its only going to check the condition ONCE and thats it, not that it only executes the action once. <_< What if you want something to be determined by random ONCE and then not check it again, but not happen at mission start?

I wrote this in my previous post. You want to randomly set a flag using MissionStart and then check that flag later along with whatever rule that triggers the event. An example would be if you want to activate a group at 10 minutes with a 50% chance of spawning, you'd want the triggers below.

 

MissionStart; Random(50); SetFlag(Flag1)

Once; FlagIsTrue(Flag1) And TimeMore(600); GroupActivate(Group1)

 

But I agree, Once is misleading, and I've used Random with it before unaware of this behavour. Not sure if Random has any good use other than in a MissionStart type of trigger.

Edited by LostOblivion

Nice plane on that gun...

OS764 P930@4 MBUD3R M6GB G5870 SSDX25 CAntec1200 HTMHW

Posted (edited)
The conditions in your trigger will eventually be true, and the group will always be activated, although it will only be activated once. In other words, this trigger is useless in that it does exactly the same as activating a group at start.

 

But I agree, Once is misleading, and I've used Random with it before unaware of this behavour. Not sure if Random has any good use other than in a MissionStart type of trigger.

 

Heh, forgot to mention what made it useful. Admittedly, its better suited for "choosing between known actions." But I tend to just use it to spawn groups. A decent use for example; I first used this type of trigger logic in a unfinished mission in Black Shark where illumination flares were spawned at random over the combat area between 12 different zones. It breathed a little life into just watching the flares appear at different locations each time one was triggered. I used it in On Station to choose task types, and the specific task within a group. It created a mostly random order of tasks every time.

 

If you use it multiple times and simply change the group that spawns.

 

Once> Random && Flag X is False > Group AI on A && Flag X On.

Once> Random && Flag X is False > Group AI on B && Flag X On.

Once> Random && Flag X is False > Group AI on C && Flag X On.

...

 

and so on. It basically picks randomly from a list that are all linked by a common flag at runtime within a mission rather than at the start. Useful if you want to use the same targets but mix up the order. I also like to use it to create random patrols where groups have a habit of stopping every few minutes to choose another group to start a patrol.

 

More often than not, I also like to do the inverse of it to, where I set a flag to true to begin the random selection and then turn it off so I can define when I want it to randomly make a choice.

 

One could also use "Random && Flag is Less than X" as the conditions with a "flag increase" action to spawn a very specific number of groups at random. So if you wanted to have 20 possible groups, but only 5 spawn, you would set "random && flag x is less than 5" as the condition, with the flag increasing by a value of 1 each time. Could even get creative with things and associate different values to different types of groups. For example a SAM network could have TORS consist of a higher point value, and AAA be a low point value. With the random selection you might get several tors with very few AAA, or almost all AAA and very few Tors. The purpose of this setup is to A. Create an easily defined approximate force composition for the enemy. B. Create a very easily adjustable value to spawn enemies based on the wants of the end user.

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

Ah yes, if you use it with more than one trigger that checks and sets the flag, then I see how it would do the trick. Correct me if I am wrong, but you use it like the way below to spawn any one out of 3 random groups, correct?

 

Once; Random(33) And FlagIsFalse(Flag1); GroupActivate(Group1), SetFlag(Flag1)

Once; Random(33) And FlagIsFalse(Flag1); GroupActivate(Group2), SetFlag(Flag1)

Once; Random(33) And FlagIsFalse(Flag1); GroupActivate(Group3), SetFlag(Flag1)

 

It is still quite a hack though, since after one has succeeded, neither of the remaining ones will ever be true, and thus the engine will continue to spend time testing the conditions fruitlessly, and certainly this would put a lot of useless stress on the engine, especially if heavy rules are among them, e.g. PartOfCoalitionInZone.

 

Although my version does the same thing without the overhead mentioned, it will not work if you wish to turn these random events on again at some point when using Continuous or SwitchedCondition like you said. But if you have many triggers, and this randomization needs only be done indeed once, then it is probably preferable to avoid using this method.

 

Admittedly, I see many uses for it, like the one you mentioned, with randomizing force advancement. What do you do, though, do you set the flag to true again once a group has reached a zone, and then activate another group for advancing? Sounds like a good idea. :)

Edited by LostOblivion

Nice plane on that gun...

OS764 P930@4 MBUD3R M6GB G5870 SSDX25 CAntec1200 HTMHW

Posted

A simpler method to randomise one or more groups spawning than flag 1, 2. if 1 & 2 then x, if not 1 & 2 then y etc is : set a random flag value between at start to say between 1 & 10, then use if flag value less than & more than to get groups (singly or multiples) to spawn off the flag between value (if >0 & <3, spawn 'a', if >2 and < 7, spawn 'b' (or 'b' and 'c') etc. You can control the probability with this, not just have random amongst a fixed set of probabilities..)

You can use the same system triggered by a flag (that is in turn triggered by a continuous low probability) to randomly turn on & off groups AI - to get pauses in patrols or make battling groups 'last longer' once they engage (as above)

Cheers.

Posted

I think the overhead of checking a single on/off operation within the mission is so minuscule it doesn't really matter. It would take hundreds, if not thousands of triggers setup like that to see any negative performance impact within a mission. Where-as simply adding in a single AI group will likely have a far greater impact. That said I wish there was a "garbage can" for the triggers or perhaps an event trigger under switched conditions that lasts for a set period of time before no longer being checked.

 

Attached is the test mission I used to create the random patrols from On-Station. I used a combination of mission goals and triggers to have only 2 moving groups at once. The key point of this is that all units are "active" all the time and I simply give them a hold command. Each patrol moves for approx 15 minutes + a slightly random variable. When a patrol stops it picks from the currently available patrols in the list. Once a patrol is chosen it is removed from the list until it randomly stops. You may want to adjust the "time since flag" conditions to speed things up abit to get an idea of how it works.

Random Patrols.miz

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 think the overhead of checking a single on/off operation within the mission is so minuscule it doesn't really matter. It would take hundreds, if not thousands of triggers setup like that to see any negative performance impact within a mission.

 

I'm not sure who that's directed at ?

 

If me - it has nothing to do with overheads - it's just that having tried both methods (using multiple triggers & using combinations of their states to drive spawning, or using a single multi-state trigger & using the various states of the one trigger to drive spawning), the one I mentioned above is easier to set up & allows more versatility...

Cheers.

Posted

Yay for the ambiguity of forum threads. I was continuing the discussion between Lost Oblivion and myself. To be honest Weta, my reply had nothing directed purposely toward your post or method you discussed. However, your example does lack some clarity, care to share some pseudo code or a sample mission so I can figure out precisely what you are describing?

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)

Sorry, was at work & had a quick moment while something was running & thought I'd get a post in - it was a bit rushed & hard to follow - & to make things worse I haven't actually read the whole thread, so could be repeating something above as well as being slightly OT... Having skimmed it, this may be a bit simple for the thread...

 

So what I meant was:

Rather than doing what I used to & using something like :

Mission start Random (50) flag 1 true

Mission start Random (50) flag 2 true

 

then

 

Flag is false 1 and Flag is false 2, trigger action A

Flag is false 1 and Flag is true 2, trigger action B

Flag is true 1 and Flag is false 2, trigger action C

Flag is true 1 and Flag is true 2, trigger action D (or A+B etc)

 

where

 

2 initial triggers gets 4 equally likely & mutually exclusive states

3 initial triggers gets 8 equally likely & mutually exclusive states

 

I now use :

Mission start Flag set random value (5,1,10)

 

then

 

Flag is less (5,2) and Flag is more(5,0) trigger action A

etc,

Which means I can get any number of equally likely states (up to 100) off 1 trigger, or a smaller number of non-equally likely states, and can (by choosing how the size of the gap between the less than & more than) explicitly change the likelihood of specific events happening.

 

Additionally if there's a continuous random flag with a low probability,

continuous random (2%) set flag 10

then

Continuous Flag 10 true, Flag set random value (5,1,10), Flag 10 false

then

Continuous Flag is less (5,3) and Flag is more(5,0) trigger action Group_1 AI on

Continuous Flag is less (5,5) and Flag is more(5,2) trigger action Group_2 AI on

Continuous Flag is less (5,7) and Flag is more(5,4) trigger action Group_1 and Group_2 AI on

Continuous Flag is less (5,11) and Flag is more(5,6) trigger action Group_1 and Group_2 AI off

 

or however many groups you want coming on or off or states to change, and however you want to spread the %ages..

Add other flags to bring these into or out of action...

Edited by Weta43

Cheers.

Posted

Awww, gotcha. Can't blame ya for ditching the old true-false system. I just hated it for being limited to powers of 2.

 

But I see where you are coming from with that setup. Pick a random number and then a "Select Case" type of condition. Yeah that works to. Its a little annoying to setup without a "flag = x" or "flag in range x-y" but its still functional. It does have the added benefit of having multiple conditions within a given range. For example, flag is between 5-8 do A, but if flag = 7, also do B.

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

  • Recently Browsing   0 members

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