Tampering with trigers

D359

Member
Reaction score
1
Code:
Untitled Trigger 001 

Events 

Map initialization
 
Conditions
 
Actions 

Player Group - Pick every player in (All players) and do (Actions) Loop - Actions Player - Limit training of Custom Tinker Hero to 1 for (Picked player)

Inside this triger can I replace the Custom Tinker with a variable that can store a couple of my heroes.I tryed altering the game play constants of my map to limit the training of heroes to 1,but for me it didn't work so I am using this triger.
 

OMGOMGOMG

UMBWGMG (Unidentified Human Being.)
Reaction score
28
Yes you can, just add an array and then set

Cust_Unit[1] to Custom Tinker Hero 1 so make it look like this:

Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Cust_Unit [1] Tinker
      • Set Cust_Unit[2] Paladin
      • (Do this for as many heroes as you want then do)
      • Player Group - Pick every player in (All players) and do (Actions)
        • loop - Actions
          • Player - Limit training of Cust_Unit[1] to 1 for (Picked player)
          • (Do this for all of them)


And please wrap them around [wc3.][/wc3] tags (Just no dots)
 

D359

Member
Reaction score
1
I said this so often in other threads that I should make it my sig,I am a triger-idiot,I don't always know what I am doing in trigers,how do I set custom arrays?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
In the Variable Editor, check the box that says Array, then enter the size of the array you want.
 

RomeusS87

New Member
Reaction score
0
Thanks OMGOMGOMG, your comment helped me a lot..
I searched on Google about this issue and it directed me here, to this topic..

Thanks


Buy Viagra
 

Kayoss666

Member
Reaction score
7
Yes you can, just add an array and then set

Cust_Unit[1] to Custom Tinker Hero 1 so make it look like this:

Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Cust_Unit [1] Tinker
      • Set Cust_Unit[2] Paladin
      • (Do this for as many heroes as you want then do)
      • Player Group - Pick every player in (All players) and do (Actions)
        • loop - Actions
          • Player - Limit training of Cust_Unit[1] to 1 for (Picked player)
          • (Do this for all of them)
or less lines
Trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Cust_Unit [1] Tinker
      • Set Cust_Unit[2] Paladin
      • (Do this for as many heroes as you want then do)
      • Player Group - Pick every player in (All players) and do (Actions)
        • loop - Actions
          • For each (Integer A) from 1 to 10, do (Actions)
            • Loop - Actions
              • Player - Limit training of Cust_Unit[(Integer A)] to 1 for (Picked player)


but change 10 to the size of your array
 
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