Basic inventory and another question.

How would I go about coding an inventory with basic crafting?
I’m still kinda new to Lua, and I’d really like it if somebody could help me out.

Also is 4 or 5 Networked ints per player bad?

Use a table to store items and data temporary. Pick between text, sql, mysql for saving the inventory. If you need further help take a look at Inventory addon by ChewGum.

Will do

Eh, I still need a basic inventory tutorial.

If you’re still “kinda new to Lua” an inventory system is not realistic goal.

I’m not very new, I’m just sure there are things that I’ve missed.

An inventory system goes into a category I’d like to call “Things that you shouldn’t do unless you know how to”
This doesn’t mean you need to know exactly how to do everything, but it means you need to realise what has to be done and where to find the resources necessary to do it.

If you really want to do, start by dividing the big task into smaller ones, for instance you’ll want to store the inventory items somehow (probably a table) and maybe you’ll want it to be server-side (probably) so you need a networking system to sync it with the client-side derma etc etc.
If you ask for help on these subtasks instead you’re more likely to get help, because noone’s gonna explain the whole process of creating a full inventory system but someone might be nice enough to explain to process of networking data or generating derma from a table.

Already learned how to generate spawnicons from a table, now I just need to know how to store entity data in a table. So I can do things like icon:SetModel(items*.Model)
Thanks for the advice, too.

Nevermind, I that figured out too

[editline]18th January 2011[/editline]

Although I’d still like to know about the networked ints

I would recommend checking out some already existing inventories, such as Chewgum’s inventory addon. Do not rip code from it, but learn from it.

I also need to learn how to make an inventory, fatman add me on steam, tell me what you’ve done so far and how you did it :slight_smile: