Jump to content

Respawning Alternating Target Groups with Moose


rassy7

Recommended Posts

I've been reading, watching and testing this for several hours today, trying to understand it better and I think I'm close, but still not sure 1) I'm doing this correctly and 2) how to get to the last step.

 

I want to spawn a second group of target vehicles in and around a first group once all the units in that first group have been destroyed. Subsequently, once all the units in that second group are destroyed, I want to respawn the first group and so on indefinitely. I want to see the fires and destroyed vehicles from the first group there while the second group goes active.

 

So far, I've been able to get this to work to a point. The trouble is, I can't seem to figure out how to get the second group to wait for ALL the units from the first group to be destroyed before it spawns. I read somewhere that the EVENTS.Dead only looks for one member of the group to be destroyed. I need all of them to be destroyed or the next group spawns as soon as one vehicle is destroyed.

 

What am I doing wrong? Is this possible? Here's what I have been testing:

 

Targets1 = SPAWN:New( "Targets 1" ):Spawn()

Targets2 = SPAWN:New( "Targets 2" ):Spawn()

 

Targets1:HandleEvent( EVENTS.Dead )

Targets2:HandleEvent( EVENTS.Dead )

 

function Targets1:OnEventDead( EventData )

Targets2 = SPAWN:New( "Targets 2" ):Spawn()

end

 

function Targets2:OnEventDead( EventData )

Targets1 = SPAWN:New( "Targets 1" ):Spawn()

end

 

Thanks for the help!

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Ok, I'm seeing this happen with other group references too, such as Respawn After Landing. As soon as the first aircraft in a group lands, they all Respawn instantly, pulling the rest right out of the air.

 

It's like the group references are using the "Part of Group ..." trigger from the ME when I need the "All of Group ..." trigger.

 

I do a lot with groups. I hope there is a workaround or a correct way to approach this I haven't found yet.

 

Sent from my Pixel XL using Tapatalk

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

If the general idea is to keep an area populated with a specific number of targets, you could come at it like this:

 

 

target2 = SPAWN:New( "target11" )

:InitLimit( 4, 20 )

:InitRandomizeZones( ZoneTable )

:SpawnScheduled( 2, 1 )

 

 

That gives you four targets alive at any one time with a max of 20 total, spawning randomly in any zone configured in ZoneTable (which can also be a single zone object of any kind, such as a zone polygon if desired).

 

 

Another option is a hybrid approach where you trigger the spawns as a DO SCRIPT in the ME, but define them in the DO SCRIPTFILE loaded script. Check with a trigger for the absence of that coalition in the concerned zone, and if so, spawn what you want as DO SCRIPT.

 

So in the loaded script file:

 

target2 = SPAWN:New( "target11" )

:InitRandomizeZones( ZoneTable )

 

=======

 

TRIGGER: SPAWNBADGUYS

CONDITION: All of coalition out of zone XXX

ACTION:

DO SCRIPT ==

newtarget1 = target2:Spawn()

 

Hope this gives you some ideas,

 

/Fargo


Edited by fargo007

 

Banner EDForum2020.jpg

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

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

Thanks a lot to both of you. I feel better knowing I wasn't failing simply because I couldn't find the script that I wanted. Looks like I'll be working around the issue, but the options also sound promising. I'll probably use a combination of both your suggestions.

 

One thought that Fargo's post reminded me of: How much of an impact do ME triggers add to a mission, if I were to, say, orchestrate a few separate scripts as suggested here, and call them individually with ME triggers? I remember reading missions with a lot of ME triggers can really bog down the performance.

 

Another option is a hybrid approach where you trigger the spawns as a DO SCRIPT in the ME, but define them in the DO SCRIPTFILE loaded script. Check with a trigger for the absence of that coalition in the concerned zone, and if so, spawn what you want as DO SCRIPT.

 

Thanks again.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

IME, not much. Performance seems to be more related to the number of objects, and the number of MOVING objects DCS has to continually track and broadcast out to all clients.

 

I'll point out that if using this approach, you can (and should where possible) have everything declared in ONE script, and exercise only the active portion with the ME trigger, e.g.

 

targetname:SpawnInZone(Zone1,true)

 

LMK how it works out. I don't think you are far from getting it going.

 

 

I frequently have MOOSE, a MOOSE script, Mist, CTLD and CSAR, along with the CSAR ogg files loaded. That's six triggers right there before I start doing anything.


Edited by fargo007

 

Banner EDForum2020.jpg

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

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

IME, not much. Performance seems to be more related to the number of objects, and the number of MOVING objects DCS has to continually track and broadcast out to all clients.

 

I'll point out that if using this approach, you can (and should where possible) have everything declared in ONE script, and exercise only the active portion with the ME trigger, e.g.

 

targetname:SpawnInZone(Zone1,true)

 

LMK how it works out. I don't think you are far from getting it going.

 

 

I frequently have MOOSE, a MOOSE script, Mist, CTLD and CSAR, along with the CSAR ogg files loaded. That's sixe triggers right there before I start doing anything.

 

Excellent. That's great to know. I'm jumping into it right now. To be honest, I can't say I've ever experienced much of a hit with missions loaded with ME triggers, but only a few objects. Was just trying to follow best practices, but if this is only a small script that reoccurs a few times, hopefully it'll be OK. Also, I had no idea one could use MIST and MOOSE in the same mission. I thought it had to be either/or. I love CTLD! Would be great to use that and mix in some RAT to those missions for effect.

 

Thanks Fargo.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

Mist and MOOSE are both different ways of abstracting the underlying layers that we communicate with.

 

So it doesn't matter if you use one, or both. They are not mutually exclusive at all.

 

Being with a heliborne squadron, all of my missions are helo based, so we always have a modified version of CSAR loaded in there. And CTLD is still the best way to address loading, transporting, and routing troops.

 

If you ever need me to take a look at a miz, I am happy to. Others helped me out when I started, and I would pass that forward with alacrity.

 

/Fargo

 

Banner EDForum2020.jpg

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

https://discord.gg/blacksharkden/

Link to comment
Share on other sites

Well that's great to hear and it makes sense when you explain it like that. I'll probably always have CTLD loaded into missions then. It's so easy and works so well.

 

It'll probably be a while before I have something in working order while I'm still learning, but I'll definitely shoot over what I have when it's finished-ish. As for now, I've installed and loaded Eclipse's LDT with Moose framework and missions per FlightControl's tutorial. Hopefully that will speed up the learning curve a little.

 

Thanks again.

The State Military (MAG 13)

 

[sIGPIC][/sIGPIC]



 

SHEEP WE-01

AV-8B BuNo 164553

VMA-214

Col J. “Poe” Rasmussen

http://www.statelyfe.com

 

Specs: Gigabyte Z390 Pro Wifi; i9-9900K; EVGA 2080 Ti Black; 32GB Corsair Vengeance LPX DDR4; Samsung 970 EVO Series M.2 SSD; WIN10; ASUS VG248QE; CV-1 and Index



Modules: A-10C; AV8B; CA; FC3; F-5; F-14; F-18; F-86; HAWK; L-39; P-51; UH1H; NTTR; Normandy; Persian Gulf

Link to comment
Share on other sites

  • Recently Browsing   0 members

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