• 🏆 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!

Question

Status
Not open for further replies.
Level 10
Joined
Mar 19, 2010
Messages
622
Hey, I wonder this Trigger I made is MUI or not. I'm not sure. If not, Can you teach me to make one? Here's the Trigger:-
  • My Trigger
    • Events
      • Time - Every 0.11 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Player 1 (Red) Current gold) Equal to 10
          • (Player 1 (Red) Current gold) Equal to 25
          • (Player 1 (Red) Current gold) Equal to 40
    • Actions
      • Set LevelingPlayer = Player 1 (Red)
      • Player - Set the current research level of Ganeral Upgrade to ((Current research level of Ganeral Upgrade for LevelingPlayer) + 1) for Player 3 (Teal)
      • Game - Display to Player Group - Player 1 (Red) the text: (Your Durid of the Telon + (had been upgraded to Tier + (String((Current research level of Ganeral Upgrade for Player 1 (Red))))))
 
Level 10
Joined
Mar 19, 2010
Messages
622
@ Maker : This Trigger is made to check when a player's gold reached certain amount, it will auto upgrade the "Ganeral Upgrade" to next level.
@ tjordell: The interval is set to 0.11 because I had many trigger like this which will check other player(got 8 player at all) but i think if all is same 0.3(or any) the variable "Leveling Player" will crash.

So any solution? I'm really noob at triggering and hopes to learn something :D
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You can use this to add events to your trigger:

  • For each (Integer i1) from 1 to 12, do (Actions)
    • Loop - Actions
      • Trigger - Add to Untitled Trigger 006 <gen> the event (Player - (Player(i1))'s Current gold becomes Equal to 10.00)
i1 is a custom integer variable.

Then use triggering player to get the player.

Equal to 10: from 9->10 and from 11->10, so it works both ways.
 
Level 10
Joined
Mar 19, 2010
Messages
622
@ tjordell: Thanks. I learned something :D
@Maker: You mean like below?

I'd remake the trigger. But I don't know what to do about the Loops one. but here's what I've get.
  • MY Trigger
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Player 1 (Red) Current gold) Equal to 10
          • (Player 1 (Red) Current gold) Equal to 25
          • (Player 1 (Red) Current gold) Equal to 40
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set LevelingPlayer = Player 1 (Red)
          • Player - Set the current research level of Ganeral Upgrade to ((Current research level of Ganeral Upgrade for LevelingPlayer) + 1) for Player 3 (Teal)
          • Game - Display to Player Group - Player 1 (Red) the text: (Your Durid of the Telon + (had been upgraded to Tier + (String((Current research level of Ganeral Upgrade for Player 1 (Red))))))
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer i1) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Untitled Trigger 006 <gen> the event (Player - (Player(i1))'s Current gold becomes Equal to 10.00)
          • Trigger - Add to Untitled Trigger 006 <gen> the event (Player - (Player(i1))'s Current gold becomes Equal to 25.00)
          • Trigger - Add to Untitled Trigger 006 <gen> the event (Player - (Player(i1))'s Current gold becomes Equal to 40.00)
  • Untitled Trigger 006
    • Events
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Set PlayerGroup = (Player group(Player))
      • Player - Set the current research level of Iron Forged Swords to ((Current research level of Iron Forged Swords for Player) + 1) for Player
      • Game - Display to PlayerGroup the text: Text
      • Custom script: call DestroyForce(udg_PlayerGroup)
Notice that when the gold goes down, it will still trigger the event, and if it jumps from 9 to 11, the event won't trigger. And the event will trigger every time you get to those values, so getting to 10 several times will trigger the event several times.
 
Level 10
Joined
Mar 19, 2010
Messages
622
So now I reworked the trigger already. Please check it if I've made any mistake :D
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player - Turn Gives bounty On for Player 10 (Light Blue)
      • Player - Turn Gives bounty On for Player 11 (Dark Green)
      • Melee Game - Use melee time of day (for all players)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 10.00)
          • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 30.00)
          • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 50.00)
and

  • Leveling
    • Events
    • Conditions
    • Actions
      • Set LevelingPlayer = (Triggering player)
      • Set PlayerGroup = (Player group(LevelingPlayer))
      • Set LevelingPlayer = Player 1 (Red)
      • Player - Set the current research level of Ganeral Upgrade to ((Current research level of Ganeral Upgrade for LevelingPlayer) + 1) for LevelingPlayer
      • Game - Display to PlayerGroup the text: (Your Ganeral + (had been upgraded to Tier + (String((Current research level of Ganeral Upgrade for Player 1 (Red))))))
      • Custom script: call DestroyForce(udg_PlayerGroup)
Thanks guys for helping xD
 
Level 11
Joined
Sep 12, 2008
Messages
657
1 slight problem..
i sugguest not using Integer A in the loop,
if you go to the actions screen, and scroll 2 actions below For Loop Integer A
it'll be for each integer...
so basicly, you make your own variable, like maker did, and then switch from GetIntegerA, to the custom variable the loop uses.
 
Level 11
Joined
Sep 12, 2008
Messages
657
hmm.. like this

  • WRONG:
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
  • CORRECT:
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
  • Then, instead of GetIntegerA you do:
  • WRONG:
  • Unit - Create 1 Footman for (Player((Integer A))) at (Center of (Playable map area)) facing Default building facing degrees
  • CORRECT:
  • Unit - Create 1 Footman for (Player(VARIABLE_INTEGER_NON_ARRAY)) at (Center of (Playable map area)) facing Default building facing degrees
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 10.00)
      • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 30.00)
      • Trigger - Add to Leveling <gen> the event (Player - (Player(1))'s Current gold becomes Equal to 50.00)
^You shouldn't have Player(1), you should have Player(Integer A)

  • Leveling
    • Events
    • Conditions
    • Actions
      • Set LevelingPlayer = (Triggering player)
      • Set PlayerGroup = (Player group(LevelingPlayer))
      • Set LevelingPlayer = Player 1 (Red)
      • Player - Set the current research level of Ganeral Upgrade to ((Current research level of Ganeral Upgrade for LevelingPlayer) + 1) for LevelingPlayer
      • Game - Display to PlayerGroup the text: (Your Ganeral + (had been upgraded to Tier + (String((Current research level of Ganeral Upgrade for Player 1 (Red))))))
      • Custom script: call DestroyForce(udg_PlayerGroup)
Remove Set LevelingPlayer = Player 1 (Red)
 
Status
Not open for further replies.
Top