• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Need help debugging

Status
Not open for further replies.
Level 4
Joined
Jan 14, 2005
Messages
73
Can anyone help me debug my map? Just the triggers, It was working fine untill i added 3 things
1.) A Hero
2.) Settings Triggers (Dialog That lets player turn on or turn off Minigame)
3.) Minigames (every 10 levels theres a minigame)

Now since adding the above triggers my other triggers stoped working

"SkillBuy/Add" > "Transfer Item" No longer transfers the item (ABSOLUTELY NO IDEA HOW THIS HAPPENED) I didn't change anything even remotely related to this trigger (Other then adding a new hero)

Levels Hang at Round 2
(Im trying to figure out why this happend, But my world edit debug skills arnt the best)

BTW If anyone sees memory leaks let me know so I can fix them

Please don't Reply unless you know you can help. Otherwise Thanks :D

Heres my Malfunctioning Triggers

  • TransferItem
    • Events
      • Unit - A unit owned by Player 1 (Red) Acquires an item
      • Unit - A unit owned by Player 2 (Blue) Acquires an item
      • Unit - A unit owned by Player 3 (Teal) Acquires an item
      • Unit - A unit owned by Player 4 (Purple) Acquires an item
      • Unit - A unit owned by Player 5 (Yellow) Acquires an item
      • Unit - A unit owned by Player 6 (Orange) Acquires an item
      • Unit - A unit owned by Player 7 (Green) Acquires an item
      • Unit - A unit owned by Player 8 (Pink) Acquires an item
      • Unit - A unit owned by Player 9 (Gray) Acquires an item
      • Unit - A unit owned by Player 10 (Light Blue) Acquires an item
      • Unit - A unit owned by Player 11 (Dark Green) Acquires an item
      • Unit - A unit owned by Player 12 (Brown) Acquires an item
    • Conditions
      • (Unit-type of (Buying unit)) Equal to BuyTemp
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerSelectedHero[(Player number of (Triggering player))] Not equal to No unit
        • Then - Actions
          • Set Item_Temp = (Item carried by PlayerSelectedHero[(Player number of (Triggering player))] in slot 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item being manipulated)) Equal to Powerup
            • Then - Actions
              • Hero - Drop the item from slot 1 of PlayerSelectedHero[(Player number of (Triggering player))]
              • Hero - Give (Item being manipulated) to PlayerSelectedHero[(Player number of (Triggering player))]
              • Hero - Order PlayerSelectedHero[(Player number of (Triggering player))] to use (Item being manipulated)
              • Hero - Give Item_Temp to PlayerSelectedHero[(Player number of (Triggering player))]
            • Else - Actions
              • Hero - Give (Item being manipulated) to PlayerSelectedHero[(Player number of (Triggering player))]
        • Else - Actions
          • Item - Remove (Item being manipulated)

