HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Hero Inventory System

08-31-2008, 10:20 PM#1
Zero
So, basically I took "Mapz_Maker's Multiboard-based Menu System" and changed it so it turns into a hero's inventory.

As in, you pick up a pair of gloves it goes into the gloves slot and if you remove it it changes back to <empty>:




Ok. So now that we have this system establish it gets a lil bit more complicated...

In my RPG you can only have 1 of any type of armor/weapon/shield etc. In my map I have all of the items in the above pic + more in my map and seeing as you can only carry at any given time 6 items it really makes the game limited. Especially when u add in potions/quest items/rings etc.

What I could do is make it so lets say hero picks up gloves X and gloves slot = empty.
Then move gloves to X region and add all item abilities to Hero...

I really, really, REALLY do not wanna do it this way because by doing this I would have to go in a make a trigger for acquires AND loses an item for over 200 sum items that I have in my map...

The question: Can this be done a more efficient way?
09-01-2008, 01:42 AM#2
Zero
No one knows a better way?
09-01-2008, 02:07 AM#3
Ammorth
Are you willing to work with Jass code? This is ridiculously easy with a bit of Jass/vJass.
09-01-2008, 10:47 PM#4
Zero
I got no problem with that if you help me?

How do we do it!?

BTW I already have a system that uses both item classifications as well as custom values...
09-02-2008, 01:20 AM#5
Ammorth
My idea:

A unit has an equipment inventory and a main inventory. It has an ability on the command card to switch between them. When an equipment item is acquired, it automatically goes to the equipment inventory, unless the player is wearing an item of that type; then it goes to the main inventory. Players can click on equipment items to send them to the other inventory (replaces equipped items if sending to the equipment inventory).

As for when I can do it, im not to sure. Starting classes tomorrow and work most days im not in school. I'm also currently writing my own systems for my map, so it would have to be when I get bored of doing that.

Also, if possible, can you give me a demo of what you are using the custom values for?
09-02-2008, 01:28 AM#6
Zero
Ok. I like that idea. Although, I don't know where we would put that command card due to all slots on spells are full.. It might have to be an item in hero's inventory? Like bottom right corner or something... I also have no idea even how to make something like this work with 2 separate heroes...

As for the demo, here is the trigger I use for only being able to use 1 item and I have a custom enchanting of weapons on my map, and is included below as well. The enchanting is what uses the custom values. We could always take a higher # of custom values and go from there, if possible, like 50-200 etc.

Trigger:
Item Class Wear Only One
Collapse Events
Unit - A unit Acquires an item
Collapse Conditions
((Triggering unit) is A Hero) Equal to True
Collapse Actions
-------- Weapons --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Permanent
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Weapon[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Weapon[(Player number of (Triggering player))] = (Item being manipulated)
-------- Apprentice Enchantments --------
-------- ------------------------------------------------------------------Fire Enchantment------------------------------------------------------------------ --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Item being manipulated)) Equal to 1
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Hero manipulating item)) Equal to Ranger
(Unit-type of (Hero manipulating item)) Equal to Sea Witch
Collapse Then - Actions
Unit - Add Item Attack Fire Bonus (Lv1) (Ranged) (45 DMG) to (Hero manipulating item)
Collapse Else - Actions
Unit - Add Item Attack Fire Bonus (Lv1) (Melee/Magi) (45 DMG) to (Hero manipulating item)
Else - Actions
-------- ------------------------------------------------------------------Ice Enchantment------------------------------------------------------------------ --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Item being manipulated)) Equal to 2
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Hero manipulating item)) Equal to Ranger
(Unit-type of (Hero manipulating item)) Equal to Sea Witch
Collapse Then - Actions
Unit - Add Item Attack Frost Bonus (Lv1) (Ranged) (45 DMG) to (Hero manipulating item)
Collapse Else - Actions
Unit - Add Item Attack Frost Bonus (Lv1) (Melee/Magi) (45 DMG) to (Hero manipulating item)
Else - Actions
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Weapon[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Armor --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Charged
(Current life of (Item being manipulated)) Not equal to 5.00
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Armor[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Armor[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Armor[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Shield --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Charged
(Current life of (Item being manipulated)) Equal to 5.00
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Shield[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Shield[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Shield[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Belt --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Powerup
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Belt[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Belt[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Belt[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Glove --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Artifact
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Glove[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Glove[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Glove[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Helmet --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Purchasable
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Helmet[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Helmet[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Helmet[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions
-------- Boot --------
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Item-class of (Item being manipulated)) Equal to Campaign
(Current life of (Item being manipulated)) Not equal to 15.00
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Boot[(Player number of (Triggering player))] Equal to No item
Collapse Then - Actions
Set Items_Hero_Boot[(Player number of (Triggering player))] = (Item being manipulated)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Items_Hero_Boot[(Player number of (Triggering player))] Not equal to No item
Collapse Then - Actions
Hero - Drop (Item being manipulated) from (Triggering unit)
Game - Display to (Owner of (Triggering unit)), at offset (0.00, 0.00) the text: |c0096ecf5You can o...
Else - Actions
Else - Actions