Jump to content


Photo
- - - - -

>> Inventory And Item Engine! <<


  • Please log in to reply
61 replies to this topic

#41 Katipo Games

Katipo Games

    Follower of Christ

  • GMC Member
  • 233 posts
  • Version:GM:Studio

Posted 01 October 2011 - 04:17 AM

All the item option box's do this: Posted Image
(custom item or default)

Some one please help! :sad:

*edit* maybe its because I'm using 8.1? :dry:

Edited by Katipo Games, 01 October 2011 - 08:17 AM.

  • 1

#42 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 01 October 2011 - 12:48 PM

All the item option box's do this:

Have you edited item_options? If not, send the .gmk.
  • 0

#43 Jobo

Jobo

    No neurons left today

  • GMC Member
  • 2405 posts
  • Version:GM:Studio

Posted 01 October 2011 - 01:33 PM

Hmm this is very nice coded indeed.I've done almost the same inventory but still trying to figure out how to make items stack :D

Loop through all items in the inventory until you find the same item as you're trying to add, and if successful, you just increase a counter on that item. Then when using/dropping a stacked item, you just decrease the counter.


@Davve
Pretty good example. A lot of people should find use in this, though I doubt 'newcomers' will find it very helpful as it's quite advanced.

Edited by Jobo, 01 October 2011 - 01:36 PM.

  • 0

#44 Katipo Games

Katipo Games

    Follower of Christ

  • GMC Member
  • 233 posts
  • Version:GM:Studio

Posted 02 October 2011 - 12:19 AM


All the item option box's do this:

Have you edited item_options? If not, send the .gmk.


No I haven't edited any of the code I've sent the .gmk to your msn

Edited by Katipo Games, 06 October 2011 - 11:53 PM.

  • 0

#45 blackbeard

blackbeard

    GMC Member

  • GMC Member
  • 60 posts
  • Version:GM:Studio

Posted 09 October 2011 - 11:48 PM

This Inventory Code is great! I am using it in my Adventure RPG that I am converting to GML from some older code I have been compiling for a while. Right now I'm trying to implement it within my game environment, but I'm experiencing a couple of snags..... I have been messing around with the box sizes to accommodate a pause/inventory screen; however, I don't know if through this I have disabled the mouse "hover over" function- and the descriptions/options don't seem to be working either. I have also replaced some of the sItems with my own, and subsequently their descriptions, but I do not believe this to be the cause. Any suggestions/direction? Thanks.Posted Image
  • 0

#46 Katipo Games

Katipo Games

    Follower of Christ

  • GMC Member
  • 233 posts
  • Version:GM:Studio

Posted 12 October 2011 - 07:45 PM

All the item option box's do this: Posted Image
(custom item or default)

Some one please help! :sad:

*edit* maybe its because I'm using 8.1? :dry:


PLEASE SOME ONE HELP ME!
  • 0

#47 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 12 October 2011 - 07:55 PM

You never sent the .gmk...
  • 0

#48 Katipo Games

Katipo Games

    Follower of Christ

  • GMC Member
  • 233 posts
  • Version:GM:Studio

Posted 12 October 2011 - 08:45 PM

You never sent the .gmk...

I sent it to your msn. oh well where can i upload a file?

*edit*
is it tested in 8.1?
and how easy is it to save into a .ini?

P.S in the exe it worked fine: the option box worked, the HP was above the player
but in GM (8.1) none of that worked

Edited by Katipo Games, 12 October 2011 - 08:57 PM.

  • 0

#49 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 12 October 2011 - 09:37 PM

*edit*
is it tested in 8.1?
and how easy is it to save into a .ini?

P.S in the exe it worked fine: the option box worked, the HP was above the player
but in GM (8.1) none of that worked

