Jump to content

Mission Editor - Hot Tips


MadTommy

Recommended Posts

Here's a few tips I've discovered while building my latest mission:

 

If you spawn an AWACs, even very far away, then ships on that AWAC's side will start engaging enemy targets out to their max engagement range.

 

The speed in the "Unit speed lower than" condition is in units of METERS PER SECOND.

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Link to comment
Share on other sites

  • 5 months later...
Here is a simple way to do the "or" modifier...

 

For example you want to check whether Unit 1 or Unit 2 are death:

 

CONTINUOUS / FLAG IS FALSE (1) / SET FLAG (1)

FRONT CONDITION / UNIT ALIVE (Unit 1), UNIT ALIVE (Unit 2), TIME SINCE FLAG (1,1) / CLEAR FLAG (1)

ONCE / TIME SINCE FLAG (1,2) / MESSAGE ("Unit 1 or Unit 2 is death")

 

 

Hello,

it's working even more simple:

 

CONTINUOUS / UNIT ALIVE (Unit 1), UNIT ALIVE (Unit 2) / SET FLAG (1)

ONCE / TIME SINCE FLAG (1,5) / MESSAGE ("Unit 1 or Unit 2 is death")

 

As long as ALL units live, Flag 1 gets set once per second cause of the CONTINUOUS trigger.

As soon as ONE unit dies (which I want to detect = this is the OR) the flag 1 doesn't get updated anymore.

Flag 1 now becomes a steady flag (former it was re-set every 1 second), now the TIME SINCE FLAG 5 seconds gets triggered.

 

The most simple OR you can implement from ingame editor I think.

 

BR

Rob

Link to comment
Share on other sites

  • 11 months later...

Ai stop circle

 

Hello,

 

I am trying to have AI planes circling waiting for my order to launch a sead attack.

 

I cannot figure out how to stop them circling and continuing the route except with the time ?

 

Could you help ?

 

thanks in advance and best regards,

Cobra


Edited by cobragva
Link to comment
Share on other sites

In the Orbit adv options choose STOP CONDITIONS: there is the "IS USER" option: that should be read as "FLAG IS TRUE". So if you type a flag number (limited to 1-99) in the digit spaces, the Orbit will terminate when that flag will be activated.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • 8 months later...

@Grimes please

 

Hello Grimes

 

