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

Advanced Pet System v2 [MPI] [Wohuynia]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: Palooo3
Note:

This is an advanced spell system, so the only used with multi board.
I know that in this system there are 10 triggers that is really much, but to add new pets you don't need to set up new triggers, also using my system you can add more "Arrow key controlled" multi boards. Probably most of you wont use it cause of the trigger count but just read it and maybe some of you will learn something.

PS#2: I accept only good criticism, flame will be ignored and reported.
Update log
2.0 reworked coding, change layout, added more features.
1.7 removed final leaks, fixed documentation.
1.6 fixed a lot of bugs, reworked the code, made it MPI.
1.5 reworked the coding a bit.
1.4 cleared all the leaks.
1.3 cleared most of the leaks.
1.2 some more fixes, added trigger to the forum.
1.1 some fixes, made it more user friendly.
1.0 official release.
Pros/Cons
Pros:
1. It is the most advanced pet system on hiveworkshop.com.
2. It uses arrow keys to summon a pet.
3. Has an easy show/hide multi board.
4. Bugles and leak-less.
5. Easy to add new pets.
6. Easy Copy/Paste export.
7. MPI

Cons:
1. Quite a lot of triggers.
2. Uses custom made abilities/units/items (could be changed)
3. Trigger is hard to understand for beginners.


  • Initialization
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Set up variables --------
      • Set W_P_Group[1] = (All players controlled by a User player)
      • Set W_Point = (Center of (Playable map area))
      • Set W_Point2 = (Center of (Playable map area))
      • Set W_X = (Number of players in (All players controlled by a User player))
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- This creates multi board and all the variables --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Set W_PetOwner[W_Int] = No unit
          • Set W_Pet1[W_Int] = No unit
          • Set W_Pet2[W_Int] = No unit
          • Set W_Pet3[W_Int] = No unit
          • Set W_Rolumn[W_Int] = 0
          • Set W_Range[W_Int] = 350.00
          • Multiboard - Create a multiboard with 4 columns and 5 rows, titled Pet Menu
          • Set W_Multiboard[W_Int] = (Last created multiboard)
          • Multiboard - Set the width for W_Multiboard[W_Int] item in column 0, row 1 to 1.50% of the total screen width
          • Multiboard - Set the width for W_Multiboard[W_Int] item in column 1, row 0 to 2.00% of the total screen width
          • Multiboard - Set the width for W_Multiboard[W_Int] item in column 0, row 0 to 4.00% of the total screen width
          • Multiboard - Set the width for W_Multiboard[W_Int] item in column 2, row 2 to 7.00% of the total screen width
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 0, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 2 to ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 3 to UI\Widgets\Console\Human\infocard-heroattributes-str.blp
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 4 to UI\Widgets\Console\Human\infocard-heroattributes-agi.blp
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 5 to UI\Widgets\Console\Human\infocard-heroattributes-int.blp
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 2 to Name
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 2 to Lvl
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 3 to Str:
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 4 to Agi:
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 5 to Int:
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 3 to (0 + (|Cffff0000 + + 0))
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 4 to (0 + (|Cffff0000 + + 0))
          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 5 to (0 + (|Cffff0000 + + 0))
          • Multiboard - Hide W_Multiboard[W_Int]
      • -------- Remove Location leaks --------
      • Custom script: call DestroyForce(udg_W_P_Group[1])
      • Custom script: call RemoveLocation(udg_W_Point)
      • Custom script: call RemoveLocation(udg_W_Point2)
  • Show Interfaces
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Pet Menu
    • Actions
      • -------- This trigger shows the multi board after ability being casted --------
      • -------- I advice not to touch unless you really know what are you doing --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • -------- ----------------------- --------
          • -------- This locks camera to triggering unit, else it would move camera up and down cause of arrow keys --------
          • -------- ----------------------- --------
          • Camera - Lock camera target for (Triggering player) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
          • Set W_Rolumn[W_Int] = 1
          • For each (Integer W_Integer) from 1 to 4, do (Actions)
            • Loop - Actions
              • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Integer, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
          • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Rolumn[W_Int], row 1 to UI\MiniMap\MinimapIcon\MinimapIconGold.blp
          • Multiboard - Show W_Multiboard[W_Int]
          • Custom script: endif
          • Trigger - Run Update Interface <gen> (checking conditions)
  • Move Left
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
      • Player - Player 3 (Teal) Presses the Left Arrow key
      • Player - Player 4 (Purple) Presses the Left Arrow key
      • Player - Player 5 (Yellow) Presses the Left Arrow key
      • Player - Player 6 (Orange) Presses the Left Arrow key
      • Player - Player 7 (Green) Presses the Left Arrow key
      • Player - Player 8 (Pink) Presses the Left Arrow key
      • Player - Player 9 (Gray) Presses the Left Arrow key
      • Player - Player 10 (Light Blue) Presses the Left Arrow key
      • Player - Player 11 (Dark Green) Presses the Left Arrow key
      • Player - Player 12 (Brown) Presses the Left Arrow key
    • Conditions
    • Actions
      • -------- This makes multi board selection go up --------
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- Don't touch --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • W_Rolumn[W_Int] Greater than 0
            • Then - Actions
              • Set W_Rolumn[W_Int] = (W_Rolumn[W_Int] - 1)
              • For each (Integer W_Integer) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Integer, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
              • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Rolumn[W_Int], row 1 to UI\MiniMap\MinimapIcon\MinimapIconGold.blp
            • Else - Actions
          • Trigger - Run Update Interface <gen> (checking conditions)
          • Custom script: endif
      • -------- Don't touch --------
  • Move Right
    • Events
      • Player - Player 1 (Red) Presses the Right Arrow key
      • Player - Player 2 (Blue) Presses the Right Arrow key
      • Player - Player 3 (Teal) Presses the Right Arrow key
      • Player - Player 4 (Purple) Presses the Right Arrow key
      • Player - Player 5 (Yellow) Presses the Right Arrow key
      • Player - Player 6 (Orange) Presses the Right Arrow key
      • Player - Player 7 (Green) Presses the Right Arrow key
      • Player - Player 8 (Pink) Presses the Right Arrow key
      • Player - Player 9 (Gray) Presses the Right Arrow key
      • Player - Player 10 (Light Blue) Presses the Right Arrow key
      • Player - Player 11 (Dark Green) Presses the Right Arrow key
      • Player - Player 12 (Brown) Presses the Right Arrow key
    • Conditions
    • Actions
      • -------- This makes multi board selection go down --------
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- Don't touch --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • W_Rolumn[W_Int] Less than 4
            • Then - Actions
              • Set W_Rolumn[W_Int] = (W_Rolumn[W_Int] + 1)
              • For each (Integer W_Integer) from 1 to 4, do (Actions)
                • Loop - Actions
                  • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Integer, row 1 to UI\Minimap\MinimapIconCreepLoc2.blp
              • Multiboard - Set the icon for W_Multiboard[W_Int] item in column W_Rolumn[W_Int], row 1 to UI\MiniMap\MinimapIcon\MinimapIconGold.blp
            • Else - Actions
          • Trigger - Run Update Interface <gen> (checking conditions)
          • Custom script: endif
      • -------- Don't touch --------
  • Update Interface
    • Events
    • Conditions
    • Actions
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • W_Rolumn[W_Int] Equal to 1
            • Then - Actions
              • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 0 to Show text and Hide icons
              • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 1, row 0 to Show text and Show icons
              • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 1 to Show text and Show icons
              • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 2 to ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 2 to (Proper name of W_Pet1[W_Int])
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 2 to (Lv: + (String((Hero level of W_Pet1[W_Int]))))
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 3 to Str:
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 4 to Agi:
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 5 to Int:
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 3 to ((String((Strength of W_Pet1[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Strength of W_Pet1[W_Int] (Include bonuses)) - (Strength of W_Pet1[W_Int] (Exclude bonuses)))))))
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 4 to ((String((Agility of W_Pet1[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Agility of W_Pet1[W_Int] (Include bonuses)) - (Agility of W_Pet1[W_Int] (Exclude bonuses)))))))
              • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 5 to ((String((Intelligence of W_Pet1[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Intelligence of W_Pet1[W_Int] (Include bonuses)) - (Intelligence of W_Pet1[W_Int] (Exclude bonuses)))))))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • W_Rolumn[W_Int] Equal to 2
                • Then - Actions
                  • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 0 to Show text and Hide icons
                  • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 1, row 0 to Show text and Show icons
                  • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 1 to Show text and Show icons
                  • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 2 to ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 2 to (Proper name of W_Pet2[W_Int])
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 2 to (Lv: + (String((Hero level of W_Pet2[W_Int]))))
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 3 to Str:
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 4 to Agi:
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 5 to Int:
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 3 to ((String((Strength of W_Pet2[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Strength of W_Pet2[W_Int] (Include bonuses)) - (Strength of W_Pet2[W_Int] (Exclude bonuses)))))))
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 4 to ((String((Agility of W_Pet2[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Agility of W_Pet2[W_Int] (Include bonuses)) - (Agility of W_Pet2[W_Int] (Exclude bonuses)))))))
                  • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 5 to ((String((Intelligence of W_Pet2[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Intelligence of W_Pet2[W_Int] (Include bonuses)) - (Intelligence of W_Pet2[W_Int] (Exclude bonuses)))))))
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • W_Rolumn[W_Int] Equal to 3
                    • Then - Actions
                      • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 0 to Show text and Hide icons
                      • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 1, row 0 to Show text and Show icons
                      • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 1 to Show text and Show icons
                      • Multiboard - Set the icon for W_Multiboard[W_Int] item in column 1, row 2 to ReplaceableTextures\WorldEditUI\Editor-Random-Unit.blp
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 2 to (Proper name of W_Pet3[W_Int])
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 2 to (Lv: + (String((Hero level of W_Pet3[W_Int]))))
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 3 to Str:
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 4 to Agi:
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 5 to Int:
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 3 to ((String((Strength of W_Pet3[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Strength of W_Pet3[W_Int] (Include bonuses)) - (Strength of W_Pet3[W_Int] (Exclude bonuses)))))))
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 4 to ((String((Agility of W_Pet3[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Agility of W_Pet3[W_Int] (Include bonuses)) - (Agility of W_Pet3[W_Int] (Exclude bonuses)))))))
                      • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 5 to ((String((Intelligence of W_Pet3[W_Int] (Exclude bonuses)))) + (|Cff00ff00 + + (String(((Intelligence of W_Pet3[W_Int] (Include bonuses)) - (Intelligence of W_Pet3[W_Int] (Exclude bonuses)))))))
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • W_Rolumn[W_Int] Equal to 4
                        • Then - Actions
                          • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 0 to Show text and Hide icons
                          • Multiboard - Set the display style for W_Multiboard[W_Int] item in column 0, row 1 to Show text and Show icons
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 2 to Press <Esc>
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 3 to To
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 3 to Exit
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 2 to <Empty String>
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 4 to <Empty String>
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 2, row 5 to <Empty String>
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 4 to <Empty String>
                          • Multiboard - Set the text for W_Multiboard[W_Int] item in column 3, row 5 to <Empty String>
                        • Else - Actions
          • Custom script: endif
  • Exit
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
      • Player - Player 5 (Yellow) skips a cinematic sequence
      • Player - Player 6 (Orange) skips a cinematic sequence
      • Player - Player 7 (Green) skips a cinematic sequence
      • Player - Player 8 (Pink) skips a cinematic sequence
      • Player - Player 9 (Gray) skips a cinematic sequence
      • Player - Player 10 (Light Blue) skips a cinematic sequence
      • Player - Player 11 (Dark Green) skips a cinematic sequence
      • Player - Player 12 (Brown) skips a cinematic sequence
    • Conditions
    • Actions
      • -------- These triggers issue an action after selecting your option and pressing right arrow key --------
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- Don't touch --------
      • Set W_P_Group[2] = (Player group((Owner of W_PetOwner[W_Int])))
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • -------- All these triggers are necessary for the pet system, don't delete anything --------
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • W_Rolumn[W_Int] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (W_Pet1[W_Int] is dead) Equal to True
                • Then - Actions
                  • Set W_Pet[W_Int] = W_Pet1[W_Int]
                  • Set W_Point2 = (Position of W_PetOwner[W_Int])
                  • Unit - Kill W_Pet2[W_Int]
                  • Unit - Kill W_Pet3[W_Int]
                  • Hero - Instantly revive W_Pet[W_Int] at W_Point2, Hide revival graphics
                  • Set W_Point = (Position of W_Pet[W_Int])
                  • Unit - Unhide W_Pet[W_Int]
                  • -------- ----------------------- --------
                  • -------- You can chose any kinda of spell effect(Leaks and spells will be removed automaticaly) --------
                  • -------- ----------------------- --------
                  • Special Effect - Create a special effect at W_Point using Abilities\Spells\Other\Charm\CharmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_W_Point)
                  • Custom script: call RemoveLocation(udg_W_Point2)
                • Else - Actions
                  • Game - Display to W_P_Group[2] the text: The Pet is already ...
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • W_Rolumn[W_Int] Equal to 2
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (W_Pet2[W_Int] is dead) Equal to True
                    • Then - Actions
                      • Set W_Pet[W_Int] = W_Pet2[W_Int]
                      • Set W_Point2 = (Position of W_PetOwner[W_Int])
                      • Unit - Kill W_Pet1[W_Int]
                      • Unit - Kill W_Pet3[W_Int]
                      • Hero - Instantly revive W_Pet[W_Int] at W_Point2, Hide revival graphics
                      • Set W_Point = (Position of W_Pet[W_Int])
                      • Unit - Unhide W_Pet[W_Int]
                      • -------- ----------------------- --------
                      • -------- You can chose any kinda of spell effect(Leaks and spells will be removed automaticaly) --------
                      • -------- ----------------------- --------
                      • Special Effect - Create a special effect at W_Point using Abilities\Spells\Other\Charm\CharmTarget.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation(udg_W_Point)
                      • Custom script: call RemoveLocation(udg_W_Point2)
                    • Else - Actions
                      • Game - Display to W_P_Group[2] the text: The Pet is already ...
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • W_Rolumn[W_Int] Equal to 3
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (W_Pet3[W_Int] is dead) Equal to True
                        • Then - Actions
                          • Set W_Pet[W_Int] = W_Pet3[W_Int]
                          • Set W_Point2 = (Position of W_PetOwner[W_Int])
                          • Unit - Kill W_Pet1[W_Int]
                          • Unit - Kill W_Pet2[W_Int]
                          • Hero - Instantly revive W_Pet[W_Int] at W_Point2, Hide revival graphics
                          • Set W_Point = (Position of W_Pet[W_Int])
                          • Unit - Unhide W_Pet[W_Int]
                          • -------- ----------------------- --------
                          • -------- You can chose any kinda of spell effect(Leaks and spells will be removed automaticaly) --------
                          • -------- ----------------------- --------
                          • Special Effect - Create a special effect at W_Point using Abilities\Spells\Other\Charm\CharmTarget.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Custom script: call RemoveLocation(udg_W_Point)
                          • Custom script: call RemoveLocation(udg_W_Point2)
                        • Else - Actions
                          • Game - Display to W_P_Group[2] the text: The Pet is already ...
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • W_Rolumn[W_Int] Equal to 4
                        • Then - Actions
                          • Multiboard - Hide W_Multiboard[W_Int]
                          • Set W_Rolumn[W_Int] = 0
                        • Else - Actions
          • Custom script: call DestroyForce(udg_W_P_Group[2])
          • Custom script: endif
      • -------- Don't touch --------
  • Pet Gen
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Pet
    • Actions
      • -------- These triggers adds pets to the multi board --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • -------- All these triggers are necessary for the pet system, don't delete anything --------
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • W_Pet1[W_Int] Equal to No unit
            • Then - Actions
              • Set W_PetOwner[W_Int] = (Triggering unit)
              • Set W_Point = (Position of W_PetOwner[W_Int])
              • -------- ----------------------- --------
              • -------- While creating new pets don't forget to change what pet it will spawn --------
              • -------- ----------------------- --------
              • Unit - Create 1 Pet for (Owner of (Triggering unit)) at W_Point facing Default building facing degrees
              • Set W_Pet1[W_Int] = (Last created unit)
              • Unit - Hide W_Pet1[W_Int]
              • Unit - Kill W_Pet1[W_Int]
              • Custom script: call RemoveLocation(udg_W_Point)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • W_Pet2[W_Int] Equal to No unit
                • Then - Actions
                  • Set W_PetOwner[W_Int] = (Triggering unit)
                  • Set W_Point = (Position of W_PetOwner[W_Int])
                  • -------- ----------------------- --------
                  • -------- While creating new pets don't forget to change what pet it will spawn --------
                  • -------- ----------------------- --------
                  • Unit - Create 1 Pet for (Owner of (Triggering unit)) at W_Point facing Default building facing degrees
                  • Set W_Pet2[W_Int] = (Last created unit)
                  • Unit - Hide W_Pet2[W_Int]
                  • Unit - Kill W_Pet2[W_Int]
                  • Custom script: call RemoveLocation(udg_W_Point)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • W_Pet3[W_Int] Equal to No unit
                    • Then - Actions
                      • Set W_PetOwner[W_Int] = (Triggering unit)
                      • Set W_Point = (Position of W_PetOwner[W_Int])
                      • -------- ----------------------- --------
                      • -------- While creating new pets don't forget to change what pet it will spawn --------
                      • -------- ----------------------- --------
                      • Unit - Create 1 Pet for (Owner of (Triggering unit)) at W_Point facing Default building facing degrees
                      • Set W_Pet3[W_Int] = (Last created unit)
                      • Unit - Hide W_Pet3[W_Int]
                      • Unit - Kill W_Pet3[W_Int]
                      • Custom script: call RemoveLocation(udg_W_Point)
                    • Else - Actions
                      • Hero - Create Pet Egg and give it to (Triggering unit)
          • Trigger - Run Update Interface <gen> (checking conditions)
          • Custom script: endif
  • Pet Fallow
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- These triggers make all your pets fallow you if range between <W_PetOwner[*]> and <W_Pet[*]> is bigger then varialbe <W_Range[*]> --------
      • -------- And if you character attacks a unit, pet also will attack --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • Set W_Point = (Position of W_PetOwner[W_Int])
          • Set W_Point2 = (Position of W_Pet[W_Int])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between W_Point and W_Point2) Greater than or equal to W_Range[W_Int]
            • Then - Actions
              • Unit - Order W_Pet[W_Int] to Right-Click W_PetOwner[W_Int]
            • Else - Actions
          • Custom script: call RemoveLocation(udg_W_Point2)
          • Custom script: call RemoveLocation(udg_W_Point)
          • Custom script: endif
  • Pet Lvl up
    • Events
      • Unit - A unit Gains a level
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • -------- I advice not to touch unless you really know what are you doing --------
      • -------- These triggers sets variable to pets current level and updates to the multi board --------
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to W_Pet[W_Int]
            • Then - Actions
              • Trigger - Run Update Interface <gen> (checking conditions)
            • Else - Actions
          • Custom script: endif
  • Pet Release
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Release Pet
    • Actions
      • For each (Integer W_Int) from 1 to W_X, do (Actions)
        • Loop - Actions
          • Custom script: if ( GetLocalPlayer() == Player(( udg_W_Int-1)) ) then
          • -------- These triggers remove pet and set variables to default after they are were released --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to W_Pet1[W_Int]
            • Then - Actions
              • Unit - Remove (Triggering unit) from the game
              • Set W_Pet1[W_Int] = No unit
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Triggering unit) Equal to W_Pet2[W_Int]
                • Then - Actions
                  • Unit - Remove (Triggering unit) from the game
                  • Set W_Pet2[W_Int] = No unit
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Triggering unit) Equal to W_Pet3[W_Int]
                    • Then - Actions
                      • Unit - Remove (Triggering unit) from the game
                      • Set W_Pet3[W_Int] = No unit
                    • Else - Actions
          • Trigger - Run Update Interface <gen> (checking conditions)
          • Custom script: endif
