The complete RPG Inventory + Tutorial

Posted By: oldschoolj

The complete RPG Inventory + Tutorial - 09/28/07 01:41




Well folks, I'm really happy to contribute this to the community, because it's taken me a long time to work out all the kinks, and I don't want anyone going through this like I had to.

This inventory system, should do most everything that you could want in a inventory, and although it is specifically geared toward RPG's, it will, with a bit of tweaking work for almost any game that needs an inventory. I have to say that I am pleased with what it does for me.

I've included a full tutorial with the inventory module. The tutorial has a fully illustrated outtake on the code, and the system that I used for setting it up. It uses a point- by - point layout, that I feel is fairly easy to follow. Even if I forgot to explain some things, I feel that by the time your done with the tutorial, you will have a very good grasp on how to make the inventory system work for you. The rar file also includes a prop panel for testing, and placeholder icons for items, as well as a few other goodies. Please read the enclosed disclaimer for more info.


The primary features:

• Custom dressing room feature. This feature simply creates a replica of the player model, with a black background. It will show the items that are equipped, so the player can stare at his or her character and beam with pride. It’s always visible, and is surrounded by the equipment slots for easy viewing. You can zoom in, and out. Rotate left or right. And the character model will of course play whatever animations you choose. You could get quite creative with this feature. If you equip a shield you could have the character play it’s “block” animation. A sword, it’s “salute” animation. The choice is yours, but the animation starts out with a default of “stand”, and as long as the inventory screen is open, the dressing room model will play it. All of its animations run completely independent of what the player is doing.



• Automatic mouse tracking, capable of storing and calling the mouse’s current location and what cell it is currently “housed in” while the inventory screen is visible.

• “Item backing” while items are equipped. This means that you can put placement pictures in your equipment slots, so that players know what items can go in which slot. Once you equip an item in that slot, the “item backing” will appear to remove that image. Removing the item will also remove the “item backing”.

• Large storage capacity, with backwards or forwards compatibility. The inventory is designed to handle 36 items, and houses 25 equipment slots for your players gear. However, it can very easily be modified to handle more or less by deleting a few lines of code, and modifying a few variables.

• Toggling, and dragging. The inventory can be toggled on or off, and dragged about the screen, while moving all items with it.

• Easy selection system. An item is picked up with the left mouse button, and while it is held down, the item will be dragged to wherever the user chooses. If it’s off the panel, it will automatically be placed in a slot that is free. Once the mouse is release the item is dropped, so no double clicking.

Here is a video showing the system in action in a testing room where I developed the inventory for my own game. Please do not redistribute this video as it does contain sensitive materials. What I mean by that, is posting on You-Tube or something of that nature. It is stricly for the community to look at and maybe gain some ideas.


Inventory Movie

Here is the tutorial and files -----> Inventory

Thanks and good luck!

PS There are a few bugs which I am aware of, such as synching issues. I am currently working on fixing these issues, and if you are inclined too, let me know if you find any bugs, so t hat I can fix them as well.

Jesse
Posted By: juggalo10101

Re: The complete RPG Inventory + Tutorial - 09/28/07 02:09

Wow really nice, thanks a million
Posted By: Nems

Re: The complete RPG Inventory + Tutorial - 09/28/07 03:39

Great stuff, was thinking if I needed one or not then decided I'd better have a look to learn anyway so thanks again, you just may see your inventory in my game one day (fingers crossed )
Posted By: JackShephard

Re: The complete RPG Inventory + Tutorial - 09/28/07 04:03

Its Great!
Thank you!

Posted By: msl_manni

Re: The complete RPG Inventory + Tutorial - 09/28/07 04:33

I a having problems running the demo. There are some functions and defines missing from the demo. Define - REAR not found. attach_item function not found. Please clarify the errors.
Posted By: Loopix

Re: The complete RPG Inventory + Tutorial - 09/28/07 07:22

Outstanding work...thanks! It's indeed very generous of you to contribute this piece of hard work for free

I'm also stuck with the errors msl_manni mentioned...but I think this is no mayor issue.

