Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Potion pickup

Author
Message
xxelixx
15
Years of Service
User Offline
Joined: 6th Dec 2008
Location: CodeLand
Posted: 9th Dec 2010 03:34 Edited at: 9th Dec 2010 03:36
I am having a bit of trouble with this piece of code:


What it should do is, if the player picks up a potion it will be sent to an inventory slot, but for some reason it always goes to the fourth slot.

Any help is appreciated.


Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th Dec 2010 04:11 Edited at: 9th Dec 2010 04:11
Your going to kill yourself (figuratively) when you realize what's wrong. Here's a hint, every 'if' argument BECOMES true.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 9th Dec 2010 04:11 Edited at: 9th Dec 2010 04:23
take a look at this thread with a simple 4-slot self-sorting inventory system. 2 examples i wrote there with slightly different functionality: 1) auto pick-ups, 2) manual pick-ups. hope it helps

Virtual Nomad @ California, USA . DBPro V7.5
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
xxelixx
15
Years of Service
User Offline
Joined: 6th Dec 2008
Location: CodeLand
Posted: 9th Dec 2010 04:19
Wow, I feel pretty stupid.

Thanks for the help.


TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Dec 2010 20:30
I haven't looked at the link, but an easy way to solve this is to just reverse the order of the checks:



TheComet

Login to post a reply

Server time is: 2024-09-29 00:26:36
Your offset time is: 2024-09-29 00:26:36