Keywords:
pet, system, advanced, multi board, multi, board, multiboard, summon, wohuynia.
Contents

Wohuynia's Pet System v2 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 11:30, 31st May 2011 Maker: Leak: Set W_X = (Number of players in (All players controlled by a User player)) Instead of looping through the player indexes, couldn't you use Custom...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

11:30, 31st May 2011
Maker:
Leak:
  • Set W_X = (Number of players in (All players controlled by a User player))
Instead of looping through the player indexes, couldn't you use
  • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
and utilize player number of triggering player for W_Int.
 
Level 7
Joined
Dec 9, 2008
Messages
114
Midnighters said:
Nice system, but maybe have it follow a bit closer
Now you can set <Range> in "Initialization" trigger.

x3GlikE said:
Post triggers!
Here maybe you'll feel better ;D i have wasted 25mins of my life time just for you.

jxtranghero said:
looks nice I should try this...
You better, else your post would be simple spam.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Owner of Triggering Unit -> Triggering Player

Set a temporary integer variable into the "player number" for quick reference.

Leak
  • (Position of PetOwner)
Another leak that is repeated 2 times as the above one.
  • Special Effect - Create a special effect at (Position of Pet[1]) using Abilities\Spells\Other\Charm\CharmTarget.mdl
Another leak
  • Player group((Owner of PetOwner))
