Topic:   Simple Inventory Engine   (Read 12009 times)


0 Members and 1 Guest are viewing this topic.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Simple Inventory Engine
« on: August 11, 2008, 01:50:23 PM »
Here's a very simple inventory engine I just came up with:

http://www.mediafire.com/?zfgnudt7ohn

It's similar to Eq and TD's systems, only simpler. It can handle any amount of item slots, but for this sample I've only included 9. (12 including equipped items) Adding items and item classes is really easy, and I've clearly labeled routines to make them understandable. I think I'll use this with the Item Stat Engine I released awhile back for my next game.

Enjoy! :)
« Last Edit: August 11, 2008, 01:51:29 PM by Silverwind »
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Inventory Engine
« Reply #1 on: August 11, 2008, 07:43:22 PM »
This is pretty great. Could be used in Lw.
We could also probably make it have visual items.


-Gandolf

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Simple Inventory Engine
« Reply #2 on: August 12, 2008, 10:52:15 AM »
this doesnt show how to add items, i dont think noobs will be able to figure that out themselves cause you have to find an empty slot and notealert if there isnt one

was td's in gm or sc?
« Last Edit: August 12, 2008, 10:53:00 AM by EqwanoX »

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #3 on: August 12, 2008, 08:13:29 PM »
Mine was in GM personally because I don't don't use SC too often
EDIT: WOW this thing is super complex you shouldn't have to insert the item name in the code unless your are adding it to the inventory
« Last Edit: August 12, 2008, 08:16:01 PM by Tireas_Dragon »
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Simple Inventory Engine
« Reply #4 on: August 13, 2008, 08:39:49 AM »
I have to type fast as I've only got 15 minutes of internet left, but here's the code to add items:
Code: [Select]
'-----Add Item-----------------------------------------------------------------------------------
newitem$ = "Healing Potion"
itemnumber = 0
REPEAT
  itemnumber = itemnumber + 1
  IF itemnumber = 1 THEN item$ = item1$
  IF itemnumber = 2 THEN item$ = item2$
  IF itemnumber = 3 THEN item$ = item3$
  IF itemnumber = 4 THEN item$ = item4$
  IF itemnumber = 5 THEN item$ = item5$
  IF itemnumber = 6 THEN item$ = item6$
  IF itemnumber = 7 THEN item$ = item7$
  IF itemnumber = 8 THEN item$ = item8$
  IF itemnumber = 9 THEN item$ = item9$
  IF item$ = "" THEN
    IF itemnumber = 1 THEN item1$ = newitem$
    IF itemnumber = 2 THEN item2$ = newitem$
    IF itemnumber = 3 THEN item3$ = newitem$
    IF itemnumber = 4 THEN item4$ = newitem$
    IF itemnumber = 5 THEN item5$ = newitem$
    IF itemnumber = 6 THEN item6$ = newitem$
    IF itemnumber = 7 THEN item7$ = newitem$
    IF itemnumber = 8 THEN item8$ = newitem$
    IF itemnumber = 9 THEN item9$ = newitem$
    EXIT REPEAT
  END IF
  IF itemnumber = 10 THEN
    ALERT Your inventory is full!
    EXIT REPEAT
  END IF
END REPEAT
'----/Add Item-----------------------------------------------------------------------------------

Quote
WOW this thing is super complex
Um... no it isn't.
« Last Edit: September 22, 2008, 02:43:12 PM by Silverwind »
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #5 on: August 13, 2008, 09:03:25 AM »
I was talking about the equip. It has the item name in the equip button. The item name should only be mentioned when added to the inventory.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Simple Inventory Engine
« Reply #6 on: August 14, 2008, 02:44:44 PM »
That's because the Equip button is also the Use Item button. Therefor the names of the items need to be referenced, thus the code. The item's names are also required for Item Class sorting. :)
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #7 on: August 14, 2008, 10:48:43 PM »
I think the array system for items I developed is better because everything about the item is declared with 1 variable name and all and therefore you never need to directly reference the name.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Simple Inventory Engine
« Reply #8 on: August 16, 2008, 03:27:50 PM »
But none of the items you included in the demo had effects, they were all equipment with battle stats. My item stat engine did that as well, but this is a different engine.
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #9 on: August 17, 2008, 09:18:48 AM »
Effects as in?
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Simple Inventory Engine
« Reply #10 on: August 17, 2008, 09:38:45 AM »
Stuff like healing potions, mana potions, ores, (which prompt an ALERT stating "You can't use this item.") ability point potions which allow the player to designate an ability to increase, ingredients that can be mixed together for alchemy or smithing, and other similar effects.
I survived the spammage of 2007

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #11 on: August 17, 2008, 02:28:17 PM »
Quote
Stuff like healing potions, mana potions, ores, (which prompt an ALERT stating "You can't use this item.") ability point potions which allow the player to designate an ability to increase, ingredients that can be mixed together for alchemy or smithing, and other similar effects.
ores?
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Simple Inventory Engine
« Reply #12 on: August 17, 2008, 03:20:53 PM »
Gold, silver, platinum, kryptonite.


-Gandolf

Tireas Dragon


  • GMG Extraordinaire

  • ***


  • Posts: 1626

  • Trying to recover from my shattered screen.
Re: Simple Inventory Engine
« Reply #13 on: August 17, 2008, 03:37:01 PM »
I was wondering how an ore could prompt an ALERT stating you can't use this item.
I must be dreaming (wake up me wake up) How could this have happened. Tireas' cry when he found his computer fallen over in his chair with it's screen shattered.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Simple Inventory Engine
« Reply #14 on: August 17, 2008, 04:37:56 PM »
Surely you knew what I meant if you've played the concept.
I survived the spammage of 2007