Group enemies for 3 and 4 players

tightninja

Member
Is there anyway to adjust the group function for 3 and 4 players

for example we have:

group 3 3
at
120

Is there a way to have


3pgroup 3 5
at
120

4pgroup 3 6
at
120
 
I am interested on this as well, how could be implemented? at times 2pspawn and 3pspawn are not enough, and a different group quantity is needed for that amount of players.
 
Like DC said, scripts are the best way in this case.

I suggest using spawn scripts or inline like the method below with a dummy entity. This way, by using it in conjunction with other functions like spawn01, you can fully control many aspects of the spawns.

Code:
spawn GroupX
@script
void main()
{
    setentityvar(getlocalvar("self"), "name1", "GalsiaB_");
    setentityvar(getlocalvar("self"), "name2", "DonovanB_");
    setentityvar(getlocalvar("self"), "groupLimit", 5);
    setentityvar(getlocalvar("self"), "spawnLimit", 8);
    setentityvar(getlocalvar("self"), "screenEdge", 0);
    setentityvar(getlocalvar("self"), "distanceEdge", 100);
}
@end_script
map 0
flip 1
coords -50 440 0
at 650

wait
at 1050
 
I think I've shared this trick for this question before. The trick is to set big group for 4 players and spawn fake enemies to reduce the group size. These fake enemies will remove themselves based on number active players. Of course, they'll remove themselves when a wait is over (all enemies defeated) to allow progressing.
 
Hey Kratus,

How to does that script work in practice? From what I can tell Galsia and Donovan only spawn if enemies fall below 4 and with a max of 8?

in other words:

// If 4 players are present, Galsia and Donovan will spawn and change grouping from 3 3 to 5 8
4pspawn GroupX
at 650

Is that correct?
 
I think I've shared this trick for this question before. The trick is to set big group for 4 players and spawn fake enemies to reduce the group size. These fake enemies will remove themselves based on number active players. Of course, they'll remove themselves when a wait is over (all enemies defeated) to allow progressing.
Yep, this is what I do too.
 
Hey Kratus,

How to does that script work in practice? From what I can tell Galsia and Donovan only spawn if enemies fall below 4 and with a max of 8?

in other words:

// If 4 players are present, Galsia and Donovan will spawn and change grouping from 3 3 to 5 8
4pspawn GroupX
at 650

Is that correct?
@tightninja Not exactly. In the code I posted the "5" is the group limit, it means how many enemies can be spawned at the same time.
And the "8" is the spawn limit, it means the total enemies that will be spawned before this dummy disappears.

Basically it works by spawning an invisible Dummy enemy that will be always active until the spawnLimit is reached. Then, this dummy has a thinkscript running all the time, checking some conditions and acting accordingly.

Dummy
1778982212412.png

Think script
1778982334683.png

This is just an example, you can define any other rules if you want.
However, before diving in this script I suggest testing the Ilu / Bloodbane's method first, looks easier for your case.
 
@Bloodbane

How do the fake/dummy enemies know when remove themselves? Can you provide a script example?
I don't know exactly but I suppose it may be something like this

Code:
group 6 6
at 120

spawn Galsia
coords 550 230 0
at 120

spawn Galsia
coords 550 230 0
at 120

spawn Galsia
coords 550 230 0
at 120

spawn Galsia
@script
void main()
{
 void self = getlocalvar("self");
 int players = openborvariant("count_players");
 if(players < 3)
 {
     killentity(self);
 }
}
@end_script
coords 550 230 0
at 120

spawn Galsia
@script
void main()
{
 void self = getlocalvar("self");
 int players = openborvariant("count_players");
 if(players < 4)
 {
     killentity(self);
 }
}
@end_script
coords 550 230 0
at 120

spawn Galsia
@script
void main()
{
 void self = getlocalvar("self");
 int players = openborvariant("count_players");
 if(players < 4)
 {
     killentity(self);
 }
}
@end_script
coords 550 230 0
at 120
 
Back
Top Bottom