Thanks again!
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 09/28/07 10:43

this is because you will need to define those youself, if you look in the large function in the code, the one that is several thousand lines long, you will see the defines basicly you should define each possible space for you inventory. such as left ear, right ear and so on. I think i forgot a few. Here is the function "attach item". Please remember that these are based on vertex animations, so if you have not modeled your armor pieces correclt this function will not work:
Code:
function attach_item()
{
set (my, PASSABLE);
my.scale_x = 2;
my.scale_y = 2;
my.scale_z = 2;
wait(1);
c_updatehull(my,1);
while(player != NULL)
{
vec_set(my.x, player.x);
vec_set(my.pan, player.pan);
my.frame = player.frame;
my.nextframe = player.nextframe;
wait(1);
proc_mode = PROC_LATE;
}
}




BTW this is not a demo, this is just an inventory system, and without filling in the proper spaces for models, etc. it wont work right.
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 09/28/07 11:10

I forgot to mention the re-scaling part, incase your inventory slots are larger
then your equipment slots, like the way that the template is set up. This is
very easy to customize. In the function ui_inv_attach_icon, you will notice
that there are 60 mouse locations, just like I mentioned in the tutorial. Each
mouse location is nearly a replica of the next, wit ha few exceptions. If you
goto line 650, this is mouse location zero. It has three posible states. Filled
with the icon coming from a inventory slot. Filled with an icon coming from a
equipment slot. And not filled, in which case the icon is placed there.
If you notice, inventory states are all scaled 1 to 1.
While the equipment state, orequipment slot return loop, sets the icon scale smaller.
You will need to change each and every mouse location's scale for this,
if you are using a different scale. It may be a bit tedious, bit it is
easy, and no coding.


I also want to talk a bit more about the defines. HEad over to line 1660, and
you will see that this is in fact our first equipment slot. S it's a equipment
slot zero, and mouse location 36, member we discussed that in the tutorial as
well. The layout is a template for the rest of the equiment slots:

Code:
if (mouse_item_location == 36)
{
if ((ui_equip_slot_array[0]>0) && (ui_inv_slot_return == 0))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[ui_equip_slot_return] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[ui_equip_slot_return].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];ui_equip_icon_backing[ui_equip_slot_return].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
ui_equip_slot_array[ui_equip_slot_return] = handle (temp_panel);
}
if ((ui_equip_slot_array[0]>0) && (ui_inv_slot_return > 0))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_inv_slot_replacex_array[ui_inv_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_inv_slot_replacey_array[ui_inv_slot_return];
temp_panel.scale_x = 1;
temp_panel.scale_y = 1;
ui_inv_slot_array[ui_inv_slot_return] = handle (temp_panel);
}
if ((ui_equip_slot_array[0]==0) && (player.ITEM_TYPE != REAR))
{
if (ui_inv_slot_return == 0)
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[ui_equip_slot_return] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[ui_equip_slot_return].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];ui_equip_icon_backing[ui_equip_slot_return].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
ui_equip_slot_array[ui_equip_slot_return] = handle (temp_panel);
}
if (ui_inv_slot_return > 0)
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_inv_slot_replacex_array[ui_inv_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_inv_slot_replacey_array[ui_inv_slot_return];
temp_panel.scale_x = 1;
temp_panel.scale_y = 1;
ui_inv_slot_array[ui_inv_slot_return] = handle (temp_panel);
}
}
if ((ui_equip_slot_array[0]==0) && (player.ITEM_TYPE == REAR))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[0];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[0];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[0] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[0].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[0];ui_equip_icon_backing[0].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[0];
ui_equip_slot_array[0] = handle (temp_panel);
}
ui_inv_slot_return = 0;
ui_equip_slot_return = 0;
}



