RPG List Function Set

Talk about making games.

RPG List Function Set

Postby pyrometal » Tue Jan 06, 2009 10:53 pm

Hello Everyone! I just finished making a demo of how to make an RPG item storage list for Bee-Ant's new game and I thought this could be useful to other more advanced users out there. I also included a text actor to print out the contents of the 2 arrays (it suggests a way to use the system).

Features:
- Item autostacking.
- Slot clearing.
- Item Consumption algorithm.
- Automatic Spacial Rearangement.
- Simple enough to use with fair ease.

Here are some limitations:
- Maximum of 16 item slots.
- Maximum of 99 stacked items in a single slot. (can be increased)
- Maximum of 10 characters for an item's name.
- The two arrays can be saved using GE's saveVars(); function (do that yourself though, it's easy)

The 3 Functions:
(1) add_item("item_name", amount); adds "amount" of "item_name" to the list.
(2) use_item("item_name", amount); uses "amount" of "item_name" from the list.
(3) clear_slot(slot_number); automatically clears the specified slot and reorganizes the list.

list demo.zip
GED demo file
(197.66 KiB) Downloaded 117 times
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: RPG List Function Set

Postby jimmynewguy » Tue Jan 06, 2009 11:45 pm

neeto, checking it out now!
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: RPG List Function Set

Postby zygoth » Wed Jan 07, 2009 10:37 pm

Nice, I understand most of what you did...arrays are very useful for stuff like this. I just recently looked up how to use them.
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: RPG List Function Set

Postby pyrometal » Wed Jan 07, 2009 11:00 pm

I would normally be using a "struct" for this type of thing, but Bee-Ant wanted to have the ability to save using saveVars(); that's the only reason I ended up not doing so. Hopefully people find this demo helpful.
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: RPG List Function Set

Postby Bee-Ant » Thu Jan 08, 2009 1:27 pm

Arigato pyro
You are so helpfull :D
DOnt worry, I will ask you for more demo later :P :mrgreen:
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: RPG List Function Set

Postby pyrometal » Thu Jan 08, 2009 2:04 pm

I'll be waiting!
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: RPG List Function Set

Postby Bee-Ant » Thu Jan 08, 2009 2:22 pm

Right now I just need some ideas...
viewtopic.php?f=4&t=6421&start=15
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: RPG List Function Set

Postby Bee-Ant » Sat Jan 17, 2009 1:13 pm

I get some problem...
Here's the game data..
1. How to show Item Info depend on collided list text with the list box
2. How to toss the item depend on collided list text with the list box...
Ah, you will understand what I mean after you see this... :roll: :(
Attachments
LISTDEMO.zip
(318.1 KiB) Downloaded 104 times
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: RPG List Function Set

Postby pyrometal » Sat Jan 17, 2009 3:51 pm

Here, I fixed all your bugs and also modified the code to suit your needs better! From now on, if you want to change the amount of items you can carry, just change the variable MAX_ITEMS value to the amount you want! You had the right idea in your code, but your weren't referencing the correct variables for the job in some places, I'm sure you will see those when you take a look at what I've modified. Anyway, this menu looks really good so far! Keep up the excellent work Bee-Ant!

LISTDEMO.zip
Fixed!
(328.03 KiB) Downloaded 96 times


--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: RPG List Function Set

Postby Bee-Ant » Tue Jan 20, 2009 11:34 pm

Thanks pyro :D
No question for now.its so clear.
Btw i used the strcmp method for the move and it works :o
I wanted to ask you about canvas,but it seems i already done it. Well,catch ya later.
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest