• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Army units and item inventario

Status
Not open for further replies.
Level 7
Joined
Dec 5, 2013
Messages
280
How can I build inventory system so that no matter what unit of the player picks up item it goes to "general" inventory, which is not tied to any specific unit?
 
Make an initialization trigger to put the inventory unit into a variable. The trigger below is just an example.
  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Inventory = Your Inventory Unit
If the inventory unit is not preplaced, you could do something like
  • Init
    • Events
      • Unit - A unit enters Region
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Your Inventory Unit
    • Actions
      • Set Inventory = Triggering Unit

After that make a trigger like this
  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Not equal to Your Inventory Unit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of items carried by Inventory) Not equal to 6
        • Then - Actions
          • Hero - Give (Item being manipulated) to Inventory
          • Game - Display to (All players) the text: Item is transferred
        • Else - Actions
          • Game - Display to (All players) the text: Inventory is full. ...
          • Hero - Drop (Item being manipulated) from (Triggering unit)
In case I misunderstood, I added a test map to see if this is what you wanted
 

Attachments

  • Item Test.w3x
    17.8 KB · Views: 51
Level 15
Joined
Aug 7, 2013
Messages
1,338
I meant that how to make inventory that is accesible for all units in the game?

Do you mean a virtual inventory, like in Dark Lineage RPG, which could potentially hold an infinite number of items, and then your hero has some interface to access those virtual items to get actual ones in its inventory?
 
Level 7
Joined
Dec 5, 2013
Messages
280
I was thinking that all items go in some common inventory and all units use the same inventory.
 
Status
Not open for further replies.
Top