As wit hthe inventory positions, if the slot os filled and it came from an
inventoy slot, it is returned, or if it came from another equipment it is returned there.
If it is the wrong item type, (this is the REAR you were talking about) it is
also returned becaue it doesnt belong there. In this case it's a REAR slot
or "right ear", but this is almos tthe exact same code as the
rest of the equip slot locations. Only the positions in the array is increased
by one, for ever slot after this one. And the item type check is changed. You
will not have to edit anything besides these two things, as long as you are
using the same type of design. This means that you have a item, a equipment
slot, and a inventory slot. So lets say that you wanted to attach a laser turret to your brandnew space cruiser, in a space shooter game. And you wanted
it to be a position 1, or equipment slot one. Well this is how you would edit that part of the code:

Code:
if (mouse_item_location == 37)
{
if ((ui_equip_slot_array[1]>0) && (ui_inv_slot_return == 0))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[ui_equip_slot_return] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[ui_equip_slot_return].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];ui_equip_icon_backing[ui_equip_slot_return].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
ui_equip_slot_array[ui_equip_slot_return] = handle (temp_panel);
}
if ((ui_equip_slot_array[1]>0) && (ui_inv_slot_return > 0))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_inv_slot_replacex_array[ui_inv_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_inv_slot_replacey_array[ui_inv_slot_return];
temp_panel.scale_x = 1;
temp_panel.scale_y = 1;
ui_inv_slot_array[ui_inv_slot_return] = handle (temp_panel);
}
if ((ui_equip_slot_array[1]==0) && (player.ITEM_TYPE != LASER_TURRET))
{
if (ui_inv_slot_return == 0)
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[ui_equip_slot_return] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[ui_equip_slot_return].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[ui_equip_slot_return];ui_equip_icon_backing[ui_equip_slot_return].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[ui_equip_slot_return];
ui_equip_slot_array[ui_equip_slot_return] = handle (temp_panel);
}
if (ui_inv_slot_return > 0)
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_inv_slot_replacex_array[ui_inv_slot_return];temp_panel.pos_y = ui_inv_panel.pos_y + ui_inv_slot_replacey_array[ui_inv_slot_return];
temp_panel.scale_x = 1;
temp_panel.scale_y = 1;
ui_inv_slot_array[ui_inv_slot_return] = handle (temp_panel);
}
}
if ((ui_equip_slot_array[1]==0) && (player.ITEM_TYPE == LASER_TURRET))
{
temp_panel.pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[1];temp_panel.pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[1];
temp_panel.scale_x = .7;
temp_panel.scale_y = .7;
ui_equip_icon_backing[1] = pan_create ("bmap = equip_icon_backing.tga;flags = VISIBLE;",1);
ui_equip_icon_backing[1].pos_x = ui_inv_panel.pos_x + ui_equip_posx_array[1];ui_equip_icon_backing[1].pos_y = ui_inv_panel.pos_y + ui_equip_posy_array[1];
ui_equip_slot_array[1] = handle (temp_panel);
var l;
for (l = 0000;l<999;l++)
{
if(temp_panel == item_icon[l])
{
temp_ent[1] = ptr_for_handle(item_model_array[l]);
temp_droom_ent[1] = ptr_for_handle(droom_item_model_array[l]);
item_temp[1] = ent_create(temp_ent[1], player.x, attach_item);
droom_item_temp[1] = ent_create(temp_droom_ent[1], dressing_room_model.x, attach_dressingroom_item);
equip_slot_backing_toggle[1]=1;
}
}
}
ui_inv_slot_return = 0;
ui_equip_slot_return = 0;
}





where dressing_room_model.x is really just the name of your dummy ship model in the view window. Simple as pie.
Posted By: msl_manni

Re: The complete RPG Inventory + Tutorial - 09/28/07 11:44

I see that you have provided a tutorial. It would have been nice to have a working project too to see it working, but you have provided a movie instead. Thanks for everything.
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 09/28/07 11:57

If you want to have all of the defines to solve any issues here they are, I apologize that I didnt include them to begin with:

