• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Why does this create 2 lines of text instead of just one?

Status
Not open for further replies.
Level 3
Joined
May 24, 2012
Messages
57
  • DisplayRunesActivated 1
    • Events
      • Game - MagicRuneValue becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MagicRuneValue Equal to 1.00
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Game - Display to (All players) the text: 1 Magic Rune has be...
              • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
I am a little confused as to why this creates 2 lines of text instead of just 1 like it should. The trigger I have that activates this one is turned off immediatly after being triggers so as to not trigger more than once. Also that same trigger increases the variable every time it is activated which and once past a value of 1 it shouldn't activate this trigger correct? I have done similar triggers like this in the past and never had this issue using this same setup. Please and thank you for the help.
 
Level 3
Joined
May 24, 2012
Messages
57
  • MagicRune1Activated
    • Events
      • Unit - A unit enters Region 013 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Beserker
          • (Unit-type of (Triggering unit)) Equal to Wizard
          • (Unit-type of (Triggering unit)) Equal to Witch Doctor
          • (Unit-type of (Triggering unit)) Equal to Demon Hunter
    • Actions
      • Special Effect - Create a special effect at (Center of Region 013 <gen>) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Set MagicRuneValue = (MagicRuneValue + 1.00)
      • Wait 0.75 seconds
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn off (This trigger)

Here is the trigger that activates the Text creating one. No other triggers are linked to these 2.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
This:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
Causes the text to be displayed once per player, to all players.

By default you have a computer opponent, this is probably what is being picked.

Look closely at the Game - Display message action: it already displays it to (All players), so picking every player is not necessary.
 
Level 3
Joined
May 24, 2012
Messages
57
ahhhh that makes prefect sense now. I thought that might be the case but didnt bother to try it before asking, for fear that it might ruin the trigger altogether lol.
 
Level 3
Joined
May 24, 2012
Messages
57
Off topic question. I posted another thread before this one asking how to open a gate after all units in a region were killed ( some units spawn after map Initializaton). Example this rune is activated and trigges cypts to summon skeletons. once all the skeletons are dead i want the gate to the next room to open. cant figure that one out been messing with it for a couple days now. ????
 
Level 3
Joined
May 24, 2012
Messages
57
Okay so here are all the triggers associated with opening the gate. What did I do wrong?

  • SpawnSkeletonsMainChamber
    • Events
      • Game - MagicRuneValue becomes Equal to 4.00
    • Conditions
    • Actions
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Trigger - Turn off (This trigger)
  • MainChamberUnitDies
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Dies
    • Conditions
    • Actions
      • Set UnitsInMainChamber = (UnitsInMainChamber - 1)
  • InitializeNumberOfUnitsInMainChamber
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Add all units of (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow)) to MainChamberUnits
  • CalculateNumberOfUnitsInMainChamber
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Dies
    • Conditions
    • Actions
      • If ((Number of units in (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow))) Equal to 0) then do (Destructible - Open Massive Ruined Gate (Horizontal) 0430 <gen>) else do (Destructible - Close Massive Ruined Gate (Horizontal) 0430 <gen>)
 
Level 3
Joined
May 24, 2012
Messages
57
Okay here are updated triggers that still dont work.


  • SpawnSkeletonsMainChamber
    • Events
      • Game - MagicRuneValue becomes Equal to 4.00
    • Conditions
    • Actions
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Unit Group - Add (Last created unit) to MainChamberUnits
      • Trigger - Turn off (This trigger)
  • MainChamberUnitDies
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Dies
    • Conditions
    • Actions
      • Unit Group - Remove (Dying unit) from MainChamberUnits
  • InitializeNumberOfUnitsInMainChamber
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Add all units of (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow)) to MainChamberUnits
  • CalculateNumberOfUnitsInMainChamber
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow))) Equal to 0
        • Then - Actions
          • Destructible - Open Massive Ruined Gate (Horizontal) 0430 <gen>
        • Else - Actions
          • Do nothing
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Okay here are updated triggers that still dont work.


  • SpawnSkeletonsMainChamber
    • Events
      • Game - MagicRuneValue becomes Equal to 4.00
    • Conditions
    • Actions
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 <gen>) facing 90.00 degrees
      • Unit - Create 20 Skeleton Archer (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Unit - Create 20 Skeleton Soldier (Level 1) for Player 5 (Yellow) at (Center of Region 026 Copy <gen>) facing 270.00 degrees
      • Unit Group - Add (Last created unit) to MainChamberUnits
      • Trigger - Turn off (This trigger)
  • MainChamberUnitDies
    • Events
      • Unit - A unit owned by Player 5 (Yellow) Dies
    • Conditions
    • Actions
      • Unit Group - Remove (Dying unit) from MainChamberUnits
  • InitializeNumberOfUnitsInMainChamber
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Add all units of (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow)) to MainChamberUnits
  • CalculateNumberOfUnitsInMainChamber
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in AllUnitsDeadMainChamber <gen> owned by Player 5 (Yellow))) Equal to 0
        • Then - Actions
          • Destructible - Open Massive Ruined Gate (Horizontal) 0430 <gen>
        • Else - Actions
          • Do nothing

So your problem is the gates are not closing? Try removing that "Do Nothing" in your last trigger and replace with Close Massive Ruined Gate.
 
Level 3
Joined
May 24, 2012
Messages
57
no the gate won't open. It stays closed right now. Before i changed trigger to the right variable it wouldn't close and just stayed open. but right now it wont close
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Try adding all the skeletons to the unit group, not just the last created skeleton.




InitializeNumberOfUnitsInMainChamber
This trigger does polling for no real reason and so should not be there.

CalculateNumberOfUnitsInMainChamber
This can be merged into MainChamberUnitDies since it is the only source of unit removal (so checking if the unit groups is empty and any other time is pointless).
 
Status
Not open for further replies.
Top