'unit enter/leaves region'

MissKerrigan

Active Member
Reaction score
23
Hello Guys,

I got about 100 pylons in my game
I created 4 regions of 2x2 but circled regions and called them:

- marine 1 follow
- marine 2 follow
- marine 3 follow
- marine 4 follow

These regions follows the marine of the players if they are in game
For so far this works...

Now I made a trigger that makes the pylon the color of the player that moved his marine to it
But the pylon must turn neutral if the marine leaves the pylon

Question 1: does the trigger below works?

event: unit leaves 'marine 1 follow'
event: unit leaves 'marine 2 follow'
event: unit leaves 'marine 3 follow'
event: unit leaves 'marine 4 follow'
condition: unit type of unit is 'pylon'
action: change player color of 'triggering unit' to 'player 0 (white)'


Question 2: if a marine of player 2 controls a pylon and a marine of player 3 enters the pylon, how do I stop the pylon changing to player 3??

MissKerrigan
 

Dave312

Censored for your safe viewing
Reaction score
269
1) I think it should work.
2) You need to add another condition to your trigger which checks if the colour of the pylon is white before changing it to the players colour.
 

MissKerrigan

Active Member
Reaction score
23
ya got it! I create a behavoir to the pylon 'player 1' 'player 2' 'player 3' player 4' as soon the pylon got controlled but the behavior is not visible so the trigger checks if the pylon has a behavior before going color

Next problem appears:

If player 2 controls the pylon and player 3 kills the marine of player 2, the pylon wont change color, but as soon player 3 moves a few times, the pylon will be colored teal (VERY WEIRD)
 

X-maul

AKA: Demtrod
Reaction score
201
Well, this is because you are changing the color when a unit enters. You need to recheck the ownership when a nearby unit dies. I will look into this in a few minutes.
 

MissKerrigan

Active Member
Reaction score
23
What do you mean?
When the marine of player 2 dies, the pylon should switch to player 3?
Why does nothing happens then?

I make a trigger that if player 3 is at the pylon, the pylon turns green (hmm weird)
 
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