Code:
#define ITEM_TYPE skill1
#define WAIST 1
#define ONE_HAND_WEAP 2
#define OFF_HAND 3
#define HEAD 4
#define LFOOT 5
#define RFOOT 6
#define LSHOULDER 7
#define RSHOULDER 8
#define RWRIST 9
#define REAR 10
#define CHEST 11
#define RHAND 12
#define RRING 13
#define UPPER_LEG_ACC 14
#define MASK 15
#define KNECK 16
#define RANGED_WEAP 17
#define AMMO 18
#define LEAR 19
#define BACK 20
#define LWRIST 21
#define LHAND 22
#define LRING 23
#define WAIST_STOR 24
#define LEGS 25



You will still need to add the info to the big function like i showed in the previous post.
Posted By: producer

Re: The complete RPG Inventory + Tutorial - 10/08/07 01:21

This code is very cool, thank you for sharing it!
Posted By: TheStonerunner

Re: The complete RPG Inventory + Tutorial - 10/08/07 19:35

Thanks! :-)

I don't know if I'll end up using this, but a) it's very cool, and b) it adds to the styles I can try out for my design, so thank you. :-)

If I end up using it in a commercial game, I'd like to work out a payment thing with you.
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 10/08/07 20:04

Thanks, but dont bother about payment. Making money off games is hard enough as it is. Justr include my name somwhere in the credits.
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 10/09/07 18:04

Payments would be allowed if it was called donations? =P hehe really nice script
Posted By: Ghost

Re: The complete RPG Inventory + Tutorial - 10/09/07 19:30

This is a fantastic contribution. Thank you so much.
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 10/09/07 20:13

Heh, yummy, donations. I hope you guys can find a good use for it, an thanks.
Posted By: Mythran

Re: The complete RPG Inventory + Tutorial - 11/20/07 18:27

It's very cool yes, but it gives me a hundred lines of errors...
Can't you upload a small demo with the script? maybe in wdl?
it doesn't matter if the objects positions are correct or not... just a small demo working.
Thanks
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 11/23/07 05:45

evrything works fine... be more specific...
Posted By: D3D

Re: The complete RPG Inventory + Tutorial - 11/23/07 06:48

Hes asking if you like to rewrite your whole contribution for C-Script Mythran have you looked at his tutorial? Try convert the Lite-C code to C-Script.
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 11/23/07 08:38

um
Ive already done hat
Look or it under cscript cotributions

Posted By: D3D

Re: The complete RPG Inventory + Tutorial - 11/23/07 08:46

Well in that case you've made it even easier ^^
Posted By: Nidhogg

Re: The complete RPG Inventory + Tutorial - 11/27/07 04:48

Greatly appreciated, Thanks
Posted By: Mythran

Re: The complete RPG Inventory + Tutorial - 11/27/07 16:59

Hmm i tryed both... nothing... wth...
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 11/27/07 20:52

You tried them both, and nothing? What does that mean... nothing. They aren't there? They don't work? Please explain, I cannot help you if I don't know what the issue is.
Posted By: PadMalcom

Re: The complete RPG Inventory + Tutorial - 01/26/08 14:52

Might be a verly dumb question but is it possible to get it to work in Lite-C?
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 01/26/08 15:38

this is written in lite-c
Posted By: PadMalcom

Re: The complete RPG Inventory + Tutorial - 01/26/08 16:41

Sorry wanted to say C-Script

I'm getting one erro after the other:

- Function attach_item() is missing.
- Defines (f.i. REAR) are missing (fixed).
- slim_body_00001 undeclared identifier.
...
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 01/28/08 18:21

you can find a cscript here:inventory
Posted By: Deltac

Re: The complete RPG Inventory + Tutorial - 02/04/08 05:56

Thanks for GREAT work, I dont even want to guess how long you used to create this.
Got everything else fixed, but that - slim_body_00001 undeclared identifier.
as PadMalcom said (on around line 1800)
Should I add action with that name or what?
Also wondering how hard it would be to modify this to work with bones animation model?
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 02/04/08 10:52

the slim_body is just a reference to the main body type for the character that this inventory is built around. It is just a model. If you substitute that with your own main model, it will work. The reason why this is coming up as empty, or undeclared is because the slim_body references a entity declared as the main player.
Posted By: Kotakide

