Make trigger work when leaves combat, help needed

Lukas91

New Member
Reaction score
0
Hey, im building like a event, there you enter a boss fight and when you gets in combat with him the gate(invunerabel) closes so you have to fight him untill one of you dies, its a melee map so you can have many units with you too... well the problem is that i dont know how to make so the barrier will remove itself if the player die with his hero and units... (i have made the boss to be in party 7, so its not a neutral hostile anymore).
i did try with something like this, but insted of having "Is rescued" i tryed to find something els... but i cant find out myself.
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit owned by Player 7 (Green) Is rescued
    • Conditions
    • Actions
      • Wait 20.00 seconds
      • Destructible - Pick every destructible in Remove tree <gen> and do (Destructible - Remove (Picked destructible))


Thanks :)
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Triggering unit) Equal to (Your boss)
    • Actions
      • Destructible - Close (Your gate)
 

Lukas91

New Member
Reaction score
0
thanks, but

i want the gate to open if the boss survives and the player dies.


i had the trigger before. to close the gates when you attack the boss,
but when enough many units attack him att same time, that trigger starts to lag the whole game :(
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Well then add this action.

Trigger:
  • Trigger - Turn off (This trigger)


To open the gate, do this.

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Boss Area) contains (Triggering unit)) Equal to True
    • Actions
      • Set IntegerVariable = (Number of units in (Units in (boss Area) matching (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntegerVariable Less than or Equal to 1
        • Then - Actions
          • Destructible - Open (Your gate)
          • Trigger - Turn on (The trigger that is turned off)
        • Else - Actions


This checks when a unit dies, how many alive units are left in the boss area. If its only 1(the boss) or less(no units, boss dead), then open the gate and turns on the trigger.
 

HailCommi

New Member
Reaction score
15
I think you might want to define a region where you fight your boss then. I know this is a bit clumsy but try something like this (it just an example for the concept, not sure it if actually works, you'll have test it):


Trigger:
  • Close Gate
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Triggering unit) Equal to (Das boss)
    • Actions
      • Destructible - Close (Your gate)
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on (Open Gate)


Trigger:
  • Open Gate
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Number of units in (Units in (Boss_Arena) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of Neutral Hostile) Equal to False)))) Equal to 0
    • Actions
      • Destructible - Open (Your gate)
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on (Close Gate)


The condition for the above trigger pretty much says "if there are no living units that doesn't belong to Neutral Hostile the do this..." You have to change Neutral Hostile to something else if your boss is owned by a different player.

Edit: come to think of it there is a double negative in there, you could probably change that trigger around so its easier to read. Something like "Every living unit in Boss_Arena belongs to Neutral Hostile".

Trigger:
  • Boss Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to (Das boss)
    • Actions
      • Destructible - Open (Your gate)
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off (Close Gate)
 

Lukas91

New Member
Reaction score
0
Great!

it did work perfecly :) thanks alot.
i just learn mcuh new stuff about how you can make triggers work better together thanks to you,
didn't know about the "turn on and off trigger" action system.
and i never used the conditions before either.
 
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