Jump to content

Failing to make a proper Mission Editor respawn system


Mith86Arg

Recommended Posts

Hey there!

 

Im new flying DCS, and even more as a mission maker here, but im trying to learn.

 

Found myself in a problem cuz i'm confused about if a flag is keept as TRUE or FALSE after being used...

 

The mission goes like this:

 

At start:

Create 2 radio elements:

1,1 (for naval units)

2,1 (for ground units)

RVsP6UY.png

 

thats (for try and error) makes that when i use the desired "radio call" makes TRUE one of those flag...

 

so i did this:

Switched trigger

If flag is 1,1 (or 2.1) AND my AJS-37 is outside of the "BASE" trigger zone, then make a new flag (·5) with 1-11 randomness to spawn

TXK4o8n.png

 

Now if i start my mission just like this, EVERYTHING runs perfect, BUT only for 1 spawn, i can spawn 1 random ground unit or a naval one,

 

Thought that the FLAG system "checks" if i was outside the "BASE" trigger zone and "if yes" then EVERYTHING was TRUE while i was outside that trigger, and then when i RTB and going inside that trigger again it become FALSE again resetting the whole "spawn system" but i'm missing something cuz i can't spawn more units.

 

 

Can anyone help me?

 

Link to my Frankenstein if needed

Link to comment
Share on other sites

Found myself in a problem cuz i'm confused about if a flag is keept as TRUE or FALSE after being used...

 

Hola,

 

The flags keep their latest state ... if you set it to TRUE, it stays in that state until you explicitly change it to FALSE.

 

Same with numeric FLAGS, they keep their last assigned value.

 

Best regards

 

Eduardo

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Rudel has it.

 

I'm not looking at your .miz at the moment, but it sounds like you are setting a flag to a random value using a radio item, which triggers a group to spawn?

 

So you'll need to do a couple things -

 

First, whenever you activate your radio item, reset the flag to OFF as part of the next trigger or it will work only once as you've experienced.

 

Second, each group can only be activated once, so include a check to see if the flag has already been set to that value and if it has, re-randomize the value so an unused group is selected.

 

Third, once the random flag's value has activated the group, you must also reset THAT flag because if the same number is rolled twice it will not activate a switched condition.

 

 

Should look something like this;

 

First we add the radio command-

RADIO ITEM ADD (Generate enemy vehicle group, 1)

Then we add a condition to check when the radio item has been activated

 

3 SWITCHED CONDITION (Radio activated, NO EVENT)

--

FLAG IS TRUE (1)

--

SET FLAG RANDOM VALUE (100, 1, 10)

FLAG OFF (1)

 

Then we do the group spawns, with a check if it has already been activated

 

3 SWITCHED CONDITION (Spawn ground group 1, NO EVENT)

--

FLAG EQUALS (100, 1)

FLAG IS FALSE (101)

--

MESSAGE TO ALL ('Enemy vehicle group detected at X')

GROUP ACTIVATE (ground group 1)

FLAG ON (101)

 

 

If group 1 has already been activated (which we can tell because we set flag 101 to true when that happened) we re-roll the value. Remember to turn the spawn flag back off before re-rolling because if the same value is generated twice, it isn't considered a "switch" to that value.

 

SWITCHED CONDITION (re-roll if group 1 active)

--

FLAG EQUALS (100, 1)

FLAG IS TRUE (101)

--

FLAG OFF (100)

SET FLAG RANDOM VALUE (100, 1, 10)

Link to comment
Share on other sites

Rudel has it.

 

I'm not looking at your .miz at the moment, but it sounds like you are setting a flag to a random value using a radio item, which triggers a group to spawn?

 

So you'll need to do a couple things -

 

First, whenever you activate your radio item, reset the flag to OFF as part of the next trigger or it will work only once as you've experienced.

 

Second, each group can only be activated once, so include a check to see if the flag has already been set to that value and if it has, re-randomize the value so an unused group is selected.

 

Third, once the random flag's value has activated the group, you must also reset THAT flag because if the same number is rolled twice it will not activate a switched condition.

 

 

Should look something like this;

 

First we add the radio command-

RADIO ITEM ADD (Generate enemy vehicle group, 1)

Then we add a condition to check when the radio item has been activated

 

3 SWITCHED CONDITION (Radio activated, NO EVENT)

--

FLAG IS TRUE (1)

--