This system isn't even MPI due to the exit trigger shutting everything down for all the players.

More leaks
  • Unit - Create 1 Pet_Type[1] for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
Change owner into triggering player too

Why do you set a pet and create a pet and instantly after kill it?

leak
  • Unit - Create 1 Pet_Type[2] for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
  • Unit - Create 1 Pet_Type[3] for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
follow trigger leaks 60 times per second

  • (Distance between (Position of PetOwner) and (Position of Pet[(Integer A)])) Greater than or equal to range
the idea is kinda good yet it's not leak free and it's not mpi
 
Level 7
Joined
Dec 9, 2008
Messages
114
Orcnet said:
this system is wonderful! do you know another version that does not use arrow keys? not a request, just a suggestion
This system has only one version of it, so no.

Why do you set a pet and create a pet and instantly after kill it?
Because i setup booleans that check if other pets are alive, plus if i wouldn't kill it it would cause some bugs also you would be able to summon more then one pet at the time or something.

This system isn't even MPI due to the exit trigger shutting everything down for all the players.
I think i fixed it, if not ill take my thinking capsule and go to sleep... Edit.

Fixed all of them, now it SHOULD NOT leak.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Still in the follow trigger you set a point which you dont use in the distance check

  • (Distance between (Position of PetOwner) and (Position of Pet[(Integer A)])) Greater than or equal to range