Re: The complete RPG Inventory + Tutorial - 02/05/08 06:27

I create the new level in wed, and then I use the main.c script from your code.
I build the level but when I run the level. I got some error like this:

Error in 'inventory.c' line 1678:'REAR' undeclared identifier
<if((ui_equip_slot_array[0]=0)&&(player.ITEM_TYPE != REAR))

Please help!
Posted By: Kotakide

Re: The complete RPG Inventory + Tutorial - 02/05/08 06:45

Can somebody give the level sample that 100% works.
Please!
Posted By: oldschoolj

Re: The complete RPG Inventory + Tutorial - 02/05/08 09:00

hmm, let me make a little mock up I suppose, but first I need to know if you want this in Lite-C or C-Script?

BTW anytime you have undeclared modifiers, it's because something is undeclared. Check your defines.wdl, or defines.c file for #define REAR ...etc. If it's not in there, then that is your problem.
Posted By: Kotakide

Re: The complete RPG Inventory + Tutorial - 02/06/08 04:46

Quote:

hmm, let me make a little mock up I suppose, but first I need to know if you want this in Lite-C or C-Script?

BTW anytime you have undeclared modifiers, it's because something is undeclared. Check your defines.wdl, or defines.c file for #define REAR ...etc. If it's not in there, then that is your problem.




A little mock up will be very helpull, Thanks in advance!
and I need it written in C-Script.
Posted By: Kasey_Dee

Re: The complete RPG Inventory + Tutorial - 07/06/08 17:43

What happened to the Lite-C tutorial from post page 1? The link is dead.
Posted By: weck

Re: The complete RPG Inventory + Tutorial - 08/21/08 20:28

anyone can restore link?
Posted By: Carlos3DGS

Re: The complete RPG Inventory + Tutorial - 10/17/08 12:10

The links on the first page for the movie and Lite-C examples are broken.
Can anyone please repost a link to these files?
Thankyou for this contribution
Posted By: dracula

Re: The complete RPG Inventory + Tutorial - 10/17/08 13:39

anyone please ?
Posted By: GregoryArndt

Re: The complete RPG Inventory + Tutorial - 10/21/08 00:21

There is an inventory systems here http://www.coniserver.net/wiki/index.php/Clone45%27s_Inventory_Framework
Posted By: ATOMIX

Re: The complete RPG Inventory + Tutorial - 10/23/08 15:17

Links don't work!!!!
Posted By: ATOMIX

Re: The complete RPG Inventory + Tutorial - 10/23/08 15:25

Have you tried this inventory system? It works great when you just run the demo code from an editor (SED, WED), but It crashes when you publish. Has some serious pointer issues, it locks up everything. I find that a lot with this game system. Code works in the editors but don't work when you publish.
Posted By: HSGM

Re: The complete RPG Inventory + Tutorial - 11/09/08 02:49

THe website is down. frown

Link is dead D:
Posted By: Nowherebrain

Re: The complete RPG Inventory + Tutorial - 11/09/08 10:57

@atomix, yes it does. be sure your warning level is set to 3-4 to squash every bug before you publish.
Posted By: bluekey

Re: The complete RPG Inventory + Tutorial - 12/01/08 06:50

hi, i'm new here

sorry if distrubs you

i can't download the file the link is broken

can i get new link to download the file

thank you very much... grin
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 12/09/08 17:23

Hi hi brothers (^.~).

I am needing a small help:

Somebody could help me to create plus a function in this example of menus?


My problem is the following one:

I need create a function that check if mouse its on or not on the panel of bags.

This because my Game is RPG in the style click and Point

and when i click in the panel of bags. the player understand that I am giving a coordinate and leaves walking equal insane person for the world .... lol.

Having this function, I go to be able to create a condition my to player and thus I go to be able to correct the defect.

I am trying to create however I am not having success in the same
The reason of my imperfections must to mine low knowledge on structures.

Please. They help me only with this example and I am certain that studying the same I go to obtain to create my proper functions on the same.

