Changing the owner of the house. [a complicated problem for me]

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Hello!

Heres my problem:

I want to make a Neutral house (Lets say a barrack) controllable by a player unit by stepping onto a beacon in front of the house.

As I am imaging: A paladin (player 1- red) comes and steps onto a beacon right in front of the barrack (player 12 - brown, neutral), the barrack turns into player 1's colour while i am standing on the beacon. If i leave the beacon, the barrack will turn back into player 12 colour-neutral so that another player (player 2 - blue) could use it.

I have searched for this but couldnt find anything. Is this doable? Can someone wiser than me help.

Cheers!
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Put a small region on your Circle of Power.
And two triggers:
One with the event "unit enters region", the other with "unit leaves region".

Then either "Unit - Change owner of <barracks> to Owner of (Entering unit)" or back to "Neutral".


If your region is too big, it might happen that two players stand in it at once...
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
No, the beacon in small, layer is small too. Thanks. Ill try it out as soon as i can.

cheers!
 
O

Ophidian

Guest
its a 2 parter, relativly simple.

EDIT: got beat.... anyway my trigger addesses the 2 unit thing so it shouldnt be a problem if you want a big region.

Code:
Enter
    Events
        Unit - A unit enters Region 000 <gen>
    Conditions
        unitinregion Equal to False
    Actions
        Set Controler = (Entering unit)
        Unit - Change ownership of Barracks 0000 <gen> to (Owner of (Entering unit)) and Change color
        Set unitinregion = True
        Trigger - Turn off (This trigger)
        Trigger - Turn on Exit <gen>

The second part, which changes ownership back if the unit leaves.

Code:
Exit
    Events
        Unit - A unit leaves Region 000 <gen>
    Conditions
        (Leaving unit) Equal to Controler
    Actions
        Unit - Change ownership of Barracks 0000 <gen> to Neutral Passive and Change color
        Set unitinregion = False
        Trigger - Turn off (This trigger)
        Trigger - Turn on Enter <gen>
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Thanx, well i have been using waredit for 2 weeks and i feel kinda... noob. This was my first problem which i couldnt solve myself. :)
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Where can i set the controller?... Unit>...

EDIT: i got it all to work. thanx.
 
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