Also you only remove it if the range is greater. The remove custom script line should be behind the whole if, also you need to set another point

this should have needs fix before being approved
 
You're french aren't you ;)
Women's day in Lebanon also happens to be a very.. how do i put this.. "Politically Active" day :p - Very "Problematic"

Anyways, i just realized that your system isn't MPI (I looked at the comments below mine :p), and decided to change my rating (orally) to a 4/5 :/ DONT WORRY. I'm not going to change my rating on the hive, it's just a mental note.. -.- :p
 
Level 7
Joined
Dec 9, 2008
Messages
114
Magtheridon96 said:
You're french aren't you ;)
Women's day in Lebanon also happens to be a very.. how do i put this.. "Politically Active" day :p - Very "Problematic"

Anyways, i just realized that your system isn't MPI (I looked at the comments below mine :p), and decided to change my rating (orally) to a 4/5 :/ DONT WORRY. I'm not going to change my rating on the hive, it's just a mental note.. -.- :p
Ding Ding Ding, your dreams can come through, only for 1.99$ just email me with paypal to "[email protected]" and it will happen...
On topic: Now its MPI and thanks for the rating ;D

PS: Not French, Lithuanian, yeah this day gets very active in our country, discounts, commercials, "special for ladies", etc etc etc.

Adiktuz said:
Right now: idea is fine, not approvable yet due being not MUI and leakless

