Trigger not working

ArmyOfFrogs

New Member
Reaction score
20
Can't find anything wrong with this trigger.. Any help would be appreciated.
RastaPlayerWipe is a variable set to units that are in a region before they are sent to the boss. Here's the trigger to detect the wipe

Trigger:
  • RastaPlayerWipe
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (RastaPlayercheck <gen> contains (Triggering unit)) Equal to True
      • (Unit-type of (Triggering unit)) Not equal to Dark Shaman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RastaPlayerWipe Greater than or equal to 1
        • Then - Actions
          • Set RastaPlayerWipe = (RastaPlayerWipe - 1)
        • Else - Actions
          • Game - Display to (All players) the text: |cffff0000Wipe on R...
          • Unit - Set mana of Dark Shaman 0003 <gen> to 100.00%
          • Set rastmanlock = 0
          • Unit - Set life of Dark Shaman 0003 <gen> to 100.00%


Thanks if you can spot the error ^^
 

Komaqtion

You can change this now in User CP.
Reaction score
469
So you want to display a message when the first hero does inside the region, right ?? (And set the mana and life and stuff)
 

ArmyOfFrogs

New Member
Reaction score
20
No when RastaPlayerWipe = 0, which should represent that there are 0 friendly heroes left in the region.
 

XxShadyxX

I abused the rep system.
Reaction score
81
Tell me is the dying unit in that region?
What exactly happens? Nothing?

The dying unit is a Hero? What unit is dying?

Also try changing all triggering units to dying unit
 

Blackveiled

Formerly, Ban-Lord
Reaction score
157
Try changing this

Trigger:
  • RastaPlayerWipe
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying Unit) is A Hero) Equal to True
      • (RastaPlayercheck <gen> contains (Dying Unit)) Equal to True
      • (Unit-type of (Dying Unit)) Not equal to Dark Shaman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RastaPlayerWipe Greater than or equal to 1
          • Then - Actions
            • Set RastaPlayerWipe = (RastaPlayerWipe - 1)
            • Else - Actions
              • Game - Display to (All players) the text: |cffff0000Wipe on R...
              • Hero - Revive (Dying Unit)
              • Set rastmanlock = 0
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Are you sure your set the variale right when you count the units in the region
 

ArmyOfFrogs

New Member
Reaction score
20
shady the hero dies but the check that i've put in for testing (the display that you have wiped) is not firing, nor is he restoring to full hp and mana.

ban-lord, i want to set the boss back to full hp and mana, not the heroes o_O

I'm not sure on the variable, i'll double check with another game message to show it when it sets it.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Put a game mesage in the then actions aswell to see if that is working right
 

ArmyOfFrogs

New Member
Reaction score
20
It's setting the variable to 3 for some reason, even though there's 1 unit in there.

Here's how it sets it

Trigger:
  • ...
    • //runs through trigger until players are about to be moved to boss room
    • Set RastaPlayerWipe = (Number of units in (Units in RastamanEntrance <gen>))


I'm the only one in the region there, but its counting 3 for whatever reason.

edit changed it to

Trigger:
  • Unit Group - Pick every unit in (Units in RastamanEntrance <gen>) and do (Actions)
    • Loop - Actions
      • Set RastaPlayerWipe = (Number of units in (Units in RastamanEntrance <gen> matching (((Picked unit) is A Hero) Equal to True)))

that resulted in 0 now
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Cant it just be =number of units in region rather than =number of units in (units in region)
 

XxShadyxX

I abused the rep system.
Reaction score
81
Or you could just do
Trigger:
  • Unit Group - Pick every unit in (Units in RastamanEntrance <gen>) and do (Actions)
    • Loop - Actions
    • Set RastaPlayerWipe= (RastaPlayerWipe + 1)


If you do this then there is no way it will not work
 

ArmyOfFrogs

New Member
Reaction score
20
It automatically sets it to that, look under Unit - Count units in Unit Group, don't think there's another way to count the number of units in a region.

And shady that was the first time i did so it can go wrong :p I think i forgot to put the condition to check for hero like you did, and it was probably counting my backpack that I forgot about >_>. Testing with that method + hero condition though :)

Edit: Doh set it to 3 using

Trigger:
  • Unit Group - Pick every unit in (Units in RastamanEntrance <gen> matching (((Triggering unit) is A Hero) Equal to True)) and do (Actions)
    • Loop - Actions
      • Set RastaPlayerWipe = (RastaPlayerWipe + 1)
 

XxShadyxX

I abused the rep system.
Reaction score
81
Look at what I posted. That will work trust me.

Actually to make it check if the unit is a hero do this

Trigger:
  • Unit Group - Pick every unit in (Units in (RastamanEntrance <gen>)) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) is A Hero) Equal to True
        • Then - Actions
          • Set RastaPlayerWipe = (RastaPlayerWipe + 1)
        • Else - Actions
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
For that you need to set the variable to 0 first
 

ArmyOfFrogs

New Member
Reaction score
20
It's at 0 by default though, and has never been set before, nor will it be used again.
And thanks shady that worked :)
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Hey i pointed out the problem witout even seeing it
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top