Multiple Inventories

Started by Babar, Tue 03/08/2004 23:40:44

Previous topic - Next topic

Babar

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?
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Akumayo

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???
"Power is not a means - it is an end."

Moox

You could always use a character exactly the same as your player character  so you cant tell the difference

Akumayo

This is true, but I was thinking that the character SPELLS would be invisable.  I didn't mention that though...
"Power is not a means - it is an end."

Babar

I had didn't think of using seperate characters. Thanks for the help.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

Ashen

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();
}
I know what you're thinking ... Don't think that.

Ishmael

I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Babar

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.
The ultimate Professional Amateur

Now, with his very own game: Alien Time Zone

SMF spam blocked by CleanTalk