• 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.

Modifying inventory size?

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2008
Messages
263
Yeah, i heard somewhere that it was possible to change a unit's inventory size with a trigger. Is this possible, and if so, how do i do it?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You can change a unit's inventory from disabled all the way up to all 6 slots used with a total of 7 possiable slot states and even weather items can be used or not. However you can not add more than 6 slots as WC3 has that as a hard coded limate. You can however try using triggers to emulate more than 6 slots with reasonable accuracy, however be aware that it is not the easiest thing to do and will need JASS to be done efficently.
 
Level 6
Joined
Oct 4, 2008
Messages
263
Ok, i think i have an idea.
for each player, i create a small area outside the main area of the map. whenever they pick up an item, a trigger will destroy that item, and spawn a unit inside that player's 'inventory area'.
That means of course that i have to create a unit for each item in the map. Or i could use variables and some clever fu, but it would still be a boatload of work.

or maybe i could make a dummy unit with one inventory slot, then when you pick up an item, one of these dummies spawn inside the inventory area, and a trigger gives the dummy a copy of the item being picked up. then when you have to drop an item, you just use a skill called 'drop' that basically just moves the camera to your inventory and lets you kill one of the dummies, then spawn the item being dropped in front of you.
 
Level 11
Joined
Feb 14, 2009
Messages
884
That's what BlueEagle has done in his map called "Legend of Magnador". You can find it at [url="http://www.epicwar.com]Epicwar[/url] (it's open source, so you can study his code, and don't forget to credit him :))
 
Status
Not open for further replies.
Top