The Daily Click ::. Forums ::. Klik Coding Help ::. Noobish Inventory question
 

Post Reply  Post Oekaki 
 

Posted By Message

Ghostdreamer



Registered
  31/03/2011
Points
  12
5th April, 2011 at 22:51:03 -

Hello!

I'm really not all that great with the more complicated parts of MMF2 yet, such as fastloops and such. I've tried scripting an inventory system a few times, and each time ended in a laggy system that didn't work out the way I intended it. Temporarily discouraged I started looking around to see how other people were handling inventories. Most every article pointed to this link, http://www.gamebuilder.info/world/content/quick-inventory , which I have looked at and the inventory system really does seem to be polished and nice. The only problem I have with it is after studying it and messing around with the functions (effectively being able to break it in almost every manner) I still can not figure out how to use it :/

Is there anyone who might be able to explain in novice terms how to customize it to say maybe instead of fruits or whatever, the object was a potion that restores 1 health (for an extremely basic example) ?


 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
6th April, 2011 at 12:21:50 -

Hey, I'm making an example for ya. Sit tight!

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
6th April, 2011 at 14:08:32 -

Appreciate it sooooooo much!!

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
6th April, 2011 at 17:39:15 -

DONE!

I hope it helps. Let me know if you have any questions or if you want me to add something else to it.

http://www.whenthereisnoroominhellthedeadwalktheearth.com/Inventory.mfa

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
6th April, 2011 at 22:18:32 -

Unknown scource and failed to open document

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
6th April, 2011 at 22:19:36 -

Unknown format* sorry, everytime i try and edit a post it gives me an error so i have to double post

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
7th April, 2011 at 01:50:33 -

That sucks. Ok I'll remake it.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
7th April, 2011 at 03:03:16 -

Here we go:

http://www.whenthereisnoroominhellthedeadwalktheearth.com/Random/inventoryexample.mfa

it's better now too.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
7th April, 2011 at 04:01:32 -

Nice tutorial there, Chris. Had a look through and noticed one thing that needs fixing. When you are standing over more than 1 First Aid Kit and you press Enter, it deletes them all but only adds 1 Kit to your inventory. You can fix this by adding the events:

+Always
-set Counter (or value, whatever you want) to 0
-start ForEach loop "loop" for object First Aid Kit (yes, this method requires the ForEach extension)

+On ForEach "loop" for object First Aid Kit
+Player is overlapping First Aid Kit
-add 1 to Counter

Then, in the pickup events for the First Aid Kit, instead of adding 1 add the value of Counter.

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
7th April, 2011 at 05:46:21 -

ty ty ty ty ty ty ty ty ty ty ty !

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
7th April, 2011 at 06:17:06 -

vetmora120: And a lot easier way would be just to add pick one at random at the event where it picks them up.

Ghostdreamer: you should by the way try to learn how to use fastloops or slow ones aswell anyway, it's very usefull for any complex stuff. And once you learn them it's quite easy actually.


Edited by Don Luciano

 
Code me a sausage!

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
7th April, 2011 at 09:42:42 -

Yeah I was aware of that problem but figured it didn't matter too much.

I've fixed it though. Using the "Pick one at Random" condition. Thanks Don Luciano.

Same link: http://www.whenthereisnoroominhellthedeadwalktheearth.com/Random/inventoryexample.mfa

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
7th April, 2011 at 14:11:20 -

yeah im slowly picking it up, fight now im just working with regular loops, really apprecaite the help

 
n/a

Ghostdreamer



Registered
  31/03/2011
Points
  12
7th April, 2011 at 14:39:44 -

Alright, so I've been messing around with it a lot now hehe...My only question now is how to get it set up to transfer the information between two screens? The way that the game is set up is that when the player presses space bar it creates an overlay on a different frame and pauses the frame that the player was on to allow him to access the inventory with the game paused...

I know that I can set up everything that has a current variable to a global variable, and that would probably work fine for what I'm aiming for, I just don't know how to reference the stored information in the List Object from the previous frame into the inventory frame so that it can be called on.

Again, appreciate the time and help

 
n/a

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
7th April, 2011 at 17:39:14 -

The best way to do pauses would be to use groups of events.

Put inventory in one group.
And the things you need to pause in other.

And you can simply activate/deactivate when inventory is opened.

 
Code me a sausage!

Ghostdreamer



Registered
  31/03/2011
Points
  12
7th April, 2011 at 21:23:08 -

I didn't even think of that, gonna give it a try...thanks

 
n/a
   

Post Reply



 



Advertisement

Worth A Click