How do I work a capturable trigger?

mystic_elf

New Member
Reaction score
2
Alright, so I have 2 buildings. Each has 2000 HP. The game is 5v5. Now, the game starts with Red controlling both buildings, but I want it so that if someone on Team 2 hits it under 500 HP, it goes up to 75% of the total HP (1500), and the building is controlled by brown. But I also want it so that if Team 1 hits it back under 500, they get control of it. Incidentally, I want to make it so that Catapults, with 1500 range, can't snipe it from afar and capture it like that. The 2 buildings also have a "suicide" skill they cast, and it kills themselves. I, however, only want Team 2 to have this ability. How would I work a trigger like this? I'll copy and paste what I have so far here.
 

mystic_elf

New Member
Reaction score
2
Code:
Cair Transfer
    Events
        Unit - Cair Andros 0026 <gen> Takes damage
    Conditions
        (Life of Cair Andros 0026 <gen>) Less than or equal to 500.00
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                ((Damage source) belongs to an ally of Player 12 (Brown)) Equal to True
            Then - Actions
                Unit - Change ownership of Cair Andros 0026 <gen> to Player 12 (Brown) and Change color
                Unit - Set life of Cair Andros 0026 <gen> to 75.00%
                Unit - Add Destruction (Cair) to Cair Andros 0026 <gen>
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                        ((Damage source) belongs to an ally of Player 1 (Red)) Equal to True
                    Then - Actions
                        Unit - Change ownership of Cair Andros 0026 <gen> to Player 1 (Red) and Change color
                        Unit - Set life of Cair Andros 0026 <gen> to 75.00%
                        Unit - Remove Destruction (Cair) from Cair Andros 0026 <gen>
                    Else - Actions
                        Do nothing
 

cleeezzz

The Undead Ranger.
Reaction score
268
for the first 2 problems, you can use Unit takes damage event, note that you will have to add the event through another trigger

when its attacked, simply check its health, if its under 500, then check who owns the Damaging Unit. If damaging unit is owned by Player 1 red, then change ownership of (Triggering Unit) to Player 1 Red. and Remove Suicide Ability

(OR any conditions is TRUE) If owner of Damaging unint is Player (6-12), change ownership of triggering unit to Brown. Unit- Add Suicide to Triggering Unit


For catapults, Event, Unit is Attacked,
Condition, Unit-Type of Triggering Unit equals Building AND Unit-Type of Attacking Unit equals Catapult
Then - Unit - Order Attacking Unit to Stop
Game Message: You can not attack with catapults


EH.. took a long time to post this, you basically did what i said. So what else you need?
 

mystic_elf

New Member
Reaction score
2
Well, yeah, the trigger is shaped like that, but it doesn't work. It does not get captured, so that's the problem. The catapults I can add in easy, but the main problem is the trigger itself (catapults aren't that big of a deal).
 

mystic_elf

New Member
Reaction score
2
What if I made something like:

Event - Unit Cair Andros is attacked

Conditions - Life of Cair <500

And I made the if condition to be that the Attacked unit is owned by red then it would go to brown, and if the attacked unit is owned by brown it goes to red?
 

mystic_elf

New Member
Reaction score
2
Well, if I do that, won't it simply not show up? And please bear with me, I'm mapping on a laptop that is really slow, and each test takes 2-3 minutes to move over.
 

cleeezzz

The Undead Ranger.
Reaction score
268
well if you put game messages, you'll see where your error is.

Like after each condtion, if the condition was Life is Less than 500, then put a game message saying LIFE IS UNDER 500



Note: dont worry about the add event with another trigger, your event should work fine.

(you only need to add events when units are created/not pre-placed
 

joaoac

Active Member
Reaction score
11
for the first 2 problems, you can...

For catapults, Event, Unit is Attacked,
Condition, Unit-Type of Triggering Unit equals Building AND Unit-Type of Attacking Unit equals Catapult
Then - Unit - Order Attacking Unit to Stop
Game Message: You can not attack with catapults...
Doing this, the player owner of the catapults could ping atacks until the building's HP become 500.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top