Jump to content

Recommended Posts

Posted

First of all, a necessary premise: I'm a total ME noob, learned a bit about it through editing other people's mission and just messing around, but never really systematically learned everythings there is to know about it.

So, I have a training mission I use and I wanted to spawn random convoys; I created four of them, gave them waypoints that make them go in a roughly circular flow around Kobuleti, then I set up a trigger zone ("Spawn Convoy") with a 1 NM radius more or less in the center of this circle. Since i want to avoid triggering the zone while one convoy is active, I tried the following to inhibit the trigger zone unless no target is around:

1) Mission Start (Initialize Flags) ---> NO CONDITION ---> Set Flag value (1, 0); Set Flag value (100,1) // flag 1 randomize the convoy spawned, flag 100 is to inibhit the trigger zone

2) Repetitive action (Reset Convoy Control Flag, ON DESTROY) ---> Group dead (Convoy 1) OR Group dead (Convoy 2) OR Group dead (Convoy 3) OR Group dead (Convoy 4) --->Set Flag Value (100,1) // every time a target convoy group is destroyed, Flag 100 is reset to 1 and the trigger zone is active again

3) Switched condition (Randomize Convoy) ---> part of coalition in zone (Blue, Spawn Convoy, Airplane) AND Flag equals (100, 1) ---> Flag set random value (1, 1, 4) // if any blue aircraft is inside the Spawn convoy trigger zone and the control flag (100) is 1, then the program set a random value for flag 1, which is used to spawn a random convoy

4) Switched condition (Spawn Convoy 1) ---> Flag equals (1, 1) ---> Group activate (Convoy 1) AND Set flag value (100, 0) AND Set flag value (1, 0) // this instruction is repeated 4 times, one for each of the convoys, of course changing what has to be changed; if flag 1 as a value of 1, the first convoy is spawned and the control flag (100) is set to zero, so that if any blue aircraft, during the attack, passes through the trigger zone nothing happens, and the spawn flag (1) is set to zero, so that, after destroying the current target convoy, when a blue aircraft is passing through the trigger zone (which should be reactivated by the above instruction 2), the spawn flag is randomly reset to a value of 1 through 4 and can spawn a new convoy.

The trouble is when i test the mission, after initially spawning as intended, after a while (usually after 3 convoys are dead) nothing happens anymore... I checked all the lines, I didn't spot any typo that might mess things up. So, the questions are: what am I doing wrong? Is there another way, possibly an easier way, I can achieve the same result?

Posted
33 minutes ago, Gianky said:

...The trouble is when i test the mission, after initially spawning as intended, after a while (usually after 3 convoys are dead) nothing happens anymore...

I suppose that, after a while, trigger tries to activate of a group that has already been destroyed, so nothing happens.

The solution can be to use Mist to respawn by script.

Download Mist here GitHub - mrSkortch/MissionScriptingTools: Mission Scripting Tools for Digital Combat Simulator

(Click on green button "code" and download zip)

Unzip, in your mission add a "mission start" trigger with no condition and "do script file" as action, select the Mist lua file (mist_4_5_106.lua).

in your Spawn trigger, replace Group activate actions by "do script", and write (or copy/paste - Ctrl+C/Ctrl+V) in the box : mist.respawnGroup('Convoy 1', true)

repeat for all groups.

Posted

Make the spawn event a repetitive action that only stops when there are targets in the zone. This why if it chooses an invalid value, it will just keep going.

 

Random Select Trigger.miz

  • Thanks 1

Awaiting: DCS F-15C

Win 10 i5-9600KF 4.6 GHz 64 GB RAM RTX2080Ti 11GB -- Win 7 64 i5-6600K 3.6 GHz 32 GB RAM GTX970 4GB -- A-10C, F-5E, Su-27, F-15C, F-14B, F-16C missions in User Files

 

Posted

As luck would have it, just after posting I saw the newly uploaded video from Suntsag about trigger zone removals, so I think I got that part; as a matter of fact, when I tried the mission again all four group spawned as intended. On the other hand, after I destroyed them all, nothing more spawned, which bring me to this:

2 hours ago, toutenglisse said:

I suppose that, after a while, trigger tries to activate of a group that has already been destroyed, so nothing happens.

I was convinced that the game actually spawns a new "clone" of the group after the first one is destroyed and the triggers reactivate, but I now realize that it just activates the group I created, once they're all destroyed, there's nothing more to spawn.

So, is there no way for the program to "clone" the group, without using an external scripting language? Can I create a lua script inside the ME?

Posted
9 minutes ago, Gianky said:

...So, is there no way for the program to "clone" the group, without using an external scripting language? Can I create a lua script inside the ME?

There is no way with ME only, except creating enough groups to never lack of them.

You can create a script in ME. I think the easiest way to respawn your groups at will is the way I described using Mist respawn function.

  • Thanks 1
