PDA

View Full Version : Why is there no inventory documentation?



3dcamel
08-14-2010, 03:48 AM
Iv been looking for about 2 weeks now on any type of doucmentation even relevent to a inventory system and have nothing. There is none, its very annoying. please epic make some documentation we can folow.

Wormbo
08-14-2010, 04:48 AM
There's an InventoryManager for each Pawn and all stuff the Pawn carries is organized in a linked list of Inventory objects there. Sounds simple enough, so why do you need a tutorial for that?

Snufkin
08-14-2010, 06:23 AM
He means documentation for something like this:
http://gameinformer.com/cfs-filesystemfile.ashx/__key/CommunityServer.Components.ImageFileViewer/CommunityServer.Blogs.Components.WeblogFiles.00.00 .00.75.40/1805.inventory.jpg_2D00_610x0.jpg

westclif
08-14-2010, 08:18 AM
or even some documentation for an inventory type like the one in diablo I where an item needs 6 field of an inventory and another on about 2 field or 1 and so you must place the items right on size

http://i153.photobucket.com/albums/s205/JamesKond/DiabloInventory.png

awakeningfromobliv
08-14-2010, 08:41 AM
go in your C:\UDK\UDK-2010-08\Development\Flash\CLIK\demos

there is a file called "InventoryDemo".

westclif
08-14-2010, 09:17 AM
yeah sure but then can you help me to implent it a little bit into the udk per uscript? =)

awakeningfromobliv
08-14-2010, 09:25 AM
Sorry I can't code. When you play the demo hit "F10" there is an inventory that pops up.
you could probably take some of that code and mash them together some how.

Snufkin
08-14-2010, 09:27 AM
go in your C:\UDK\UDK-2010-08\Development\Flash\CLIK\demos

there is a file called "InventoryDemo".

Oh nice just what i need ROFL!!:D

Blade[UG]
08-14-2010, 06:06 PM
Because "inventory system" doesn't mean anything until you actually design what you want to have, which will ultimately likely be entirely unlike anything else anyone else designed. If you understand the various pieces that you would need to put your thing together, whatever that might be, then you'll know how to do it.

westclif
08-14-2010, 06:33 PM
yeah but a starting help or a simple rpg inventory that is well documented would be really nice so you can learn something for yourself

Gillies
08-14-2010, 07:13 PM
heres a starting point, break down what you need your inventory system todo.
Then pick one part and start! example, it should store items of type x, then you would need to code yourself up a manager class that contains an array \ list \ whatever of x items, you would then need to add functionality to it to add / remove / equip these items.

for saving of the inventory you could use the config files to store them, by looking at the sapitu page on udn you should be able to adapt that.
here is my inventory system for a little rpg i did as an example of how not too complicated it is


class RPGInventoryManager extends Object
Config(Inventory)
PerObjectConfig;

var config array<string> invNames;
var array<InventoryItem> itemList;

function initInventory()
{
local int i;
if(invNames.Length==0)
{
`log("###NOTHING TO INIT IN INVENTORY");
return;
}
for(i = 0; i<invNames.Length;i++)
{
itemList.AddItem(new(None,invNames[i])class'RPG.InventoryItem');
}

}

function listInventory()
{
local int i;
if(itemList.Length==0)
`log("###NO INVENTORY TO LIST");
for(i=0;i<itemList.Length;i++)
{
itemList[i].showInfo();
}

}

function bool getItems(out array<InventoryItem> out_ItemList)
{
if(itemList.Length>0)
{
out_ItemList = itemList;
return true;
}else{
return false;
}
}

function bool addInventory(string invID)
{
local InventoryItem tmp;
local Item tmpItem;
local int i;

//search for existing item
for(i = 0; i<itemList.Length;i++)
{
//found existing item in the players inventory, so increment the amount possesed
if(invID == itemList[i].displayName)
{
itemList[i].addMore();
return true;
}
}
//if no existing item of this type is found then create one and add it to the list
tmpItem=createItem(invID);
tmp = new(None,invID$"1")class'RPG.InventoryItem';
if(tmp!=None && tmpItem !=None)
{
tmp.baseItem = tmpItem;
tmp.initStats();
itemList.AddItem(tmp);
invNames.AddItem(invID$"1");
saveInventory();
return true;
}else{
return false;
}

//shouldnt be here
`log("awww crap in add inventory");
return false;
}

function Item createItem(string itemID)
{
local Item tmp;
tmp = new(None,itemID)class'RPG.Item';
if(tmp!=None)
return tmp;
else
return None;

}

function saveInventory()
{
local int i;
SaveConfig();
for(i = 0; i<itemList.Length;i++)
{
itemList[i].SaveConfig();
}
}

defaultproperties
{

}

westclif
08-15-2010, 08:03 AM
ouh thank you i will try my best and see if i can get something out of it =)

but why aren't you extending from the inventory that is already implented?

Gillies
08-15-2010, 06:30 PM
because these arnt weapons, they are items like health potions, and i need to be able to save them, using the UTinventorymanager would be extreme overkill for my needs.

westclif
08-15-2010, 09:40 PM
and even the normal inventory manager ? not the ut based one ?

Blade[UG]
08-15-2010, 10:29 PM
because these arnt weapons, they are items like health potions, and i need to be able to save them, using the UTinventorymanager would be extreme overkill for my needs.

Sounds like an int counter, to me. Inventory is really only needed for stuff that needs to run complex code ..