Fixing my system

Capndrs

New Member
Reaction score
3
I'm getting furious.
I made a really basic system for an inventory that mayches my game, but it has some errors. I'll post codes first.

Trigger:
  • Items
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-class of (Item carried by (Triggering unit) in slot 6)) Equal to Permanent
        • Then - Actions
          • If ((Item-class of (Item carried by (Triggering unit) in slot 1)) Equal to Campaign) then do (Item - Remove (Item carried by (Triggering unit) in slot 1)) else do (Hero - Drop the item from slot 1 of (Triggering unit))
          • Hero - Drop (Item being manipulated) from (Triggering unit)
          • Trigger - Turn off (This trigger)
          • Hero - Give (Item being manipulated) to (Triggering unit)
          • Trigger - Turn on (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-class of (Item carried by (Triggering unit) in slot 6)) Equal to Charged
            • Then - Actions
              • If ((Item-class of (Item carried by (Triggering unit) in slot 2)) Equal to Campaign) then do (Item - Remove (Item carried by (Triggering unit) in slot 2)) else do (Hero - Drop the item from slot 2 of (Triggering unit))
              • Hero - Drop (Item being manipulated) from (Triggering unit)
              • Trigger - Turn off (This trigger)
              • Hero - Give (Item being manipulated) to (Triggering unit)
              • Trigger - Turn on (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item carried by (Triggering unit) in slot 6)) Equal to Powerup
                • Then - Actions
                  • If ((Item-class of (Item carried by (Triggering unit) in slot 3)) Equal to Campaign) then do (Item - Remove (Item carried by (Triggering unit) in slot 3)) else do (Hero - Drop the item from slot 3 of (Triggering unit))
                  • Hero - Drop (Item being manipulated) from (Triggering unit)
                  • Trigger - Turn off (This trigger)
                  • Hero - Give (Item being manipulated) to (Triggering unit)
                  • Trigger - Turn on (This trigger)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-class of (Item carried by (Triggering unit) in slot 6)) Equal to Artifact
                    • Then - Actions
                      • If ((Item-class of (Item carried by (Triggering unit) in slot 4)) Equal to Campaign) then do (Item - Remove (Item carried by (Triggering unit) in slot 4)) else do (Hero - Drop the item from slot 4 of (Triggering unit))
                      • Hero - Drop (Item being manipulated) from (Triggering unit)
                      • Trigger - Turn off (This trigger)
                      • Hero - Give (Item being manipulated) to (Triggering unit)
                      • Trigger - Turn on (This trigger)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-class of (Item carried by (Triggering unit) in slot 6)) Equal to Purchasable
                        • Then - Actions
                          • If ((Item-class of (Item carried by (Triggering unit) in slot 5)) Equal to Campaign) then do (Item - Remove (Item carried by (Triggering unit) in slot 5)) else do (Hero - Drop the item from slot 5 of (Triggering unit))
                          • Hero - Drop (Item being manipulated) from (Triggering unit)
                          • Trigger - Turn off (This trigger)
                          • Hero - Give (Item being manipulated) to (Triggering unit)
                          • Trigger - Turn on (This trigger)
                        • Else - Actions

Trigger:
  • Items2
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type ROBO) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of items carried by (Picked unit)) Less than 5
            • Then - Actions
              • -------- Frame --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has an item of type |cffffcc00Frame|r) Equal to True
                      • (Item-class of (Item carried by (Picked unit) in slot 1)) Equal to Permanent
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Hero - Create |cffffcc00Frame|r and give it to (Picked unit)
              • -------- Gun --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has an item of type |cffffcc00Gun|r) Equal to True
                      • (Item-class of (Item carried by (Picked unit) in slot 2)) Equal to Charged
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Hero - Create |cffffcc00Gun|r and give it to (Picked unit)
              • -------- Bomb --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has an item of type |cffffcc00Bomb|r) Equal to True
                      • (Item-class of (Item carried by (Picked unit) in slot 3)) Equal to Powerup
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Hero - Create |cffffcc00Bomb|r and give it to (Picked unit)
              • -------- Pod --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has an item of type |cffffcc00Pod|r) Equal to True
                      • (Item-class of (Item carried by (Picked unit) in slot 4)) Equal to Artifact
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Hero - Create |cffffcc00Pod|r and give it to (Picked unit)
              • -------- Legs --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) has an item of type |cffffcc00Legs|r) Equal to True
                      • (Item-class of (Item carried by (Picked unit) in slot 5)) Equal to Purchasable
                • Then - Actions
                  • Do nothing
                • Else - Actions
                  • Hero - Create |cffffcc00Legs|r and give it to (Picked unit)
            • Else - Actions


Heres what it does.
It starts you off with item holders to reserve item spots for your "parts"
Then after you receive a "part" it is taken to its reserved spot.
It destroys the holder item but drops if its a "part"

HOWEVER
because parts need to be droppable, they can be moved, which allow multiple of the same class of part in the inventory, which i dont want

Can anyone tell me how to fix this?
I made this system by scratch and didnt bother to find a tutorial on it so i dont know if theres a better one out there.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top