Well, GM8.1 changed the way arguments work, which is the main reason I never upgraded there from GM8.0 and could possibly be the cause of the problem. Since I don't have 8.1, I won't be able to help you. :(
  • 0

#50 blackbeard

blackbeard

    GMC Member

  • GMC Member
  • 60 posts
  • Version:GM:Studio

Posted 13 October 2011 - 12:49 PM

Davve, this inventory engine is great! I've been working on modifying it to my own needs and I'm doing so with good results. I do have a question- In the inventory you use sprite sub-images to represent "things" in your gaming environment. I'm sure by assigning those images a variable they can represent objects . I was wondering if there was a way to create images with animation somehow in the stead of still sub-images. Almost to say- "Can a sub-image have sub-images?" Thanks again for any input.
  • 0

#51 mibikin

mibikin

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 25 May 2012 - 05:04 AM

Davve, in my game, I want to make it so the amount of arrows in the inventory goes down as they are fired? How would I go about doing this with this engine? I've accomplished a bunch of problems that I had with this inventory, but this I need help with. I know this is an old thread, but please reply.
  • 0

#52 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 25 May 2012 - 01:56 PM

Davve, in my game, I want to make it so the amount of arrows in the inventory goes down as they are fired? How would I go about doing this with this engine? I've accomplished a bunch of problems that I had with this inventory, but this I need help with. I know this is an old thread, but please reply.

In the item_options_code script:
global.inv_item[global.inv_optionitemno, 1] -= 1

Edited by Davve, 25 May 2012 - 01:56 PM.

  • 0

#53 mibikin

mibikin

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 26 May 2012 - 07:27 PM


Davve, in my game, I want to make it so the amount of arrows in the inventory goes down as they are fired? How would I go about doing this with this engine? I've accomplished a bunch of problems that I had with this inventory, but this I need help with. I know this is an old thread, but please reply.

In the item_options_code script:
global.inv_item[global.inv_optionitemno, 1] -= 1


Can I use this in the left click event of the character? If so, how?
  • 0

#54 Davve

Davve

    Procrastinator

  • GMC Member
  • 3665 posts
  • Version:GM8.1

Posted 27 May 2012 - 10:52 AM



Davve, in my game, I want to make it so the amount of arrows in the inventory goes down as they are fired? How would I go about doing this with this engine? I've accomplished a bunch of problems that I had with this inventory, but this I need help with. I know this is an old thread, but please reply.

In the item_options_code script:
global.inv_item[global.inv_optionitemno, 1] -= 1


Can I use this in the left click event of the character? If so, how?

var a;
for (a=0 a<27 a+=1) {
    if (global.inv_item[a,0]=ARROW_ID) {
        /*Fire arrow code*/
        global.inv_item[a,1]-=1
        if (global.inv_item[a,1]=0) global.inv_item[a,0]=0
        break
    }
}

Edited by Davve, 27 May 2012 - 10:54 AM.

  • 0

#55 mibikin

mibikin

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 30 May 2012 - 01:08 AM




Davve, in my game, I want to make it so the amount of arrows in the inventory goes down as they are fired? How would I go about doing this with this engine? I've accomplished a bunch of problems that I had with this inventory, but this I need help with. I know this is an old thread, but please reply.

In the item_options_code script:
global.inv_item[global.inv_optionitemno, 1] -= 1


Can I use this in the left click event of the character? If so, how?

var a;
for (a=0 a<27 a+=1) {
    if (global.inv_item[a,0]=ARROW_ID) {
        /*Fire arrow code*/
        global.inv_item[a,1]-=1
        if (global.inv_item[a,1]=0) global.inv_item[a,0]=0
        break
    }
}


Thanks for the help!
  • 0

#56 KranKran

KranKran

    GMC Member

  • GMC Member
  • 107 posts

Posted 30 May 2012 - 05:35 PM

SO USEFUL! Why can't i be this good? :woot:
  • 0

#57 Dilbot

Dilbot

    GMC Member

  • New Member
  • 19 posts

Posted 14 July 2012 - 08:59 AM

Hi, im having the same problem as the fellow before with the arrows being depleted when you fire them, but I didn't really understand all the code you posted, could please explain a little bit?
Cheers!


P.S. It's a really awesome example by the way :D

Sorry don't worry about it, I had a derp moment and didn't understand something, but I figured it out, thanks for the help

Edited by Dilbot, 16 July 2012 - 04:01 PM.

  • 0

#58 Guest_yoyobob_*

Guest_yoyobob_*
  • Guests

Posted 23 July 2012 - 03:53 PM

Hey, really nice example!

But for my game i would like the inventory to be operated entirely with arrow keys and the enter key, is this possible? i switched the mouse_check_button to keyboard_check alright, but im a little confused about how to move an item around to another inventory spot. i want it to just move over once (if you press left or right) and move down once if you press up or down. do you get what i mean? Im not sure if its worth trying to change this example into what i want, or if its better to just start from scratch since it is almost totally different. Can you think of anything i could do?
Thanks,
YoyoBob

#59 juNkiez

juNkiez

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8

Posted 25 August 2012 - 09:40 AM

edit: nvm this is not good it was exactly what i needed, its outdated and it wont work for anything :\

Edited by juNkiez, 25 August 2012 - 11:15 PM.

  • 0

#60 Bullet Market

Bullet Market

    GMC Member

  • GMC Member
  • 2 posts
  • Version:Unknown

Posted 19 September 2012 - 12:58 PM

Definitely gonna use it, awesome ! :yes:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users