Jump to content

Trigger Help


DaleRFU

Recommended Posts

Hi all,

 

I am trying to set up a basic training flight where if I fly into a specific zone then an enemy aircraft will spawn in. So far I have 14 different enemy aircraft/formations of aircraft that I would like to randomly spawn in. Here is the issue though, If I fly through the zone once then a random aircraft will spawn in, if I kill that aircraft and then fly through that zone again another will spawn in, however if I kill that aircraft and fly through that zone again nothing spawns in. In an ideal world I want to be able to fly through the zone and spawn an aircraft to kill as much as I want. This is how my triggers are set at the moment:

 

Repetitive Condition > Part of coalition in zone, Falg is false(1), Random(5) > Group Activate (RedAir1)      <---- I have this 14 times, one for each aircraft/aircraft formation which gives me a random spawn in of the 14 combinations.

 

DCS Triggers.jpg

 

Then after those 14 lines of triggers I have;

 

Switched Condition > Group Dead (RedAir1) > Flag off (1)    <---The group dead section has "or" from RedAir1 through to RedAir14.

 

DCS Triggers 2.jpg

 

Any ideas what I can do?

 

Kind Regards

Dale


Edited by DaleRFU
Link to comment
Share on other sites

Hi, your issue is probably that at a point your mission ask for an already destroyed group to be activated - so nothing happens.
1) the trigger that sets flag 1 to off when a group is destroyed must be split in 14 "once" type triggers - for each 14 group destroyed you must also activate (set true) a distinctive flag ("specific group dead" flag) that prevents a destroyed group to be activated again.
2) the triggers that spawn a group should have in its conditions the "specific group dead" flag false.

Link to comment
Share on other sites

Don't use Repetitive Condition, use Switched Condition:

 

Mission start > no condition > Flag is true(1)

Switched Condition > Part of coalition in zone, Flag is true(1), Random(5) > Group Activate (RedAir1) , Flag is false(1)

Switched Condition > Group Dead (RedAir1) > Flag is true (1)   

 

 

Link to comment
Share on other sites

19 minutes ago, toutenglisse said:

Hi, your issue is probably that at a point your mission ask for an already destroyed group to be activated - so nothing happens.
1) the trigger that sets flag 1 to off when a group is destroyed must be split in 14 "once" type triggers - for each 14 group destroyed you must also activate (set true) a distinctive flag ("specific group dead" flag) that prevents a destroyed group to be activated again.
2) the triggers that spawn a group should have in its conditions the "specific group dead" flag false.

 

 Exactly, if a group is dead, then it can't be spawned again (only from ME).

 You will need LUA/MIST: https://wiki.hoggitworld.com/view/MIST_respawnGroup

Link to comment
Share on other sites

1 hour ago, toutenglisse said:

Hi, your issue is probably that at a point your mission ask for an already destroyed group to be activated - so nothing happens.
1) the trigger that sets flag 1 to off when a group is destroyed must be split in 14 "once" type triggers - for each 14 group destroyed you must also activate (set true) a distinctive flag ("specific group dead" flag) that prevents a destroyed group to be activated again.
2) the triggers that spawn a group should have in its conditions the "specific group dead" flag false.

 

Forgive me if I'm way off of the mark with any of the following.

 

1) Does this mean I need to have each "redair" group as it's own flag? So redair1 is flag 1, redair2 is flag 2 and so on?

 

So once that has happened I'd have something like:

 

Once > group dead (redair1) > flag is false (1)   <--- a separate trigger for each aircraft flags 1 to 14 become false.

 

Many thanks for the help guys.

Link to comment
Share on other sites

2 hours ago, dark_wood said:

Don't use Repetitive Condition, use Switched Condition:

 

Mission start > no condition > Flag is true(1)

Switched Condition > Part of coalition in zone, Flag is true(1), Random(5) > Group Activate (RedAir1) , Flag is false(1)

Switched Condition > Group Dead (RedAir1) > Flag is true (1)   

 

 

 

Would I add the mist/lua text in the last switched condition so that it will respawn if flag is false (1) happens again?

Link to comment
Share on other sites

1 hour ago, dark_wood said:

No, here: Switched Condition > Part of coalition in zone, Flag is true(1), Random(5) >Run script , Flag is false(1)

 

and on mission start you should load mist file, otherwise it won't work

 

This is great, you guys have really helped me here, it seems to be working. Thank you so much

Link to comment
Share on other sites

You don't strictly need to write any .lua for this. You can brute force it with the GUI, it just isn't especially pretty.

 

You basically add another layer of checks when a flag is called from your random roll to see if the group has already been activated (add another unique flag when a group is activated to reference.) If so, then re-roll the RNG and try again until eventually you're out of groups.

 

SWITCHED CONDITION -> FLAG EQUALS (1, 1) + FLAG IS FALSE (1001) -> GROUP ACTIVATE BANDIT 1 + FLAG ON (1001)

plus a second

SWITCHED CONDITION -> FLAG EQUALS (1,1) + FLAG IS TRUE (1001) -> FLAG OFF(1) + SET FLAG RANDOM VALUE (1, 1, 15)

 

Note that it is important to turn the flag back off before you re-roll, in the event the same number comes up twice the condition will not "switch."

 

If you want groups to be available more than once, though, you do indeed need to write some basic .lua code; fortunately there are some great user-created scripting libraries that make doing this exact thing a snap if that's the road you decide to go down.

 

 


Edited by feefifofum
Link to comment
Share on other sites

I would 100% encourage you to script this. I like using MiST for respawning units, and it's really easy. You can even use mist.teleportInZone to have them spawn in a random point in your trigger zone.

 

The possibilities this opens are endless. I regularly write little scripts like this, and have MiST assign a randomized route to the group that it spawns. The MiST documentation on hoggit wiki is really good https://wiki.hoggitworld.com/view/Mission_Scripting_Tools_Documentation

and so is there standard DCS wiki

https://wiki.hoggitworld.com/view/Category:Scripting

 

But for your purposes, the script would consist of one line.

 mist.respawnGroup("redAir" , true)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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