Inventory Space limits

Location of the Videos
Post Reply
roah235
Posts: 8
Joined: Tue Dec 29, 2009 10:22 pm

Inventory Space limits

Post by roah235 »

heyy. i was meesing around with a new stylesheet layout that looks more like a WOW type gui.

and my weapon display table thing went over my new style sheet.

so i thought it might be useful for space and gameplay in general to make a max amount of items

i know this prolly seems reaaalllyy simple but i'm kinda stuck on it.

any ideas??
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: Inventory Space limits

Post by ZeroComp »

make a field in the database that is maxspace in inventory and then go from there
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Inventory Space limits

Post by Jackolantern »

Just be sure to make a test of the max number of items a player can hold versus how many they currently hold when the player attempts to pick up another item. If their current amount is equal to or over the max, don't give them the item and display a message saying they can't hold any more. It may sound strange to test for over the max since you won't let them hold more than the max, but be sure to also test it for security reasons. If an item gets added through some other method and they go over the max without an overage check, they would then have unlimited storage.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Inventory Space limits

Post by hallsofvallhalla »

exactly, simply put a if statement that checks for a field in the players table called maxinventory or something.
psuedo code

Code: Select all

$query = select * from inventory where name=$playername;
while $query
{
$count = $count + 1;
}
if ($count>$playerinfo3['maxinventory'])
{
echo "you have too many items!";
}
this way you can have the players pat to increase their inventory size or base it on strength
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Re: Inventory Space limits

Post by Torniquet »

you have also got to think about what if some1 wanted the item they cant pick up more than something they have in their bag.

for instance, you find an ultimate power god wrath blade, rarest item in game. aww crap bags full... some1 not gunna be best pleased lol.
New Site Coming Soon! Stay tuned :D
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: Inventory Space limits

Post by ZeroComp »

Thats where you could put an option like this


You have found the uber god blade
your bags are full!
go to inventory



(go to inventory)
super nub dagger Equip-Drop



drop.php
are you sure you want to drop? yes-no
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Inventory Space limits

Post by Jackolantern »

Ohh, it would probably be best to craft the max inventory space check as a function, since it is likely that as your game grows, you will have several different sources of items. It could be setup so that the function returns 1 if the item can be picked up, or 0 if inventory is full, and each instance of an item source could be written to respond accordingly to the results.

EDIT: Or, you could design the function so you can pass in references for whatever you need for the calculations, and handle it all within the function, and then pass back to the int only for displaying the message (which would likely be page-specific and better off outside the function).
The indelible lord of tl;dr
ZeroComp
Posts: 648
Joined: Thu Oct 29, 2009 8:48 pm

Re: Inventory Space limits

Post by ZeroComp »

heres an idea if you use that in your game that i've seen in other browser games. Have a P2P offer where if you subscibe or do a one time payment then you have increased inventory space and have uprgadable slots for f2p where you could buy slots for say 50000 gold or something like that.
Coding-PHP, Javascript, C++, HTML, mySQL
Modeling/Art-Blender, GIMP
Games-Unity, Game Maker 8
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Inventory Space limits

Post by hallsofvallhalla »

thats exactly what i posted above.....maxinventory :)
Post Reply

Return to “Older Browser MMO Videos”