I am struggling with trying to get some random to happen in my mission making (especially with trying to get groups to spawn at random time, or occurence) and I saw your post earlier about your RANDOM OCCURENCE GENERATOR and I must say that I dont understand at all the logics... Can you explain in other terms, taking for granted that I am way too slow for your kind of brains...:( seriously, I really would like to understand... and I feel I am missing something

 

Here is your generator quotation :

2. Continuous Random

I created this method because I was tired of the unseemly high probability that existed with the "Lock Method" of returning true values on first lock didn't feel very random to me. While testing it I had the first lock set to 20% and for whatever reason it returned true way more than 20% of the times I tried it. So with some thought I decided to do the opposite.

 

This method works by setting a larger sample size (more than just 1 random value) and giving it a lower probability each time its sampled. I randomly generate a true value for 2 different flags. When the sample is finished we compare the results and use it to create a "If-Case" like statement. In this instance the options are.

Flag 1 - Flag 2

True- True

True- False

False- True

False- False

 

Flag 0 is a between time condition. Its only if Time is More than 5 seconds and Time is Less than 20 seconds.

 

Once >Time is More (5) and Time is Less (20) > Set Flag (0) to True

Once> Time is More (20)> Clear flag 0

Continuous>Flag 0 (True) and Random (5) > Set Flag 1 True

Continuous>Flag 0 (True) and Random (5) > Set Flag 2 True

 

This trigger is used to check the results. In other words until flag 9 is true non of the conditions will be checked. Since flag 9 is set true after 22 seconds only 1 trigger below will execute.

Once>Time is more (22) >Set Flag (9)

 

Conditional Triggers would appear like

Once> Flag 9 (true) and flag 1 (true) and flag 2 (true)>Condition True -True

Once> Flag 9 (true) and flag 1 (true) and flag 2 (false)>Condition True -false

Once> Flag 9 (true) and flag 1 (false) and flag 2 (true)>Condition false -True

Once> Flag 9 (true) and flag 1 (false) and flag 2 (false)>Condition false -false

 

Since the assignment of flag 1 and 2 is continuous. You can add even more randomness to it by clearing said flags any time during or after contiously random timeframe.

 

thanks a lot!

[sIGPIC][/sIGPIC]

In DCS I fly jets with thousands of pounds of thrust...

In real life I fly a humble Cessna Hawx XP II with 210 HP :D

Link to comment
Share on other sites

Sorry to bump this thread but anyone knows how to use and how does work this random occurence generator by Grimes? I just dont understand it...

[sIGPIC][/sIGPIC]

In DCS I fly jets with thousands of pounds of thrust...

In real life I fly a humble Cessna Hawx XP II with 210 HP :D

Link to comment
Share on other sites

Sorry I missed the post earlier. But you should just ignore that whole idea I had posted back in 2009. There are so many better ways to do it now. Here are two:

 

Random List

 

This method is essentially the same as "picking from a list" of possible choices. As you see below there are 3 triggers, each do the same basic thing, the only difference is the group each trigger activates. The status of flag 1 will either allow or deny these triggers from evaluating.

 

I use random 5% because it takes more time for the random% to become true. As a result it creates a more "randomized" distribution of choices.

 

Once> Random 5% and Flag 1 is False> Activate Group 1, Set Flag 1 True

Once> Random 5% and Flag 1 is False> Activate Group 2, Set Flag 1 True

Once> Random 5% and Flag 1 is False> Activate Group 3, Set Flag 1 True

... etc

 

When one of these triggers are true, it will activate a group and set flag 1 to true. With flag 1 true the other two triggers cannot execute. You can later set flag 1 to false for it to pick another group.

 

A slight evolution of the same idea would be this:

Once> Random 5% and Flag 1 is Less than 2> Activate Group 1, Flag 1 Increase 1

Once> Random 5% and Flag 1 is Less than 2> Activate Group 2, Flag 1 Increase 1

Once> Random 5% and Flag 1 is Less than 2> Activate Group 3, Flag 1 Increase 1

etc...

This logic will always pick 2 groups at random.

 

Random Value

This method uses the "Set Flag Random Value" trigger action to get a random number.

 

Once> Time more than 1 second> Set Flag 1 Random Value. (Min 1, Max 3)

Once> Flag 1 Equals 1> Activate Group 1

Once> Flag 1 Equals 2> Activate Group 2

Once> Flag 1 Equals 3> Activate Group 3

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

Link to comment
Share on other sites

I think if I get some time i might go through this thread, copy the still relevant tips out to a new thread, and ask a moderator to unsticky this and sticky the new one.

 

So many outdated tips here.

i5-3570K @ 4.5 Ghz, Asus P8Z77-V, 8 GB DDR3, 1.5GB GTX 480 (EVGA, superclocked), SSD, 2 x 1680x1050, x-fi extreme music.



TM Warthog, Saitek combat pro pedals, TrackIR 4

Link to comment
Share on other sites

Tanks for the answer, GRIMES.

Can You explain how you would use triggers and randomization to make groups appear at a random moment in the mission? At the beginning I thought that a continuous trigger with a 1% (minimum) random would do the trick, but it needs only around 250 ciycles (4 minutes) and all groups are spawned:( is there a way to do this with a smaller random chance of occuring?

 

 

thanks for your continuous help!!!

[sIGPIC][/sIGPIC]

In DCS I fly jets with thousands of pounds of thrust...

In real life I fly a humble Cessna Hawx XP II with 210 HP :D

Link to comment
Share on other sites

Tanks for the answer, GRIMES.

Can You explain how you would use triggers and randomization to make groups appear at a random moment in the mission? At the beginning I thought that a continuous trigger with a 1% (minimum) random would do the trick, but it needs only around 250 ciycles (4 minutes) and all groups are spawned:( is there a way to do this with a smaller random chance of occuring?

 

 

thanks for your continuous help!!!

 

Well you just flip the state of the flag. Whenever you want it to make a choice, set flag 1 to true. This will allow it to make only one choice at whatever point in the game you want it to.

 

Once> Random 5% and Flag 1 is True> Activate Group 1, Set Flag 1 False

Once> Random 5% and Flag 1 is True> Activate Group 2, Set Flag 1 False

 

 

The other example sort of already does this:

Once> Condition for whenever you want to make a random choice> Set Flag 1 Random Value. (Min 1, Max 3)

Once> Flag 1 Equals 1> Activate Group 1

Once> Flag 1 Equals 2> Activate Group 2

Once> Flag 1 Equals 3> Activate Group 3

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

Link to comment
Share on other sites

Sorry Grimes

 

I have been very busy with work.

Thanks for your patience, I will try to make it useful in my mission building!

thanks

[sIGPIC][/sIGPIC]

In DCS I fly jets with thousands of pounds of thrust...

In real life I fly a humble Cessna Hawx XP II with 210 HP :D

Link to comment
Share on other sites

  • 2 weeks later...

Hi, i have a small question

I have a mission for A10s, with a defined target in waypoint 4. I want to add to each of the clientes extra mission waypoints that are not plan of the flight plan, to put there things like "suspected AAA" or "Enemy troops" or somehting like that.

 

Within the sim it is just a matter of adding some mission waypoints and then just turn the STEERPOINT knob to Mission and it will display those extra waypoints.

is there anyway of adding those mission waypoints from the editor?

Or do i have to fly in "prepare mission" mode and save the extra waypoints?

if i do it that way, can i do it with one client and then go back to the editor and copy and paste?

 

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

@ ALL THAT RANDOM TALK: With all the randoms, isnt there a chance that NOTHING will happen at all? :-/ That is kind of a turn down for me. Carefully placing and programming triggers and then they all trigger false and nothing spawns. That is my fear of working with random trigger conditions. You just cant control them.

 

 

 

 

Guys

 

Do any of you have a quick way of determining if a bridge has been destroyed? I have had a few attempts based on having a vehicle nearby that will presumably get destroyed if the bridge is hit, thus triggering a flag. Seems a bit fiddly to me.

 

There is a good way with SLmod. It checks if a map object within an area has been destroyed.

 

ED in their original missions use following method:

 

put 2 inf at both sides of the bridge. If 1 of them gets damaged the bridge explodes and a flag gets set.

 

Unfortunately you can just gun run the infantry and the bridge will suddenly blow. :P

 

Hi, i have a small question

I have a mission for A10s, with a defined target in waypoint 4. I want to add to each of the clientes extra mission waypoints that are not plan of the flight plan, to put there things like "suspected AAA" or "Enemy troops" or somehting like that.

 

Within the sim it is just a matter of adding some mission waypoints and then just turn the STEERPOINT knob to Mission and it will display those extra waypoints.

is there anyway of adding those mission waypoints from the editor?

Or do i have to fly in "prepare mission" mode and save the extra waypoints?

if i do it that way, can i do it with one client and then go back to the editor and copy and paste?

 

Thanks

 

There is no way to add certain waypoints to specific clients via the "mission prepare" option. It will set the waypoints for ALL clients. What you can do though is just add waypoints in the flight plan of each unit. :-/ As far as I know that is the only way to get what you seem to want.


Edited by Megagoth1702

[sIGPIC][/sIGPIC]

System specs:

2500k @ 4.6 GHz

8GB RAM

HD7950 OC'd

Win7 x64

 

Posting tracks to make your DCS better - attention bump incoming!

Link to comment
Share on other sites

@ ALL THAT RANDOM TALK: With all the randoms, isnt there a chance that NOTHING will happen at all? :-/ That is kind of a turn down for me. Carefully placing and programming triggers and then they all trigger false and nothing spawns. That is my fear of working with random trigger conditions. You just cant control them.

 

If you use the "Set Flag Random Value (Min, Max)" action, then you're guaranteed that the flag's value will be an integer between the minimum and maximum specified, so it's a very easy way to get randomised behaviour without the risk of nothing getting triggered.

 

An alternative (if you're using a bunch of individual flags) is to have a trigger with conditions set to activate if all of the flags are false, to provide a fallback option.

 

However, bear in mind that triggers of type "once" will be evaluating constantly until they become true. So a trigger with a condition of "random 1%" will eventually be activated, it just might take a while. This is why these kinds of conditions are usually protected with a sentinel flag, i.e. each one also has a condition "flag X is false" and when any is activated, "set flag X true" to prevent any of the other triggers from activating.

 

You can also add an or part to the trigger conditions, using "time more than X" or "time since flag more than X" to ensure one of the triggers is activated within a certain time frame, if that's important for your mission.

Link to comment
Share on other sites

Thank you. I know about the "set random value" method. It's very useful. :)

 

What I did NOT know was that triggers keep running until they are finally "true". Thanks!

 

 

What I am wondering now - in a lot of ED's missions you have "random 50" condition on a "mission start" trigger. As far as I know "mission start" triggers only check once at time 0, they don't keep running.

 

So I wonder there - is there a chance of nothing spawning at all?

 

Check this mission from the a-10 campaign.

 

I mean sure, with random 50 you are probably sure that SOMETHING will spawn out of all these groups... But can you be REALLY sure? Or are ED exploiting something there, maybe the limitation of a computer never being ... really random? Since it's a computer? I am still not sure if I got to the bottom of this.

 

Thanks in advance.

Push - 7-1.miz

[sIGPIC][/sIGPIC]

System specs:

2500k @ 4.6 GHz

8GB RAM

HD7950 OC'd

Win7 x64

 

Posting tracks to make your DCS better - attention bump incoming!

Link to comment
Share on other sites

A simple Lua method to create random numbers in the SSE.

-- Change the values in the 2 variables lowest_flag and highest_flag 
--    to the flag values you wish to use in your mission
--  call this code just once

local lowest_flag = 100
local highest_flag = 120

---------------------- DO NOT EDIT BELOW THIS LINE ------------

local total_flags = 1 + (highest_flag - lowest_flag)
local flag_table = {}

-- create an ordered table of the required flags 
for x = 1, total_flags do           
flag_table[x] = lowest_flag + (x-1)
end

-- then randomise its order 
function randomiseTable(tableName)
 local temp_table = {}
 local index = -1
 while #tableName > 0 do
   index = math.random(1,#tableName)
   table.insert(temp_table,tableName[index])
   table.remove(tableName,index)
 end
 return temp_table
end

flag_table = randomiseTable(flag_table)

-- the table called flag_table now hold a random flag table

 

To execute flags off the flag table, call this code (in this example you can call it 20 times, as I have set flags 100 to 120)

if #flag_table > 0 then 
  trigger.action.setUserFlag(flag_table[1], true)
  table.remove(flag_table , 1)
end

i7-7700K : 16Gb DDR4 2800 Mhz : Asus Mobo : 2TB HDD : Intel 520 SSD 240gb : RTX 2080ti: Win10 64pro : Dx10 : TrackiR4 : TM Warthog : ASUS ROG SWIFT PG348Q

Link to comment
Share on other sites

THank you druid. I am currently using Grimes' version of your script from this post. But yours looks a bit more detailed and flexible.

 

Now back to my question: what I am asking is the "random 50" in particular. Am I right that there is a chance of nothing or everything spawning at once? Since it's "random".

 

Also - since Computers are not "random" is random 50 actually 50%?

 

Stuff like that.


Edited by Megagoth1702

[sIGPIC][/sIGPIC]

System specs:

2500k @ 4.6 GHz

8GB RAM

HD7950 OC'd

Win7 x64

 

Posting tracks to make your DCS better - attention bump incoming!

Link to comment
Share on other sites

What I did NOT know was that triggers keep running until they are finally "true". Thanks!

Just to make sure it's clear, that applies to the "ONCE" trigger types. Basically their conditions are evaluated every time the triggers are run (approx. once a second) until they become true, at which point the actions are executed and the trigger deletes itself. So the "ONCE" refers to "One activation", not "consider these conditions once".

 

'CONTINUOUS ACTION' triggers don't delete themselves after they run, and continue to be evaluated every second, running their actions whenever the conditions are true. So, they're exactly like "once" triggers, just without the self-deletion aspect.

 

The 'SWITCHED CONDITION' triggers function somewhat like continuous triggers, but have some extra code that prevents them from running their actions again until their conditions evaluate as false, at which point it is 're-armed' and will run its actions if it evaluates as true again.

 

The 'MISSION START' triggers are only run once, i.e. "evaluate these conditions when the mission starts, then forget it ever existed".

 

Now back to my question: what I am asking is the "random 50" in particular. Am I right that there is a chance of nothing or everything spawning at once? Since it's "random".

Yes you are right in thinking that. Hence, if it really matters, you would want to use flags to limit the number of things that can be spawned, or force some things to spawn if there's not enough. Or an alternative approach would be to populate the mission with some activated-at-start groups (i.e. they will always be there) as the core mission elements, and then the random things can be used to add some variation to the mission to keep people on their toes.

 

Also - since Computers are not "random" is random 50 actually 50%?
In the long term it'll probably average out to 50/50, pseudo-random number generators of the type games typically use are pretty good. However it's of course possible to get a random sequence generating even the same number over and over 100 times in a row. Unlikely, but possible if it's truly random.

 

So the short version: the designers of that particular mission aren't relying on any special tricks, but rather the bell curve - most times that mission is run, a 'medium' amount of those groups will be activated. Probably the mission design is such that they felt the edges of the bell curve don't really matter, i.e. the mission would still be fun even if all those random groups spawned, or if none of them did.


Edited by nomdeplume
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I am busy with an Air Race mission where I would like a massage to be displayed to pilots every time they cross the same trigger zone(start for instance). This message will display the time since they crossed that trigger zone previously.

 

Any Ideas?

Midnite Signature.jpg

552334314_MidniteSignature.jpg.7c1678ea5639bd6d044b092eb97c300e.jpg

Link to comment
Share on other sites

Generaly speaking:

It can be easily done. I see a problem with different message for every pilot. You can choose display message to coalition, all or nation. If you want to have different message to each pilot then every pilots must be from different coalition (2 players) or nation ( more players)

 

When pilot reach the start zone then do: Increase flag 1 by 10 every second. (This will provide time measurement with accuracy on 1 decimal position). Thenn you create triggers if mission time > 10, show message for nation: Your time is flag 1.

 

When pilot reach finish you stop increasing flag 1.

 

He will see for example: your time is 315 which means: 31,5 s.

[sIGPIC][/sIGPIC]

.....Vladimir, let's go to Sukhoi.......

Link to comment
Share on other sites

  • Recently Browsing   0 members

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