After it becomes MPI and leakless: great, approvable

After it becomes MUI: EPIC, HR I think...
Thanks for the comment, now it is great ;D

.VTZ. said:
it works for more than 1 player?
It is now.

baassee said:
Still in the follow trigger you set a point which you dont use in the distance check

  • (Distance between (Position of PetOwner) and (Position of Pet[(Integer A)])) Greater than or equal to range
Also you only remove it if the range is greater. The remove custom script line should be behind the whole if, also you need to set another point

this should have needs fix before being approved
Fixed it, now it doesn't leak.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Still not MPI as the MPI2 variable is never increased.

The Range variable isn't arrayed so that will destroy the MPI part as well.

You have to loop thru them all in the initialization trigger, like this variable:

  • Set Board[MPI2] = False
In the initialization trigger you leak this:

  • Set Point = (Center of (Playable map area))
  • Set Point2 = (Center of (Playable map area))
You're show multiboard trigger sucks. Every single spell on the map will 'cause a multiboard to be created.

Neither MPI variable is increased.

You should prefix all your variables as the names are way too common.

You should nest the ifs in the Operate Action trigger which is to put the second if in the first's else and the third in the second's else.

Pet Setup trigger should have the first if removed as its condition can be in the trigger's condition.

Pet Fallow trigger leaks as the variables are reset for nothing, it should look like this:

  • Set Point = (Position of PetOwner)
  • Set Point2 = (Position of Pet2[MPI2])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Distance between Point and Point2) Greater than or equal to range
  • Then - Actions
    • Unit - Order Pet1[MPI2] to Right-Click PetOwner
    • Unit - Order Pet2[MPI2] to Right-Click PetOwner
    • Unit - Order Pet3[MPI2] to Right-Click PetOwner
  • Else - Actions
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: call RemoveLocation(udg_Point2)
In the Pet Release trigger, the first if should be removed as the condition can be set into the trigger's condition.