TransferItem Doesn't Give the item to the hero like it should


  • Check Timer
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
      • (Number of living Units[Level] units owned by Neutral Hostile) Less than or equal to 0
      • RoundInProgress Equal to True
    • Actions
      • Set RoundInProgress = False
      • For each (Integer LoopReuseable[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Game - Display to (Player group((Player(LoopReuseable[0])))) the text: (|cff7DBEF1You have Earned + ((|cffFFCC00 + (String(Income[(Player number of (Player(LoopReuseable[0])))]))) + |cff7DBEF1for summoning creeps))
          • Set Income_BoughtSpawns_PerPlayer[LoopReuseable[0]] = 0
          • Player - Add Income[LoopReuseable[0]] to (Player(LoopReuseable[0])) Current gold
          • Player - Set (Player(LoopReuseable[0])) Food used to 0
          • Player - Set (Player(LoopReuseable[0])) Food cap to (Level + (Loop_Level x 9))
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start timer as a One-shot timer that will expire in 10.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Round + ((String((Level + 1))) + in:))
      • Trigger - Turn off (This trigger)

Not Sure Which of my spawn Triggers is causing a problem so i just put them all here


  • Increase Level
    • Events
      • Time - timer expires
    • Conditions
    • Actions
      • Set Level = (Level + 1)
      • Set Income_BoughtSpawns = 0
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Minigame[Level] Equal to <Empty String>
          • Units[Level] Equal to No unit-type
        • Then - Actions
          • Set Level = 0
          • Set Loop_Level = (Loop_Level + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Loop_Level Equal to 1
            • Then - Actions
              • Game - Display to (All players) the text: |cffFE890DCongratul...
            • Else - Actions
              • Game - Display to (All players) the text: (|cffFFCC00Congratulations!!! |cff7DBEF1You have now compleated + ((String((Loop_Level - 1))) + ( |cff7DBEF1loops. You are now on Loop # + ((String(Loop_Level)) + (|n + (|cff7DBEF1Creeps now have |cffFF0202+ + (((String((Loop_Level x 500))) + HP ) + (<Empty
        • Else - Actions
          • -------- Setup Minigames --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Minigame[Level] Equal to ffa-arena
            • Then - Actions
              • Set RoundInProgress = True
              • For each (Integer LoopReuseable[0]) from 1 to 12, do (Actions)
                • Loop - Actions
                  • For each (Integer LoopReuseable[1]) from 1 to 12, do (Actions)
                    • Loop - Actions
                      • Player - Make (Player(LoopReuseable[0])) treat (Player(LoopReuseable[1])) as an Enemy with shared vision
                  • Unit - Move PlayerSelectedHero[(Player number of Player_Number[(Player number of (Player(LoopReuseable[0])))])] instantly to (Center of Arena 1 <gen>)
            • Else - Actions
          • Wait until ((Number of units in (Units in Arena 1 <gen> matching (((Matching unit) is A Hero) Equal to True))) Equal to 1), checking every 1.00 seconds
          • Set Group = (Units in Arena 1 <gen> matching (((Matching unit) is A Hero) Equal to True))
          • Set unit_tmp = (Random unit from Group)
          • Unit - Move unit_tmp instantly to (Center of PlayerSpawns[(Player number of (Owner of unit_tmp))])
          • Game - Display to (All players) the text: ((Player_Colors[(Player number of (Owner of unit_tmp))] + (Name of (Owner of unit_tmp))) + |cff00A8FFHas won the battle, and has been given |cffFFCC00250 |cff00A8FFgold.)
          • Set RoundInProgress = False
          • For each (Integer LoopReuseable[0]) from 1 to 12, do (Actions)
            • Loop - Actions
              • For each (Integer LoopReuseable[1]) from 1 to 12, do (Actions)
                • Loop - Actions
                  • Player - Make (Player(LoopReuseable[0])) treat (Player(LoopReuseable[1])) as an Ally with shared vision
      • For each (Integer LoopReuseable[0]) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Income_BoughtSpawns_PerPlayer[LoopReuseable[0]] = 0
      • Trigger - Turn on SetupSpawnUnits <gen>
      • Custom script: call DestroyGroup(udg_Group)


Increase Level Is supposed to make the level go up (I think it works)


  • SetupSpawnUnits
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
      • RoundInProgress Equal to False
    • Actions
      • Set RoundInProgress = True
      • Game - Display to (All players) the text: ((|cff7DBEF1Level |cffFF0202 + (String(Level))) + (|cff7DBEF1: |cffFF0202 + ((String(SpawnNumber[Level])) + ( |cff008800 + Unit_Name[Level]))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Unit_abilities[Level] Equal to <Empty String>
        • Then - Actions
          • Game - Display to (All players) the text: This wave has no ab...
        • Else - Actions
          • Game - Display to (All players) the text: (This wave Of Creeps has: + Unit_abilities[Level])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • For each (Integer E[9]) from 1 to SpawnNumber[Level], do (Actions)
            • Loop - Actions
              • Wait 5.00 seconds
              • For each (Integer E[10]) from 1 to 12, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • PlayerSelectedHero[E[10]] Not equal to No unit
                      • ((Player(E[10])) slot status) Equal to Is playing
                      • ((Player(E[10])) controller) Equal to User
                    • Then - Actions
                      • Unit - Create (1 + Loop_Level) Units[Level] for Neutral Hostile at (Center of CreepSpawnPoints[E[10]]) facing Default building facing degrees
                      • Unit Group - Add (Last created unit) to CreatedUnits
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Loop_Level Greater than 0
                        • Then - Actions
                          • For each (Integer E[6]) from 1 to (10 x Loop_Level), do (Actions)
                            • Loop - Actions
                              • Unit Group - Pick every unit in CreatedUnits and do (Actions)
                                • Loop - Actions
                                  • Set Max_Hp = ((Integer((Max life of (Picked unit)))) + (500 x Loop_Level))
                                  • Set Some_Unit = (Picked unit)
                                  • Trigger - Run Set Max Hp <gen> (checking conditions)
                                  • Unit - Add Item Permanent Damage Gain to (Picked unit)
                                  • Special Effect - Destroy (Last created special effect)
                          • Game - Display to (All players) the text: |cff7DBEF1You have ...
                        • Else - Actions
                    • Else - Actions
                      • Do nothing
        • Else - Actions
      • Custom script: call DestroyGroup(udg_CreatedUnits)
      • Wait until ((Number of living Units[Level] units owned by Neutral Hostile) Less than or equal to 0), checking every 1.00 seconds
      • Trigger - Run SetupSpawnUnits Copy <gen> (checking conditions)
      • Trigger - Turn off (This trigger)


SetupSpawnUnits Spawns Units at all the playing players spawn points if thier alive and have a hero.


  • SetupSpawnUnits Copy
    • Events
    • Conditions
    • Actions
      • Set RoundInProgress = True
      • Wait 3.00 seconds
      • For each (Integer E[4]) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(E[4])) controller) Equal to User
              • ((Player(E[4])) slot status) Equal to Is playing
              • (Number of units in CreepSummons[E[4]]) Greater than 0
            • Then - Actions
              • Game - Display to (All players) the text: (Now Spawning + ((String(Income_BoughtSpawns)) + Bought Units))
              • For each (Integer E[5]) from (E[4] + 1) to (E[4] + 13), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • E[5] Greater than or equal to 13
                    • Then - Actions
                      • Set var2 = (Player number of Player_Number[(E[5] - 12)])
                    • Else - Actions
                      • Set var2 = (Player number of Player_Number[E[5]])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(var2)) slot status) Equal to Is playing
                      • ((Player(var2)) controller) Equal to User
                      • PlayerSelectedHero[var2] Not equal to No unit
                    • Then - Actions
                      • For each (Integer LoopReuseable[3]) from 0 to Income_BoughtSpawns_PerPlayer[E[4]], do (Actions)
                        • Loop - Actions
                          • Set loc[0] = (Center of CreepSpawnPoints[var2])
                          • Set unit_tmp = (Random unit from CreepSummons[E[4]])
                          • Unit - Change ownership of unit_tmp to Neutral Hostile and Change color
                          • Unit - Move unit_tmp instantly to loc[0]
                          • Unit Group - Remove unit_tmp from CreepSummons[E[4]]
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Loop_Level Greater than 0
                            • Then - Actions
                              • Set Max_Hp = ((Integer((Max life of (Last created unit)))) + (500 x Loop_Level))
                              • Set Some_Unit = unit_tmp
                              • Trigger - Run Set Max Hp <gen> (checking conditions)
                              • For each (Integer E[6]) from 1 to (10 x Loop_Level), do (Actions)
                                • Loop - Actions
                                  • Unit - Add Item Permanent Damage Gain to (Last created unit)
                                  • Special Effect - Destroy (Last created special effect)
                            • Else - Actions
                    • Else - Actions
            • Else - Actions
              • Game - Display to (Player group((Player(E[4])))) the text: |cff7DBEF1No one Su...
      • Trigger - Turn on Check Timer <gen>


SetupSpawnUnits Copy Is for all the creeps the player Bought/Summoned

I also Attached my map so you can see everything thats there. While I wait for responses im going to be trying to fix The Level Spawn (Will still need help lol). Anyway thanks in advance for any help, Btw im only online during weekends however when I can il rep anyone whos helped me





Most of the above is fixed now

I managed to fix everything except for level 10 which is really confusing if someone would help me im going to reupload my map (With fixed triggers) Its the Increase Level Trigger thats messing up
 

Attachments

  • Hero Survival Beta 0.09.w3x
    505 KB · Views: 50
Last edited:
Status
Not open for further replies.
Top