M
MikeTheGuy
Guest
I was looking at all the other inventory systems and they all seemed to involve complicated things like finding substrings or making tons of triggers. This one is simple, only needs one trigger, and works perfectly.
The idea behind this is to make an inventory system by assigning each item class an item type (ie. sword, shield, helmet, etc.), and then restricting that item class. For example, Artifact: Helmet, Purchasable: Armor, Permanent: Weapon, Charged: Shield (or weapon 2 for weapon types like claws, etc.), Campaign: Legging, Miscellaneous: Boots. And then you could use Powerup for generic items like potions, quest items, etc. The item classes can be modified any way you wish as long as each one only contains one type of item, so you could use Miscellanous for generic items and Powerup for boots, if you wanted. This is the trigger:
Credits to Ghan_04 for helping me figure it out. I did not look at any other inventory system while making this so if it is already done just say the word and I will delete this.
The idea behind this is to make an inventory system by assigning each item class an item type (ie. sword, shield, helmet, etc.), and then restricting that item class. For example, Artifact: Helmet, Purchasable: Armor, Permanent: Weapon, Charged: Shield (or weapon 2 for weapon types like claws, etc.), Campaign: Legging, Miscellaneous: Boots. And then you could use Powerup for generic items like potions, quest items, etc. The item classes can be modified any way you wish as long as each one only contains one type of item, so you could use Miscellanous for generic items and Powerup for boots, if you wanted. This is the trigger:
PHP:
inventory
Events
Unit - A unit Acquires an item
Conditions
Or - Any (Conditions) are true
Conditions
(Item-class of (Item being manipulated)) Equal to Artifact
(Item-class of (Item being manipulated)) Equal to Purchasable
(Item-class of (Item being manipulated)) Equal to Permanent
(Item-class of (Item being manipulated)) Equal to Charged
(Item-class of (Item being manipulated)) Equal to Campaign
(Item-class of (Item being manipulated)) Equal to Miscellaneous
Actions
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
(Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
Then - Actions
Hero - Drop (Item being manipulated) from (Hero manipulating item)
Game - Display to (All players) the text: Sorry, you can only...
Else - Actions
Credits to Ghan_04 for helping me figure it out. I did not look at any other inventory system while making this so if it is already done just say the word and I will delete this.