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

Disable multiple triggers and enable them one by one at a different time

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! it's for my TD - in my map the creeps are spawning with messages like - for level 1 creeps the player must type '-go1' for level 2 - '-go2' ,so - how i can disable the triggers that spawn the creeps level2,3,4,5,6,7...40 just not disable level1 and when player types '-go1' - enable the trigger that spawns level 2.And that process repeating until the end.Because i don't want when i start the map and when i type -go40 (last level) the map will end. Thank you and sorry for my bad english!
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set WaveNumber = 1
    • Set Units[1] = Footman
    • Set Units[2] = Knight
    • Set Units[3] = Archmage
    • Set Units[4] = Lich
    • Set Units[5] = Archimonde
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) types -go as A Substring)
    • Trigger - Turn on Trigger3 <gen>
  • Trigger2
  • Events
  • Conditions
    • (Substring((Entered chat string), 1, 3) Equal to -go //String Comparison
  • Actions
    • Set WaveNumber = (Integer(Substring((Entered chat string), 4, (Length of (Entered chat string)))))
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (WaveNumber) Equal to 0
      • Then - Actions
        • Set WaveNumber = 1 //I use this to avoid the typing of "0", which leads to no creep spawn (since our index for the "Units[]" variable starts from 1)
      • Else - Actions
  • Trigger3
  • Events
    • Time - Every 15.00 seconds of game-time
  • Conditions
  • Actions
    • Set Point1 = (Center of (Playable Map Area))
    • For each (IntegerB) from 1 to 5, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Units[WaveNumber] for Neutral Hostile facing Default building degrees
        • Unit Group - Add (Last created unit) to CreepGroup
    • Custom script: call RemoveLocation (udg_Point1)
    • Trigger - Turn off (This trigger)
  • Trigger4
  • Events
    • Unit - A unit dies
  • Conditions
    • (Owner of (Triggering unit)) Equal to Neutral Hostile //Player Comparison
  • Actions
    • Unit Group - Remove (Triggering unit) from CreepGroup
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in CreepGroup) Equal to 0
      • Then - Actions
        • Trigger - Turn on Trigger3 <gen>
      • Else - Actions
Variables used:
• CreepGroup (type: Unit Group)
• WaveNumber (type: Integer) - followed the Conversion - Convert String to Integer to get that result, in Trigger2.
• Units[] (type: Unit-type with "Array" option ticked)
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
I actually don't understand because that is my first map and i am not so good with the triggers but i will try to make it.If you can tell me with simple words what the four triggers mean - i will be so happy. I will give you '+rep' right now! :)
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set WaveNumber = 1
    • Set Units[1] = Footman
    • Set Units[2] = Knight
    • Set Units[3] = Archmage
    • Set Units[4] = Lich
    • Set Units[5] = Archimonde
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) types -go as A Substring)
    • Trigger - Turn on Trigger3 <gen>
  • Trigger2
  • Events
  • Conditions
    • (Substring((Entered chat string), 1, 3) Equal to -go //String Comparison
  • Actions
    • Set WaveNumber = (Integer(Substring((Entered chat string), 4, (Length of (Entered chat string)))))
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (WaveNumber) Equal to 0
      • Then - Actions
        • Set WaveNumber = 1 //I use this to avoid the typing of "0", which leads to no creep spawn (since our index for the "Units[]" variable starts from 1)
      • Else - Actions
  • Trigger3
  • Events
    • Time - Every 15.00 seconds of game-time
  • Conditions
  • Actions
    • Set Point1 = (Center of (Playable Map Area))
    • For each (IntegerB) from 1 to 5, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Units[WaveNumber] for Neutral Hostile facing Default building degrees
        • Unit Group - Add (Last created unit) to CreepGroup
    • Custom script: call RemoveLocation (udg_Point1)
    • Trigger - Turn off (This trigger)
  • Trigger4
  • Events
    • Unit - A unit dies
  • Conditions
    • (Owner of (Triggering unit)) Equal to Neutral Hostile //Player Comparison
  • Actions
    • Unit Group - Remove (Triggering unit) from CreepGroup
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in CreepGroup) Equal to 0
      • Then - Actions
        • Trigger - Turn on Trigger3 <gen>
      • Else - Actions
Variables used:
• CreepGroup (type: Unit Group)
• WaveNumber (type: Integer) - followed the Conversion - Convert String to Integer to get that result, in Trigger2.
• Units[] (type: Unit-type with "Array" option ticked)

Can you tell me how i can upload my map and if you want and if you have time - import the trigger in my map only for 5 levels - i will copy and make it for the 35 levels left. Thank you VERY VERY much every minute i will click +rep for you and i WILL write in my map : 'Map maded with the great help of Pharaoh!' :) :) :)
 
Level 11
Joined
Dec 5, 2009
Messages
846
How to upload your map. Just go advanced then go a bit down on the page. click manage attachments. Then you just upload your map. Be sure that you doesn't click on the X too early. Then your map wont be uploaded.
 
Of course I haven't protected the map and of course that's not a sign of map's protection. I am not really sure why it does say so, normally those notifications appear when you there is an atempt of opening a map that was made with a more recent patch than the current patch of your Warcraft III or when you are trying to open a map with hashtables in JNGP.

