Change Ownership

DogOfHavoc

Future Tragedy
Reaction score
55
I want to create a trigger like this:

Player 1 attacks Player 2's castle.
Castle takes damage.
Once the castle's health drop below X change owner of the castle to player 1 and give the castle full hp.

Best way to do this?
 

anvio

New Member
Reaction score
1
Trigger:
  • CastleAttacked
    • Events
      • Unit - A unit owned by Player 2 (Blue) Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Attacked unit)) Less than ###
          • (Unit-type of (Attacked unit)) Equal to (Unit-type of ###)
        • Then - Actions
          • Unit - Set life of (Attacked unit) to 100.00%
          • Unit - Change ownership of (Attacked unit) to Player 1 (Red) and Change color
        • Else - Actions


Obviously change the first ### to the units life %; and the second ### to the unit type of the castle.

Have fun :)
 

DogOfHavoc

Future Tragedy
Reaction score
55
Thanks, very useful.

One more thing. How do I make it so that it displays the player's name who captured the castle.

AKA. DogOfHavoc has captured Stone Keep.

The castles are going to be constantly changing hands as players take them over. I want to make it so that actual player's name is displayed (the map is designed for multiplayer). On a similar note, how do I create a trigger that allows a player to change his name along the lines of "-name The Iron Empire"
 

Happy

Well-Known Member
Reaction score
71
if you want to show it to all players add after the last then action :
game - display to all players the text : (name of owner of triggering unit) has captured XY.

you also could use floating text above the castle to show everyone near by who has the castle at the moment....

greetz happy
 

anvio

New Member
Reaction score
1
Trigger:
  • Name Trigger
    • Events
      • Player - Player 1 (Red) types a chat message containing -name as A substring
      • Player - Player 2 (Blue) types a chat message containing -name as A substring
    • Conditions
    • Actions
      • Player - Set name of (Triggering player) to (Substring((Entered chat string), 7, 25))


Yep... Have fun

PS: Don't forget the single space after -name

Anvio :)
 
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