Item system?

takethat

Active Member
Reaction score
12
How do I make a trigger system that will do the following?
Hero only allows equip with 1 weapon, 1 shield, 1 amour, 1 boot, 2 other item.
eg, There can be many type of weapon, but only 1 per hero.
 

Sevion

The DIY Ninja
Reaction score
413
You can have an entirely custom inventory system OR you can just give each item a "type" like "Weapon" and do a check that if a unit picks up an item, if he has another type of the same type, drop the item etc.
 

takethat

Active Member
Reaction score
12
tried before, it seems that when it check, it also count the 1 you just pick up
 

Sevion

The DIY Ninja
Reaction score
413
Yeah? You just check if the unit has greater than 1 of that type. If so, remove the picked up item.
 

Laiev

Hey Listen!!
Reaction score
188
Trigger:
  • loop integer B 1-6
    • if
      • (item type of (triggering unit) in slot integer B equal to <your item>
    • then
      • <your action>


work with integer A loop too

i think is this what you want to know
 

HydraRancher

Truth begins in lies
Reaction score
197
Trigger:
  • For each integer A from 1 to 6 do (Actions)
    • Loop - (Actions)
      • If all (Conditions are true) then do (Actions) else do (Actions)
        • If - Conditions
          • Item - Type of (Item in slot Integer A) equal to your item
        • Then Actions
          • For each integer B from 1 to 6 do (Actions)
            • Loop - (Actions)
              • If all (Conditions are true) then do (Actions) else do (Actions)
                • If - Conditions
                  • Item Type of (Item in slot Integer B) equal to = your item
                  • Item Type of (Item in slot Integer A) not equal != to your item
                • Then Actions
                • ----------He has duplicates----------
                • Else Actions
          • Else Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top