Unit Group Variable Problem

Lord

TH.net Regular
Reaction score
18
Oookay. I have a unit group, and at the initialization I add 5 units to it. Every player has 1 unit of these (1 unit/player). Later if a player leaves I have a trig that removes the unit controlled by leaver player from the unit group, and then from the game. The thing is, when something happens to the group for example monsters attack them suddenly (creep spawn --> attack random unit form group), it seems like the removed units are still in the group, because the monsters who randomed the leaver player's unit won't do anything but stand and wait for God to give them the orders. Can anyone help me with this? (+rep)
 

n[u]ll

You can change this now in User CP.
Reaction score
93
Use this action
Unit Group - Remove (<your unit>) from (<unit group>)
 

Lord

TH.net Regular
Reaction score
18
I have a trig that removes the unit controlled by leaver player from the unit group

I already using that, but somehow the game ignores it...
 

n[u]ll

You can change this now in User CP.
Reaction score
93
Oh i didn't read that :p 1 sec

Edit: can i see your triggers?
 

InfectedWithDrew

I used to go here a lot.
Reaction score
95
You need to make the trigger that spawns/orders the monsters to check to see if the player has left. Simply removing the unit will not make the trigger stop functioning.
 

Guest3z

New Member
Reaction score
22
Have you tried call DestroyGroup( udg_*w/e* ) and then remake it with remaining units?
 

Lord

TH.net Regular
Reaction score
18
nll

My trigs are very very long (but they work if there are 5 players online that's sure), so I don't really want to post it. Tho it works like:

1.: At initialization a trig adds all 5 units to the group.
2.: 1 sec after the initialization my trigs check who plays, and removes unused player units from game and group.
3.: The game starts --> small cinematic event, then players can start playing.
4.: Heroes (controlled by the players) keep moving and killing simple units, til they reach that region when...
5.: ...enemy creeps spawn and attack them (sometimes nothing spawns, sometimes only a few monsters at the position of my hero --> creeps spawn near to random unit from unit group).

When I play alone, sometimes nothing spawns, sometimes only 1 bunch of monsters which means not my hero is the only one in group, tho a trig removed all offline player's units from that group.
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
i hate repeating my self, but...here i go again: show us the triggers.. ;)
Or, you can attach the map, ill take a quick look into it.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
This is quite odd...

1) Try to remove the unit from the group and afterwards remove it from the game.
2) Or you could simply create a new unit-group with the the units left and destroy the last one.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
I have a novel idea. Get rid of all your unit groups and use the custom values of the units. If the unit has 1 as its custom value, it's in the group, and if it has 0, it's not in the group.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top