Yeah it's not MPI and I have checked it.
 
Level 7
Joined
Dec 9, 2008
Messages
114
  • Set Point = (Position of PetOwner)
  • Set Point2 = (Position of Pet2[MPI2])
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Distance between Point and Point2) Greater than or equal to range
  • Then - Actions
  • Unit - Order Pet1[MPI2] to Right-Click PetOwner
  • Unit - Order Pet2[MPI2] to Right-Click PetOwner
  • Unit - Order Pet3[MPI2] to Right-Click PetOwner
  • Else - Actions
  • Custom script: call RemoveLocation(udg_Point)
  • Custom script: call RemoveLocation(udg_Point2)
This point doesn't work, only Pet2[*] will fallow/attack... Others will issue an order every 0.1 sec right click the pet owner.

You should prefix all your variables as the names are way too common.
And whats the problem with that?

You should nest the ifs
Done.

Still not MPI as the MPI2 variable is never increased.
Done.

Pet Setup trigger should have the first if removed as its condition can be in the trigger's condition.
Done.

Pet Fallow trigger leaks as the variables are reset for nothing, it should look like this:
Reworked fallowing, thou your suggestion wasn't completely right.

PS: i have busted my ass for 4h'rs to make it MPI/MUI now it should be everything you always wanted.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Good to see you updating but still a few flaws.

-
  • Set X = (Number of players in (All players controlled by a User player))
Leaks a Force

-Still in the show multiboard trigger, it will loop unnecessaryily because of the trigger's condition isn't right. Please move this condition into the trigger's condition:

  • (Ability being cast) Equal to Pet Menu
-(Owner of (Triggering unit))

Should be Triggering Player

-
  • (Player group((Owner of PetOwner[Int])))
Leaks a Force.

Apart from that, it looks a lot better than last time.

You still need to prefix the variables. No buts and whys.
 
Level 7
Joined
Dec 9, 2008
Messages
114
baassee said:
Good to see you updating but still a few flaws.

-
  • Set X = (Number of players in (All players controlled by a User player))
Leaks a Force

-Still in the show multiboard trigger, it will loop unnecessaryily because of the trigger's condition isn't right. Please move this condition into the trigger's condition:

  • (Ability being cast) Equal to Pet Menu
-(Owner of (Triggering unit))

Should be Triggering Player

-
  • (Player group((Owner of PetOwner[Int])))
Leaks a Force.

Apart from that, it looks a lot better than last time.

You still need to prefix the variables. No buts and whys.

All things fixed, edited variables, cleared leaks, other minor thingies :D
There are 2 more bugs that I need to fix, but that's after this week(Art exam is in 2 days and I'm missing like 20~ drawings :DD)
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Let's review this once again.

