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

[Trigger] Inventory System that fails when multiplayer

Status
Not open for further replies.
Level 6
Joined
May 9, 2010
Messages
127
So this triggers works wonder in single player and when I come to Multiplayer it doesn't go past the first if in the loop.
Can someone explain me why. if it's either my Ifs or my first part.
HeroInvo[] is set in another trigger and I know they work fine
Inventory[] is set at map init and it works well.

I'd like to have someone point out where is my mistake.

  • Using Copy
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
      • Player - Player 9 (Gray) Selects a unit
    • Conditions
      • Minute Greater than or equal to 1
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to 1 0058 <gen>
          • (Triggering unit) Equal to 2 0074 <gen>
          • (Triggering unit) Equal to 3 0079 <gen>
          • (Triggering unit) Equal to 4 0080 <gen>
          • (Triggering unit) Equal to 5 0081 <gen>
          • (Triggering unit) Equal to 6 0082 <gen>
    • Actions
      • Set PlayerInvo = (Player number of (Triggering player))
      • Set TempLoc1 = (Position of HeroInvo[PlayerInvo])
      • For each (Integer A) from 0 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Inventory[(Integer A)] is selected by (Triggering player)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-type of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to |cffffcc00Eternal Dagger|r
                • Then - Actions
                  • Set TempLoc2 = (TempLoc1 offset by 500.00 towards (Facing of HeroInvo[PlayerInvo]) degrees)
                  • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1)) on TempLoc2
                  • Custom script: call RemoveLocation(udg_TempLoc2)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-type of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to Ring of Power (Agi)
                    • Then - Actions
                      • Set TempGroup = (Units within 800.00 of TempLoc1 matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Triggering player)) Equal to False)))
                      • Unit Group - Pick every unit in TempGroup and do (Actions)
                        • Loop - Actions
                          • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1)) on (Picked unit)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-type of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to Magebane
                        • Then - Actions
                          • Set TempGroup = (Units within 800.00 of TempLoc1 matching (((Mana of (Matching unit)) Greater than or equal to 1.00) and (((Owner of (Matching unit)) is an enemy of (Triggering player)) Equal to True)))
                          • Unit Group - Pick every unit in TempGroup and do (Actions)
                            • Loop - Actions
                              • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1)) on (Picked unit)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item level of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to 5
                            • Then - Actions
                              • Set TempGroup = (Units within 800.00 of TempLoc1 matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Triggering player)) Equal to True)))
                              • Unit Group - Pick every unit in TempGroup and do (Actions)
                                • Loop - Actions
                                  • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1)) on (Picked unit)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Item level of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to 4
                                • Then - Actions
                                  • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Item level of (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))) Equal to 2
                                    • Then - Actions
                                      • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1)) on TempLoc1
                                    • Else - Actions
                                      • Hero - Order HeroInvo[PlayerInvo] to use (Item carried by HeroInvo[PlayerInvo] in slot ((Integer A) + 1))
            • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Selection - Select HeroInvo[PlayerInvo] for (Triggering player)
 
Last edited:
Level 6
Joined
May 9, 2010
Messages
127
I did this, but my problem persist, in multiplayer, it just won't work. Well, I found out that soemtimes it works when I select the first one than second one, or pressing space.

I'd like it to work as smooth as when I'm playing solo. Is there too much if's ?
 
Status
Not open for further replies.
Top