Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Lite-c Inventory System #179009
01/21/08 05:17
01/21/08 05:17
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco
Hello,

I am incredibly excited to offer the 3d GameStudio community a flexible inventory system for lite-c. I'm usually pretty humble about my code, but I think that this is something special. Here are some of the features:

  • You can pop open multiple inventory bags and move items from bag to bag.
  • You can drag bags around and the panel layers are handled automatically for you. For example, if you have a few bags that overlap, clicking the one in the center will bring it forward.
  • The system supports callbacks so your code can tell what's going on.
  • It's easy to use. You don't need to touch the inventory code at all.
  • "Slot types", such as weapon slots, are supported.


Here's a youtube video showing it in action, although the arrow pointer doesn't show up in my video:

http://www.youtube.com/watch?v=r6tv3YM1SYg

I've created a demo that you can download at:

http://www.indiegamejobs.com/temp/inventory_demo.zip

The demo uses images from World of Warcraft because I didn't have any inventory images handy. Obviously, don't use those images in games. In the demo, press 'a' to open bag1. Press 's' to open bag2. Press 'd' to open bag3. Press 1 or 2 to add items to the inventory. Press z to close the demo.

Here's a excerpt from the demo lite-c:

Code:

item_sand = inv_create_item(1,0,"item1.pcx","item1.pcx");
item_wool = inv_create_item(2,0,"item2.pcx","item2.pcx");

// Create bag 1

bag = inv_create_bag(1,"pack.pcx");
inv_set_bag_drag_region(bag,5,3,128,18);
inv_set_bag_close_region(bag,129,0,148,19);

inv_add_slot_to_bag(bag,1,0,"slot_bg.pcx",9,38);
inv_add_slot_to_bag(bag,2,0,"slot_bg.pcx",44,38);
inv_add_slot_to_bag(bag,3,0,"slot_bg.pcx",78,38);
inv_add_slot_to_bag(bag,4,0,"slot_bg.pcx",112,38);

inv_insert_item_into_bag(bag,item_wool);



Documentation can be found on the wiki here: http://www.coniserver.net/wiki/index.php/Inventory.c_docs

I'm going to keep working on the inventory as I build out my game. However, it should be usable as-is. I've posted the main files on the wiki too so that people can continue the project if I get too wrapped up with my day job. Here's the wiki page:

http://www.coniserver.net/wiki/index.php/Clone45%27s_Inventory_Framework

A special thanks to everyone who takes the time to answer questions on these forums. You are awesome!

- Bret

Re: Lite-c Inventory System [Re: clone45] #179010
01/21/08 17:21
01/21/08 17:21
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Wow, looks very flexible and intuitive!
Great contribution!
Awesome in its additions like demo and documentation in the wiki!

Re: Lite-c Inventory System [Re: Pappenheimer] #179011
01/22/08 18:18
01/22/08 18:18
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
great, exactly what i was looking for. (its even more )


3333333333
Re: Lite-c Inventory System [Re: Quad] #179012
01/23/08 03:17
01/23/08 03:17
Joined: Mar 2002
Posts: 580
San Francisco
clone45 Offline OP
User
clone45  Offline OP
User

Joined: Mar 2002
Posts: 580
San Francisco
You're welcome Quadraxas. I'm going to be adding some functionality that's missing in the next few weeks. For example, there should be a way to remove a bag from the layer-control system so that its layer remains constant. There should be a way to remove an item from a bag programmatically. There should also be a "close_all_bags()" function.

Also, although I've done my best to avoid them, keep an eye out for memory leaks.

Cheers!
- Bret

Re: Lite-c Inventory System [Re: clone45] #179013
01/26/08 16:37
01/26/08 16:37
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
There is no possibility to use it in C-Script, is it?

Re: Lite-c Inventory System [Re: PadMalcom] #179014
01/26/08 16:59
01/26/08 16:59
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
AFAIK allows C-Script using of Lite-C snippets, but not vice versa. Haven't tried though, but take a look at the migration page in the manual.

Re: Lite-c Inventory System [Re: FBL] #179015
01/26/08 17:18
01/26/08 17:18
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I'll have a try (never thought that it would be possible to mix these both languages up)

EDIT: It doesn't work fine, I get an error in the inventory.c ... at line 373.

Last edited by PadMalcom; 01/26/08 17:32.
Re: Lite-c Inventory System [Re: PadMalcom] #179016
02/01/08 01:34
02/01/08 01:34
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quote:

I'll have a try (never thought that it would be possible to mix these both languages up)

EDIT: It doesn't work fine, I get an error in the inventory.c ... at line 373.




i succesfully added this to my expiremental project, i think i had some errors but dont remember exactly, fixing them was easy.

anyways, whats the error exactly?


3333333333
Re: Lite-c Inventory System [Re: Quad] #179017
03/04/08 08:41
03/04/08 08:41
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
I now chaged my entire code to lite-c due to the advantage of structs, will try it again tonight.

Lite-c Inventory System [Re: PadMalcom] #179018
03/04/08 21:59
03/04/08 21:59
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline
Member
Arrovs  Offline
Member

Joined: Apr 2006
Posts: 159
Latvija
This is wonderfull! Im tryed to make inventory already long time ago, but without succes (of course im uzing c-script)! And problems with one panel creating more times and moving all. And all this interractive things like to you!
I sure will try out, but only through c-script!
And one question or really that is done only with lite-c and nothing from dll.


Arrovs once will publish game
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1