Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Pinback on Mon 16/11/2009 08:48:49

Title: Multiple inventories
Post by: Pinback on Mon 16/11/2009 08:48:49
I'm trying to implent multiple inventories for the main character, by having multiple characters with different inventories to switch between, but when I use;

invMain.CharacterToUse = cTinman;

To change the active inventory to cTinman,  I get an error message - Undefined token 'invmain'
Could someone please tell me what I'm doing wrong?
Title: Re: Multiple inventories
Post by: Khris on Mon 16/11/2009 11:19:30
I assume "invMain" is the script name of the Inventory Window?
Where did you put that line?
Title: Re: Multiple inventories
Post by: monkey0506 on Tue 17/11/2009 06:29:34
"undefined token" indicates that you're referencing something that doesn't exist. You said you're using "invMain" but then you said the error indicates the undefined token as "invmain". Note that AGS's script is case-sensitive, so be sure to check your capitalization as well as spelling. If that doesn't clear it up, as Khris said make sure that you have the script name of your InvWindow set in the editor, and if that's still not it, tell us where you're putting the script that it's causing errors. ;)
Title: Re: Multiple inventories
Post by: Khris on Tue 17/11/2009 09:34:19
Also, there's that handy auto-complete window which should show up as soon as you have typed the first three letters of a known script object.
Typing "invma" <enter> should change the typed letters to the correct case.