-You still leak a force. You set a variable and you don't even use it?

  • Set W_P_Group[1] = (All players controlled by a User player)
  • Set W_X = (Number of players in (All players controlled by a User player))
-The strings you're using as icons to the multiboard really should be stored into different arrayed string variables.

-I just remembered one thing. Why are you looping thru for every single trigger? Just do the if GetLocalPlayer() == GetTriggerPlayer() then
and after that you have a variable set into the player number of the triggering player. That would fix every single loop.

-Pet Level Up trigger needs a trigger condition.

-(Owner of (Triggering unit)) -> Triggering Player
 
Level 7
Joined
Dec 9, 2008
Messages
114
baassee said:
1.-The strings you're using as icons to the multiboard really should be stored into different arrayed string variables.

2.-I just remembered one thing. Why are you looping thru for every single trigger? Just do the if GetLocalPlayer() == GetTriggerPlayer() then
and after that you have a variable set into the player number of the triggering player. That would fix every single loop.

1st. you can store icons in variables, or at least, i don't know how.
2nd. i think i tested it without loop, but it bugged a lot, so i decided to use loop (i think)?
Ill fix other problems.
 
Level 1
Joined
Feb 4, 2009
Messages
3
if we add another newly custom made pet..how should we modify the triggers then? i dont know and dont really quite understand about it.
 

Fud

Fud

Level 3
Joined
Aug 12, 2011
Messages
42
I want to use it for a hunter hero... does it work for multiple players? someone else said no and i think that is pretty damn important...
 
Level 7
Joined
Dec 9, 2008
Messages
114
well this system does work, but only bad thing is that there is one leak in it that Maker stated earlier but i haven't done triggering for ages, so i don't quite remember how to fix it, its not really hard but i just don't have time to do that.
Quote from Private message from maker:
Leak:
  • Set W_X = (Number of players in (All players controlled by a User player))
Instead of looping through the player indexes, couldn't you use
  • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
and utilize player number of triggering player for W_Int.
 
Top