Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
stackable items
#1
http://www.mirage-realms.com/forums/view...?f=16&t=61

Pay me lots and lots of money Smile
Reply
#2
Just add more item type checks to the check for currency.

Atm all it does is check if you already have the item, and if you do set the value to +1, else it sets a new slot.

I recently made all items stack in my bank. It's easy as hell.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
In mine, each item can be stackable and given a max stack amount. This allows for a lot of customization of the items.

The biggest headache i had was that if you have stacks of the items in your inventory already, you had to be able to add to those first before starting a new stack. Then if you don't have enough space in your inventory it drops any that won't fit.

Then there was taking away the items in multiple stacks.

Everyone was pretty easy, just took awhile to get it to where i liked it.
Reply
#4
Give Item:
for i = 1 to max_inv
if getplayerinvitemnum(i).name = item(itemnum).name then
setplayerinvitemval(i, getplayerinvitemval(i) + 1)
end if
next

Take Item:
For i = 1 to max_inv
if getplayerinvitemnum(i).name = item(itemnum).name then
If getplayerinvitemval(i) - ItemAmount >= 0 then
setplayerinvitemnum(i, 0)
else
setplayerinvitemval(i, getplayerinvitemval(i) - ItemAmount)
end if
next
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)