Tanks very much!>.
Arigatouuu
Obrigado (^.~)
Gracias!
Posted By: pegamode

Re: The complete RPG Inventory + Tutorial - 12/21/08 11:02

Can somebody tell me what I have to do so that game_save also saves the inventory?

Best regards,
Pegamode.
Posted By: Schmerzmittel

Re: The complete RPG Inventory + Tutorial - 02/05/09 10:02

Hm. The link is down.

Der Link ist tot. Gibts das Tut auch noch wo anders? Oder kann es jemand uppen?
Posted By: Cowabanga

Re: The complete RPG Inventory + Tutorial - 02/05/09 13:38

Dead link.
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 02/05/09 19:58

I can upload the files if there is great request for them


EDIT:
Here you go. smile
RPG_INVENTORY
Posted By: Schmerzmittel

Re: The complete RPG Inventory + Tutorial - 02/05/09 22:08

Thanks dude! You made my day! :o)
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 02/05/09 22:48

Your welcome smile the people here have helped me with a few things, my time to return the favour smile
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 02/14/09 05:23

having a problem with
Error E1513
Crash in ui_inv_show_desc
having 60 inventory slots and 25 equiptment slots, weird its going to crash then no matter what, at 42 inventory slots and 25 equipment slots it works fine :S
Posted By: snow4dayz

Re: The complete RPG Inventory + Tutorial - 02/23/09 11:05

Link is dead eh?
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 02/23/09 19:35

take a better look through the topics, I posted a link to the files
Posted By: Jaxas

Re: The complete RPG Inventory + Tutorial - 02/24/09 18:25

can't you put link here?
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 02/24/09 19:28

the link is just a few post up from here.

http://files.filefront.com/RPG+inventoryrar/;13211849;/fileinfo.html
Posted By: Jaxas

Re: The complete RPG Inventory + Tutorial - 02/25/09 19:38

thanks wink
Posted By: paracharlie

Re: The complete RPG Inventory + Tutorial - 08/16/09 23:39

Anyone have a small demo of this inventory actually working? I followed the directions best I could and it semi works for me. I get one crash in store_mouse_position and nothing else works.
Posted By: pegamode

Re: The complete RPG Inventory + Tutorial - 08/28/09 05:52

Hmm ... I downloaded the inventory a lot of months ago and built my own inventory on base on this and as far as I can remember there was a fully working demo inside !?!
Posted By: Deha

Re: The complete RPG Inventory + Tutorial - 08/28/09 09:59

Looks very interesting!^^
But all links on the sites do not work, so can somebody upload the rpg inventory,please?
Posted By: Darkyyes

Re: The complete RPG Inventory + Tutorial - 08/28/09 22:09

reposting link
Inventory
Posted By: paracharlie

Re: The complete RPG Inventory + Tutorial - 09/11/09 02:47

I actually was never able to get this all to work even after going through the documents included. Comprehension problem or something I dont know.
Posted By: Carlos3DGS

Re: The complete RPG Inventory + Tutorial - 11/11/09 19:36

Thanks!!!
Posted By: Nowherebrain

Re: The complete RPG Inventory + Tutorial - 11/13/09 04:05

me either, the implementation is too confusing....when you make stuff for yourself, it is easy to follow, but sometime other peoples work is just insane...in the end I wrote my own super confusing code.
Posted By: frankjiang

Re: The complete RPG Inventory + Tutorial - 01/01/10 23:26

cool
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/01/10 18:23

hi hii.
As I would make to create bags dynamically?
for example:
Manual.
bag* item_bag;

Oks i create the bag manually.
Now would make to create bags dinamically?
I have the action of enemy.
when the enemy to die I want that this action creates a bag automatically, with loot of the enemy.

however this to happen necessary to create a bag for each enemy.

i need that in the proper action this already is made.

somebody could help me
Posted By: FBL

Re: The complete RPG Inventory + Tutorial - 03/02/10 07:18

use sys_alloc().
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/02/10 14:31

i no understand.

I see in the manual online the method to use the syntax sys_nxalloc(long size);
it is on that you spoke?

