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

[Solved] Triggers gone crazy

Status
Not open for further replies.
Level 15
Joined
Oct 18, 2008
Messages
1,588
It's hard to describe... But exactly not what should have happened... The analog-to-binary trigger gave crazy numbers, the trigger which should have emptied the inventory emptied it, but didn't put into it the correct set of new items (let's say a double inventory system) and if I pressed the change back (inventory set) button, it removed 1 item, then clicking again gave back 1 item, then clicking again removed 1 item and so on-but I used a cycle for this Oo
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
No, the normal values are set, the problem is the trigger doesn't work at ALL as it should... I rechecked my code like 50times, but it doesn't work...
For example this one generates the gems it should but it only generates 1 or 2 item of type " " -well I know it's weird to call an item like this but I imported the item from another player's map-so the item "Back to inventory" is in slot 4.
  • For each (Integer A) from 1 to SocketedItemTypesNumber, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to SockedtedItemTypes[(Integer A)]
        • Then - Actions
          • For each (Integer B) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hashtable - Save Handle Of(Item carried by (Triggering unit) in slot (Integer B)) as (Integer B) of (Key (Triggering unit)) in SocketTempitems
              • Item - Move (Item carried by (Triggering unit) in slot (Integer B)) to SocketTempPlace
          • For each (Integer B) from 1 to (Load 1 of (Key (Item being manipulated)) from CurrentSocketsUsed), do (Actions)
            • Loop - Actions
              • For each (Integer X) from 1 to GemTypesNumber, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Integer B) of (Key (Item being manipulated)) from SocketedGems) Equal to X
                    • Then - Actions
                      • Hero - Create UsedGemTypes[X] and give it to (Triggering unit)
                    • Else - Actions
                  • Do nothing
          • For each (Integer B) from 1 to (SocketsMax[(Integer A)] - (Load 1 of (Key (Item being manipulated)) from CurrentSocketsUsed)), do (Actions)
            • Loop - Actions
              • Hero - Create Socket and give it to (Triggering unit)
          • For each (Integer A) from 1 to (5 - SocketsMax[(Integer A)]), do (Actions)
            • Loop - Actions
              • Hero - Create and give it to (Triggering unit)
          • Hero - Create Back to inventory and give it to (Triggering unit)
          • Skip remaining actions
        • Else - Actions
And if I click on the item Back to Inventory this should happen:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Item-type of (Item being manipulated)) Equal to Back to inventory
    • Then - Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
          • Hero - Give (Load (Integer A) of (Key (Triggering unit)) in SocketTempitems) to (Triggering unit)
    • Else - Actions
But instead it removes the first item, or replaces it with an item...
These triggers are absolutely separated, none of them should make things like these...
 
Status
Not open for further replies.
Top