I used the regular editor to edit your triggers. I will upload it once again, but make sure you have the latest patch installed.

  • Spawn Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Unit types --------
      • Set Units[1] = Zergling
      • Set Units[2] = Footman
      • Set Units[3] = Rifleman
      • Set Units[4] = Zombie
      • Set Units[5] = Grunt
      • Set Units[6] = Skeletal Mage
      • Set Units[7] = Shade
      • Set Units[8] = Necromancer
      • Set Units[9] = Giant Skeleton Warrior
      • Set Units[10] = Crypt Fiend
      • Set Units[11] = Hydralisk
      • Set Units[12] = Space Fel Orc
      • Set Units[13] = Banshee
      • Set Units[14] = Abomination
      • Set Units[15] = Misha (Level 4)
      • Set Units[16] = Spirit Wolf (Level 1)
      • Set Units[17] = Huntress
      • Set Units[18] = Tauren
      • Set Units[19] = Blue Dragonspawn Meddler
      • Set Units[20] = Thunder Lizard
      • Set Units[21] = Naga Royal Guard
      • Set Units[22] = Rock Golem
      • Set Units[23] = Mountain Giant
      • Set Units[24] = Ogre Magi
      • Set Units[25] = Ogre Lord
      • Set Units[26] = Dark Ranger
      • Set Units[27] = Lord Garithos
      • Set Units[28] = Arthas
      • Set Units[29] = Sea Witch
      • Set Units[30] = Pit Lord
      • Set Units[31] = Demon Hunter
      • Set Units[32] = Illidan
      • Set Units[33] = Avatar of Vengeance
      • Set Units[34] = Couatl
      • Set Units[35] = Hippogryph
      • Set Units[36] = Harpy Queen
      • Set Units[37] = Black Drake
      • Set Units[38] = Chimaera
      • Set Units[39] = Frost Wyrm
      • Set Units[40] = Red Drake
      • -------- Units' Count (how many units will be spawned, since you use different values for each wave) --------
      • Set UnitsCount[1] = 15
      • Set UnitsCount[2] = 15
      • Set UnitsCount[3] = 15
      • Set UnitsCount[4] = 16
      • Set UnitsCount[5] = 16
      • Set UnitsCount[6] = 16
      • Set UnitsCount[7] = 17
      • Set UnitsCount[8] = 17
      • Set UnitsCount[9] = 17
      • Set UnitsCount[10] = 18
      • Set UnitsCount[11] = 18
      • Set UnitsCount[12] = 18
      • Set UnitsCount[13] = 19
      • Set UnitsCount[14] = 19
      • Set UnitsCount[15] = 19
      • Set UnitsCount[16] = 20
      • Set UnitsCount[17] = 20
      • Set UnitsCount[18] = 20
      • Set UnitsCount[19] = 21
      • Set UnitsCount[20] = 21
      • Set UnitsCount[21] = 21
      • Set UnitsCount[22] = 21
      • Set UnitsCount[23] = 22
      • Set UnitsCount[24] = 22
      • Set UnitsCount[25] = 5
      • Set UnitsCount[26] = 23
      • Set UnitsCount[27] = 23
      • Set UnitsCount[28] = 23
      • Set UnitsCount[29] = 24
      • Set UnitsCount[30] = 24
      • Set UnitsCount[31] = 24
      • Set UnitsCount[32] = 25
      • Set UnitsCount[33] = 5
      • Set UnitsCount[34] = 25
      • Set UnitsCount[35] = 25
      • Set UnitsCount[36] = 26
      • Set UnitsCount[37] = 27
      • Set UnitsCount[38] = 28
      • Set UnitsCount[39] = 30
      • Set UnitsCount[40] = 1
      • -------- ------------------- --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Trigger - Add to Chat Init <gen> the event (Player - (Player((Integer A))) types a chat message containing -go as A substring)
  • Chat Init
    • Events
    • Conditions
      • (Substring((Entered chat string), 1, 3)) Equal to -go
    • Actions
      • Set WaveNumber = (Integer((Substring((Entered chat string), 4, (Length of (Entered chat string))))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveNumber Less than or equal to 40
        • Then - Actions
          • Set SpawnPoint = (Center of SpawnArea <gen>)
          • For each (Integer A) from 1 to UnitsCount[WaveNumber], do (Actions)
            • Loop - Actions
              • Unit - Create 1 Units[WaveNumber] for Player 12 (Brown) at SpawnPoint facing Default building facing degrees
          • Game - Display to (All players) the text: (Current creeps' level: + ((String(WaveNumber)) + ( ( + ((Name of (Last created unit)) + ).))))
          • Custom script: call RemoveLocation (udg_SpawnPoint)
        • Else - Actions
SpawnPoint is a Point variable, WaveNumer is an Integer variable, UnitsCount[] is an Integer variable, Units[] is a Unit-type variable.
These two triggers replace the 40 triggers of yours.
For more about variables: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
 

Attachments

  • Tower Defence for site [v1.1].w3x
    404.3 KB · Views: 76
Last edited:
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hmm i think i have finded a way to do that what i want and i have tried and it works :) no matter if i use your trigger or mine - i will say in my map 'Special thanks to Pharaoh_'! because the trigger is not important it's about the time that you have spended to help me. :) and about the opening the map - my version is 1.07 :D that's why it don't work. And again - THANK YOU FOR EVERYTHING! :)))
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
I have looked at your trigger and i think i uderstand it :) i like you trigger , the only reson that i don't want to be in my map is that i don't understand it so well , so if i want to change somthing - i dont know what i need to change :D - the problem isn't in you - it is in me - that is my first map witch means that i don't understand any triggers so well - i need time :)
 
Last edited:
Level 11
Joined
Aug 1, 2009
Messages
714
Dude...Do not Double Post. No offence but you even triple post!!! Use the "
edit.gif
" Button
 
Status
Not open for further replies.
Top