• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Trigger won't fire

Status
Not open for further replies.
Level 3
Joined
Mar 17, 2011
Messages
34
[SOLVED]

Hey, I am currently trying to get this trigger working in my map.

What I am trying to do:
The first player who gets a set amount of kills (say 100) gains the ability to create this new hero (Lets name him WD in this). (But only he gets to summon it, nobody else may unlock it.)

I have two variables set for this,
WDInt (Integer variable for counting the kills)
WDOn (Boolean variable, which when set to True, will hopefully disable future creation of the WD)

My triggers are set as follows:


  • WDSetup:
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) is A structure) Equal to False
  • Actions
    • Set WDInt = ((Player number of (Owner of (Killing unit))) + 1)

  • WDMain:
  • Events
    • Unit - A unit Dies
  • Conditions
    • WDOn Equal to False
    • WDInt Equal to 100
    • ((Dying unit) is A structure) Equal to False
  • Actions
    • Game - Display to (All players) the text: WARNING: The WD is now summonable!
    • Player - Make WD Available for training/construction by (Owner of (Killing unit))
  • WDSummoned
  • Events
    • Unit - A unit enters (Entire map)
  • Conditions
    • (Unit-type of (Entering unit)) Equal to WD
  • Actions
    • Set WDOn = True
I have tried this, and for some reason the WDMain trigger never fires. You can go well over 100 kills and never have the trigger go.
What is my problem? :S
Thanks for any help.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 027
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
      • ((Triggering unit) is A structure) Equal to False
    • Actions
      • Set i = (Player number of (Owner of (Killing unit)))
      • Set kills[i] = (kills[i] + 1)
      • Trigger - Run Untitled Trigger 028 <gen> (checking conditions)
  • Untitled Trigger 028
    • Events
    • Conditions
      • ((This trigger) is on) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kills[i] Greater than or equal to 5
          • booleans[i] Not equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Player - Make Footman Available for training/construction by (Owner of (Killing unit))
          • Set booleans[i] = True
        • Else - Actions
Turn the second trigger on when the unit is summoned.
 
Level 3
Joined
Mar 17, 2011
Messages
34
Sorry, I must be an idiot, but that doesn't seem to make sense to me xD.

What is 'i' ?
And why would I turn that trigger on when it looks like I need it on in the first place to be able to summon the hero?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I updated the second trigger. The second trigger should be initially on.

i is the player number. I use it to refer to an index in an array.

kills is an integer array variable.

Player 1 kills will be stored at kills[1], Player 2 kills will be stored at kills[2] and so on. Each player has his own kill counter.

EDIT: Wait, the other players can't ever have it after someone has unlocked it?
 
Level 3
Joined
Mar 17, 2011
Messages
34
What I meant with was, what variable is it in this?
  • Set i = (Player number of (Owner of (Killing unit)))(
Wait, the other players can't ever have it after someone has unlocked it?

Well, my map is going off of Warhammer history, and basically there is only one of this special hero (called the White Dwarf) and if there was more than one White Dwarf it'd be a bit of a messup. Basically I want the player who is doing the best (or at least is pulling the most weight in the combat) to gain the hero.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Then all you need is this:

  • Untitled Trigger 027 Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Triggering unit)) Not equal to (Owner of (Killing unit))
      • ((Triggering unit) is A structure) Equal to False
    • Actions
      • Set i = (Player number of (Owner of (Killing unit)))
      • Set kills[i] = (kills[i] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • kills[i] Greater than or equal to 5
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Player - Make Footman Available for training/construction by (Owner of (Killing unit))
        • Else - Actions
 
Status
Not open for further replies.
Top