Respawning Alternating Target Groups with Moose - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 02-09-2018, 10:11 PM   #1
rassy7
Member
 
rassy7's Avatar
 
Join Date: May 2013
Location: Broomfield, CO
Posts: 230
Default Respawning Alternating Target Groups with Moose

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!
__________________

Specs: GA-Z270XP-SLI; i7-7700K; EVGA GTX 1080 SC2 iCX; 16GB Corsair Vengeance LPX DDR4; Samsung 960 EVO Series M.2 SSD; WIN10; ASUS VG248QE
Modules: A-10C; FC3; UH1H; P-51; AV8B; F-86; L-39; HAWK; CA; NTTR; Normandy
rassy7 is offline   Reply With Quote
Old 02-10-2018, 01:03 PM   #2
rassy7
Member
 
rassy7's Avatar
 
Join Date: May 2013
Location: Broomfield, CO
Posts: 230
Default

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
__________________

Specs: GA-Z270XP-SLI; i7-7700K; EVGA GTX 1080 SC2 iCX; 16GB Corsair Vengeance LPX DDR4; Samsung 960 EVO Series M.2 SSD; WIN10; ASUS VG248QE
Modules: A-10C; FC3; UH1H; P-51; AV8B; F-86; L-39; HAWK; CA; NTTR; Normandy
rassy7 is offline   Reply With Quote
Old 02-11-2018, 06:32 PM   #3
Delta99
Member
 
Delta99's Avatar
 
Join Date: Jan 2017
Posts: 227
Default

I think in your OnEventDead function you will have to spin through all the units to see if they are all dead.
__________________
My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements
Delta99 is offline   Reply With Quote
Old 02-11-2018, 07:53 PM   #4
fargo007
Member
 
Join Date: Jul 2017
Posts: 307
Default

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
__________________



You dig rotorcraft? Training, Quals, Missions, & FUN. Ask me about joining the Black Sharks!

Last edited by fargo007; 02-11-2018 at 07:58 PM.
fargo007 is offline   Reply With Quote
Old 02-12-2018, 06:17 PM   #5
rassy7
Member
 
rassy7's Avatar
 
Join Date: May 2013
Location: Broomfield, CO
Posts: 230
Default

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.

Quote:
Originally Posted by fargo007 View Post
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.
__________________

Specs: GA-Z270XP-SLI; i7-7700K; EVGA GTX 1080 SC2 iCX; 16GB Corsair Vengeance LPX DDR4; Samsung 960 EVO Series M.2 SSD; WIN10; ASUS VG248QE
Modules: A-10C; FC3; UH1H; P-51; AV8B; F-86; L-39; HAWK; CA; NTTR; Normandy
rassy7 is offline   Reply With Quote
Old 02-13-2018, 12:54 PM   #6
fargo007
Member
 
Join Date: Jul 2017
Posts: 307
Default

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.
__________________



You dig rotorcraft? Training, Quals, Missions, & FUN. Ask me about joining the Black Sharks!

Last edited by fargo007; 02-13-2018 at 01:17 PM.
fargo007 is offline   Reply With Quote
Old 02-13-2018, 01:16 PM   #7
rassy7
Member
 
rassy7's Avatar
 
Join Date: May 2013
Location: Broomfield, CO
Posts: 230
Default

Quote:
Originally Posted by fargo007 View Post
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.
__________________

Specs: GA-Z270XP-SLI; i7-7700K; EVGA GTX 1080 SC2 iCX; 16GB Corsair Vengeance LPX DDR4; Samsung 960 EVO Series M.2 SSD; WIN10; ASUS VG248QE
Modules: A-10C; FC3; UH1H; P-51; AV8B; F-86; L-39; HAWK; CA; NTTR; Normandy
rassy7 is offline   Reply With Quote
Old 02-14-2018, 02:59 AM   #8
fargo007
Member
 
Join Date: Jul 2017
Posts: 307
Default

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
__________________



You dig rotorcraft? Training, Quals, Missions, & FUN. Ask me about joining the Black Sharks!
fargo007 is offline   Reply With Quote
Old 02-14-2018, 09:31 PM   #9
rassy7
Member
 
rassy7's Avatar
 
Join Date: May 2013
Location: Broomfield, CO
Posts: 230
Default

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.
__________________

Specs: GA-Z270XP-SLI; i7-7700K; EVGA GTX 1080 SC2 iCX; 16GB Corsair Vengeance LPX DDR4; Samsung 960 EVO Series M.2 SSD; WIN10; ASUS VG248QE
Modules: A-10C; FC3; UH1H; P-51; AV8B; F-86; L-39; HAWK; CA; NTTR; Normandy
rassy7 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:40 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.