Help using the Inventory
by Jan-Reinald Viardo · in 3D Isometric Kit · 02/17/2010 (3:13 am) · 8 replies
Hi, I am trying to save the lists of items in my inventory. When I use %player.getinviteminslot(inv). It would only get the first item in the free inventory space. How do i get all the items in the inventory space? Thanks. I need this for my save and load system.
#2
02/19/2010 (4:26 am)
Ive checked in there is none. I dont understand it so I cant make a console method for it. Ive seen nextlink, lastlink would get the other items in inventory
#3
02/19/2010 (9:41 am)
ok i will get this setup for you. give me a couple days as im super busy with RL work right now.
#4
02/20/2010 (3:13 am)
ok..thanks so much. Do you know a resource for mini map? Wherein I can label parts of the map and put indications of people?
#5
02/22/2010 (11:08 am)
not off the top of my head, do a search and then click advanced and limit it to resources only
#6
something like this should work. you will have to tweak it a little.
03/01/2010 (4:17 pm)
hey jan,something like this should work. you will have to tweak it a little.
void Inventory::GetAllFreeSpace(char* retvalue)
{
InvLink* getLink = FirstItemInList;
if (getLink != NULL) {
while ( getLink->nextLink != NULL) {
dStrcpy(retvalue, getLink->ItemData.Name);
getLink = getLink->nextLink;
}
}
}
#7
03/07/2010 (4:25 pm)
how do i use this and where do i put this code? Please paste the fully working code and how can i integrate it. Thanks
#8
since this code doesnt really do what you are asking for you will have to figure out how to modify it to your needs. right now it will spit out a string value of the names of all the items in your inventory.
also you will need to expose this to the console. if you are not sure how to do that do a search for exposing console methods.
03/08/2010 (11:00 am)
you need to drop this into the source code. so in the c++ source code in inventory.cpp you will drop this. its under the t3d folder. then you also must declare this in inventory.hsince this code doesnt really do what you are asking for you will have to figure out how to modify it to your needs. right now it will spit out a string value of the names of all the items in your inventory.
also you will need to expose this to the console. if you are not sure how to do that do a search for exposing console methods.
Torque Owner Timothy Castagna
TK Games LLC
i don't remember off the top of my head if there is already a function for getting all the inventory, you may have to add one. If there is one you may have to add the console methods to gain access through torquescript. If you have any issues finding this let me know and i will check the source code when i get home.