• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to change item position in inventory.

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
There is UnitAddItemToSlotById(unit, itemId, slot)

Ty. now is there a way to keep that item in that slot?
why would you want to do that? shouldn't the player have freedom to move items around their inventory as they wish?
Its for an inventory system, instead of making it a unit ability im making it an item and giving the item the ability
 
Level 13
Joined
May 11, 2008
Messages
1,198
oh...is this one of those item systems that is like...armor goes in that slot, weapon goes in that slot and perishable in that slot, kindof thing?
if you make an item undroppable then you can't change the slot. you can use the function to remove an item if you need to remove it otherwise.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
oh...is this one of those item systems that is like...armor goes in that slot, weapon goes in that slot and perishable in that slot, kindof thing?
if you make an item undroppable then you can't change the slot. you can use the function to remove an item if you need to remove it otherwise.

naa that sounds primitive...

also im pretty sure even if its undroppable you can still swap item spots with another item, i gotta test tho
 
Level 13
Joined
May 11, 2008
Messages
1,198
hmm...well yeah i think simplest thing to do is make it undroppable(use the jass/custom text function) when you give it to the unit. doing it in the object editor would probably have the exact same effect, so you can either save yourself a function call or save yourself some object editing. either way, i suppose.
 
Level 13
Joined
May 11, 2008
Messages
1,198
you might want to give every hero a 6th slot item when they are summoned which is undroppable and doesn't do anything except to serve as a placeholder until they unlock their item ability. this way you don't let players fill up their inventory and then get annoyed when an item gets removed from their inventory when they unlock their item ability.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
you might want to give every hero a 6th slot item when they are summoned which is undroppable and doesn't do anything except to serve as a placeholder until they unlock their item ability. this way you don't let players fill up their inventory and then get annoyed when an item gets removed from their inventory when they unlock their item ability.

The unit will have the abillity 100% of the time..
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
then add the item[ability] and not use a placeholder anymore... just make it undroppable so that it cannot be moved...

You mean, do what I've been doing? lol. you guys are interpreting this wrong. But its already solved (just have to test, ig atm) so..
 
Status
Not open for further replies.
Top