Posted (edited)
6 hours ago, Gianky said:

I was convinced that the game actually spawns a new "clone" of the group after the first one is destroyed and the triggers reactivate, but I now realize that it just activates the group I created, once they're all destroyed, there's nothing more to spawn.

If the excellent Mist overwhelms you because it requires some Lua programming on your side, perhaps try DML's "clone zones" (see here); they can be triggered with flags. 

 

Edited by cfrag
Posted

Cfrag, thank you for your input, it looks like a very interesting idea and a really handy set of tools for mission design.

I just downloaded everything, I'll give it a try, even though, I have to say, I don't know if learning Lua would be quicker than reading your nifty 319 pages manual! 😄

Posted (edited)
25 minutes ago, Gianky said:

I'll give it a try,

Don't let that manual overwhelm you, that's just my boastful ego talking Look at the Attack of the CloneZ demo, and read the doc on that demo mission in the manual. The rest should be quite simple: you'll find that you probably only need 3 modules, not the whole shebang. And of course I'm happy to assist 🙂

Edited by cfrag
Posted (edited)

@cfrag I need some help: I set up the mission mixing ME triggers and DML zones, probably something's wrong.

I have 2 mission start triggers, one to load the DML modules (dcsCommon, cfxMX and cfxZones), one to create the ME flags I'm using.

Then I have a

Switched condition (Randomize Convoy) ---> part of coalition in zone (Blue, Spawn Convoy, Airplane) ---> Flag set random value (1, 1, 4)

to randomize the convoy that it's being activated. Then for each convoy I created a

Switched condition (Spawn Convoy X) ---> Flag equals (1, X) ---> Group activate (Convoy X) AND dev Zone_increment_size (Spawn conovy, -6069) AND message to coalition (Blue, "An enemy convoy just entered the killbox", 15, false, 0) AND Set flag value (1, 0)

to activate convoy n. X of the four I created. Finally, there's a

Repetitive action (Reset Convoy Spawn zone, ON DESTROY) ---> Group dead (Convoy 1) OR Group dead (Convoy 2) OR Group dead (Convoy 3) OR Group dead (Convoy 4) ---> dev Zone_increment_size (Spawn conovy, 6069)

that reset the spawn area (or, more correctly, the trigger zone that activate the convoys) to its original size and allow the player to activate the next convoy.

As for DML clone zones, I created the four convoys with their waypoints, then I put a zone over each of them, using the following attributes:

cloner

onStart ---> true (I know it's deprecated, but I didn't understand how to use the raiseFlag module for this)

method ---> inc

flag! ---> ActivateConvoyX

clone? ---> ActivateConvoyX

empty! ---> ActivateConvoyX

Now, when I try the mission, modules appears to be load correctly (dcsCommon and cfxFlags, at least, cfxMX says something like "0 groups processed successfully"), passing through the "Spawn convoy" zone activates a random convoy and when I destroy it, the "Spawn convoy" zone is expanded again and I can activate the next convoy. Unfortunately, after all four have been activated and destroyed, passing once again throught the "Spawn convoy" zone triggers the message to coalition, but no convoy spawns; based on this, I'm afraid I didn't configure DML Clonezones correctly, can you tell me what to do? I swear I read the effing manual! (Pssst, maybe update the tutorial mission, getting rid of the deprecated functions! 😉 ) Thank you in advace for what'll you do!

Edited by Gianky
corrected typos
Posted

Most likely (I'm happy to look at the .miz if you pm it to me) you are looking at one of the following small issues (onStart is fine, btw, just not as elegant 🙂)

  • I think the suspicious activity is the "Group Dead" guard you are using. These conditions look at groups that don't exist: a cloner creates a template from the group, and then deletes it. In-game, there are only clones. The cloner's empty! flag can replace this, or even better, use the brand-spanking new groupTracker module that can do this kind of tracking for arbitrary groups and can automatically interface with cloners, AND generate a host of flag changes for you. 

Some observations

  • You are short-circuiting the cloner's 'clone?' with 'empty!', so you should see a never-ending parade of re-spawns from each cloner. If not, something may have gone wrong with flag naming (ActiateConvoyX). Have you considered using local flag names?
  • (just a tiny thing: flag! is not an input for cloner, should be ignored, probably not a factor)
  • A possible issue with DML/ME: cfxZones aren't compatible with IncrementZone, meaning they won't know about the size change. As long as ME is used to control the trigger that's used with it fine. DML won't know about any zone size changes. IIt does not appear to be an issue here
  • Yes, indeed, some of the demos require updates - I have them in my backlog. 

Some recommendations

  • If you have the time, look at RNDFlag - it's built exactly for this: pick a random flag from a set of flags, and it can even remove the flag that it picked so next time it won't be picked again.
  • Recently Browsing   0 members

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