Is it possible for 1 character to have more than 1 inventory? I ask because I wanted to have a character that can do magic, and the simplest way I found was to have it as another inventory (somewhat like Quest for Glory). Also, AGS claims to be able to have multiple inventories for different characters. How exactly is this done?
Okay, here is how to do it!!!
Making two Inventories
If you have a GUI, and it has to buttons, one says Inventory, one says Spellbook. Make sure that your INVENTORY GUI will fit across the whole screen. Now, if you click on Inventory, then run script GUIOn(INVENTORY); Here is the tricky part, create another character named SPELLS, put him in a blank room with no background. If you click on Spellbook, the run script SetPlayerCharacter(SPELLS); GUIOn(INVENTORY);
Doing this will make it so that you have both a normal Inventory and a Spellbook inventory.
For adding Items:
For adding to the normal Inventory, just use the AddInventory command
For adding to the Spellbook, first set the player character to SPELLS, then use the AddInventory command.
Did I miss anything???
You could always use a character exactly the same as your player character so you cant tell the difference
This is true, but I was thinking that the character SPELLS would be invisable. I didn't mention that though...
I had didn't think of using seperate characters. Thanks for the help.
QuoteFor adding to the Spellbook, first set the player character to SPELLS, then use the AddInventory command.
Or, create a function to do it for you, e.g.:
function AddSpell(int spell) {
character[SPELLS].inv[spell] = 1; // add spell
UpdateInventory();
}
Btw. http://www.agsforums.com/yabb/index.php?topic=6498.0
Yaiiiii....thanks for the link...I think. The absurd amount of detail that actually goes into this has put me off the spell idea. I will study the template by Scorporious, and maybe be able to do it later. Stupid me for not finding this topic. It had the EXACT same problem as I did.