SET FLAG RANDOM VALUE (100, 1, 10)

FLAG OFF (1)

 

Then we do the group spawns, with a check if it has already been activated

 

3 SWITCHED CONDITION (Spawn ground group 1, NO EVENT)

--

FLAG EQUALS (100, 1)

FLAG IS FALSE (101)

--

MESSAGE TO ALL ('Enemy vehicle group detected at X')

GROUP ACTIVATE (ground group 1)

FLAG ON (101)

 

 

If group 1 has already been activated (which we can tell because we set flag 101 to true when that happened) we re-roll the value. Remember to turn the spawn flag back off before re-rolling because if the same value is generated twice, it isn't considered a "switch" to that value.

 

SWITCHED CONDITION (re-roll if group 1 active)

--

FLAG EQUALS (100, 1)

FLAG IS TRUE (101)

--

FLAG OFF (100)

SET FLAG RANDOM VALUE (100, 1, 10)

 

f8a.gif

 

TY Rudel and feefifofum, im going to check everything again ASAP. :smartass: :thumbup:

Link to comment
Share on other sites

It's probably not what you want to hear, but a script employing MOOSE or Mist could do this so much cleaner & easier.

 

If this is the type of thing you are going to be doing in the future, maybe it's time to drive straight in, instead of a very, very long way around it.

 

There are so many tutorials now, it's never been easier.

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

It's probably not what you want to hear, but a script employing MOOSE or Mist could do this so much cleaner & easier.

 

If this is the type of thing you are going to be doing in the future, maybe it's time to drive straight in, instead of a very, very long way around it.

 

There are so many tutorials now, it's never been easier.

 

Actually, i know that! but in the process of learning i cant start running with moose or mist, IMO i needed to first learn to walk with the ME, lol wasn't even understanding how the flag system was working :)... that's my reason for keep smashing my head on the mission editor.

 

BTW the mission got even bigger.... and now uses scripts too! see? :smartass::lol:

 

 

I'm using LUA's for JTAC, Mist for spawn units, and Moose (atm im having a big problem here) for spawn a massive "all out war"

 

so... if someone wants to help here and throw me some light, it would be RLY nice :book:

------------------------------------------------------

 

MOOSE PROBLEM NEXT:

I created a "perimeter" with 3 trigger zones (name: scramble)

5 groups called "Scramble01", "Scramble02", "Scramble03", "Scramble04" and "Scramble05"

 

I created 1 LUA file for each group with this code inside:

 

Scramble01 = SPAWN:New( "Scramble01" )
:InitRandomizePosition(true,1000,5)
 :InitLimit( 1, 101 )
 :SpawnScheduled( 30, .5 )

 

Then, on the mission editor i did a trigger

ONCE > "if part of blue coalition goes inside trigger zone scramble 01 OR 02 OR 03" > then ... do script:

SpawnGroup = Scramble01:Spawn()

 

Cloned that 4 more times for each scramble group.

 

aaaaaaand nothing.... nothing happens on mission, the trigger DO WORK (an alarm sound and a message on screen is telling me that) but the code itself is not working, no units spawned at all...

 

h0SX0bE.jpg

 

There is a 60 seconds countdown after the Scramble trigger starts, that makes blue units to spawn with the same MOOSE method and start looking those scramble groups for kill 'em all.

 

I liked that script cuz works with a stack of units, each one respawning 0 ~ 30 seconds after the first one is KIA in a random position (1000 meters from starting point in this case)

 

 

Link to my mission file.... it's a mess, but it's



giphy.gif

https://drive.google.com/open?id=1y2M0RdzX2FhO55cjXhdpMLb95ufUWYZW

 

TY in advance for all the help guys!!!


Edited by Mith86Arg
Link to comment
Share on other sites

The log file inside the saved games folder?

 

https://drive.google.com/open?id=1x2V--gl6vWU-pwfDNnNmU4_dDrjn5smw

 

that one?

 

-------------------------

 

There was a Typo on the "Do script" when triggered....

 

SpawnGrou[b][i][size="6"]N[/size][/i][/b]p = Scramble01:Spawn()

 

FIXED. still not working. lol


Edited by Mith86Arg
Link to comment
Share on other sites

If you tell us what you want to do, exactly, we can show you ways of scripting it.

 

Personally, I don't own the PG map, so I can't even open your mission in ME.