You could show an example to me you practise of it?



Posted By: FBL

Re: The complete RPG Inventory + Tutorial - 03/02/10 16:59

Ah sorry,

it's sys_malloc. This is an engine function.

http://manual.conitec.net/sys_malloc.htm

Try
bag* item_bag = sys_malloc(sizeof(bag));

When done, release the memory with
sys_free(bag);
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/02/10 17:05

ooooooooooohhhh tnkx tnkx brother...
i gooo nowww to try
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/02/10 17:37

oooooooohh my goooodddd.. its work its workkk ...
OOo i go dead rsrrsrsrr....
Tnkx my brother..

::another one doubts::
I created an item dynamically.
it uses a model of armor in the world 3D and When i click in this model
it goes to order the following command.
"inv_float_item(plate_armor)"
to order a floating item for the hand.

however plate_armor it must dynamically be informed and not manually.
how I would make this?
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/03/10 12:49

or the best form is to use many ifs?
Ex:

if(str_cmp(my.string1,"plate_armor")){
inv_float_item(plate_armor);
}

if(str_cmp(my.string1,"plate_shield")){
inv_float_item(plate_shield);
}
...

The problem to make this
it is that I go to have a function obstructed of ifs. if for each item imagines one
Posted By: FBL

Re: The complete RPG Inventory + Tutorial - 03/03/10 14:44

Well attach the pointer to the item data directly to the inventory item. Then you don't need that many if/else.

e.g. on init

action myaction()
{
my->skill42 = sys_malloc(sizeof(item));
//setup item data here
my->skill42->... = ...;
}

and later you can do sth like this:

("ent" being the entity which resembles an inventory item):
inv_float_item(ent->skill42);


I don't know the inventory code, I have never looked at it and never used it, so I'm just guessing what you're trying to do.
The idea is that you have a direct link between the inventory item and your entity, so you don't need endless if/else instructions.
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/03/10 18:26

Oooo yesss.. sory sory my stupid ask.
Already I obtained to make...now I learned to use sys_malloc ()..
very tnnx brother...
I made the following one.

1° I used sys_malloc to create plus an item in the memory.
2° I copied the same values of the item that was played outside of the bag
3° and used the copied values to create the new item.

now not necessary more to use "ifs"..
Tnkx very much...
the syntax is many util for meee...
now understand the function sys_alloc() (^.^)
last more.
Posted By: mikaldinho

Re: The complete RPG Inventory + Tutorial - 03/06/10 12:37

it is great! thanks alot m8.
Posted By: marianschuth

Re: The complete RPG Inventory + Tutorial - 03/29/10 08:32

Hello, I have downloaded the file, but if I would start the main.c script I get an error: inventory line 1678 REAR uncleared identifier. Could you help me? I havn't change anything.
Posted By: NeoNeper

Re: The complete RPG Inventory + Tutorial - 03/29/10 13:29

sory, but I did not find reference " REAR" in the code.
follows link for download of the version that I lowered
http://www.indiegamejobs.com/temp/inventory_demo.zip
Posted By: marianschuth

Re: The complete RPG Inventory + Tutorial - 03/29/10 14:38

This inventory works perfect, but I mean this inventory:

http://www.filefront.com/14418777/RPG_inventory.rar/
Posted By: paracharlie

Re: The complete RPG Inventory + Tutorial - 08/01/10 22:10

Does anyone have a working example of this inventory system they would like to share with me? If so let me know, I'm getting to the point where I'm about to hire someone to make it for me.

Has to be *.c
Posted By: 3run

Re: The complete RPG Inventory + Tutorial - 08/22/10 07:45

When I open inventory bag (any of them), I'm getting empty prototype, but inventory works normal after that. Is there any normally working example?
Posted By: paracharlie

Re: The complete RPG Inventory + Tutorial - 09/03/10 16:40

I'm under the impression that this topic is dead and the author is gone 3run. Or it never did work.
I should have been able to make this work, but from the start there was already way too many problems with it.
© 2024 lite-C Forums