M
MikeTheGuy
Guest
I'm sure I'm not the first one to think of this.
I was looking at the inventory systems and it seems that most require either finding substrings or making a ton of triggers. Mine, if the trigger works, would only need 1 trigger. Basically, my idea is to assign an item type (ie. sword, shield, helm, etc.) to each item class. So, for example: Artifact: Helmet, Purchasable: Armor, Permanent: Weapon, Charged: Shield (or weapon 2), Campaign: Leggings, Miscellaneous: Boots. And then Powerup (obviously remove the "use automatically when acquired" if you need to) for your general items, like quest items, potions, etc. Then, this trigger would be used to restrict the items:
However, the trigger does not work. It will not allow you to pick up any item of those classes, even if there is no other item of that class in your inventory.
I was looking at the inventory systems and it seems that most require either finding substrings or making a ton of triggers. Mine, if the trigger works, would only need 1 trigger. Basically, my idea is to assign an item type (ie. sword, shield, helm, etc.) to each item class. So, for example: Artifact: Helmet, Purchasable: Armor, Permanent: Weapon, Charged: Shield (or weapon 2), Campaign: Leggings, Miscellaneous: Boots. And then Powerup (obviously remove the "use automatically when acquired" if you need to) for your general items, like quest items, potions, etc. Then, this trigger would be used to restrict the items:
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))
Then - Actions
Hero - Drop the item from slot (Integer A) of (Hero manipulating item)
Game - Display to (All players) the text: Sorry, you can only...
Else - Actions
Do nothing
However, the trigger does not work. It will not allow you to pick up any item of those classes, even if there is no other item of that class in your inventory.