However, if you post a Caucasus / Nevada version (using standard DCS units, preferably), I'll be happy to show you how to convert all your ME triggers into a single script.

 

PS. The way flags (and other things) are handled in ME is pretty confusing and unpractical, if you ask me.

One of the advantages of scripting is that it allows you to easily keep track of logic and structure (once you know the basics, that is).

 

I mean, scripting is already worth it by the simple fact that it frees you from those endless ME trigger lists (where finding stuff alone becomes a challenge).

It doesn't just empower you, it saves plenty of time and helps you keep your sanity :D

Link to comment
Share on other sites

If you tell us what you want to do, exactly, we can show you ways of scripting it.

 

Personally, I don't own the PG map, so I can't even open your mission in ME.

However, if you post a Caucasus / Nevada version (using standard DCS units, preferably), I'll be happy to show you how to convert all your ME triggers into a single script.

 

PS. The way flags (and other things) are handled in ME is pretty confusing and unpractical, if you ask me.

One of the advantages of scripting is that it allows you to easily keep track of logic and structure (once you know the basics, that is).

 

I mean, scripting is already worth it by the simple fact that it frees you from those endless ME trigger lists (where finding stuff alone becomes a challenge).

It doesn't just empower you, it saves plenty of time and helps you keep your sanity :D

 

Too late sr, i'm already in an endless espiral of madness, burnt my days off just doing the same thing over and over over and over, trial and error, rinse and repeat.

 

//Switched: MADNESS Mode ON
///Cond: Unit "MITH86ARG" write 30+ words normally | FLAG OFF 666
////Action: FLAG ON 666 | Say MSG TO ALL: "but hey! already learned a lot! i can get better! yes? i can? ofc i can! rly!? hell yeah!!!. :huh:"

/// Switched: MADNESS Mode OFF + reset
///Cond. FLAG ON 666 | Time is more 5 seconds
////Action FLAG OFF 666

 

But i'm going to swap the map when i get home. :thumbup:

Link to comment
Share on other sites

I can't open it because I don't have the A4. When requesting assistance it's always a good idea to distill the issue down past all the mods to make it easy for people to comment and see the issue.

 

Some thoughts unseen:

 

Make sure MOOSE is the first thing loading, and in a MISSION_START trigger.

 

Second, Make sure your script is the second thing loading, also in a MISSION_START trigger.

 

No conditions on either.

 

I point out that what you want do do if you want the spawns to begin on a trigger is (in this case) NOT call :SpawnScheduled() in the script but in the trigger (DO_SCRIPT) itself. e.g.

 

Scramble01:SpawnScheduled(30,.5)

 

You are starting the spawn as soon as you call SpawnScheduled().

 

Your spawn objects should also be declared as local in the script.

 

There should also be one script. There's no reason to separate each spawn into a different lua script of its own. Just list them all one after the other.

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

I looked at it, and there are a lot of very basic architectural things wrong with it.

 

#1 of these: --- You are not loading MOOSE at all. No wonder why it's not working. It has to be loaded as the first trigger as MISSION_START.

 

After that, as I wrote before, should be all your spawn declarations in a single script.

 

Trigger #1 - Load moose as MISSION_START

 

Trigger #2 - Load the moose script with all your moose stuff in it as MISSION_START

 

Trigger #3 - Load Mist with a TIME_MORE of 3 seconds.

 

... then all the rest.

 

 

Also pointing out that you should be loading mist on its own trigger with a TIME_MORE condition.

 

Banner EDForum2020.jpg

Have fun. Don't suck. Kill bad guys. 👍

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

I looked at it, and there are a lot of very basic architectural things wrong with it.

 

#1 of these: --- You are not loading MOOSE at all. No wonder why it's not working. It has to be loaded as the first trigger as MISSION_START.

 

After that, as I wrote before, should be all your spawn declarations in a single script.

 

Trigger #1 - Load moose as MISSION_START

 

Trigger #2 - Load the moose script with all your moose stuff in it as MISSION_START

 

Trigger #3 - Load Mist with a TIME_MORE of 3 seconds.

 

... then all the rest.

 

 

Also pointing out that you should be loading mist on its own trigger with a TIME_MORE condition.

 

MOOSE.LUA is the INIT script.- tought i need to put it there only. K. OMW. Ty for the tips.-

Link to comment
Share on other sites

  • Recently Browsing   0 members

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