Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: magintz on Fri 07/01/2005 19:05:14

Title: Problems with inventory and LEC GUI (SOLVED)
Post by: magintz on Fri 07/01/2005 19:05:14
Anywhoodle, lemmie 'splain my problem to you.

The Situation:
I'm playing through my game to test it, In one room I get to pick up a bunch of inventory items and use them. When I use an inventory item with a hotspot I get taken to another room. In this new room the player character changes and the inventory is changed to nothing and you can grab a bunch of new items.

The Problem:
Everytime I try to "use" one of the newly aquired inventory items it displays in the display bar "use pole with", pole being inventory item 3 and the inventory item sued to transport to this new room/new character and when i try to use the items  on something else it does nothing.

When i start a new game and use "ctrl-x" debug tool to skip to the room when i go to use the inventory item it says "invalid inventory item specified" and a problem with line 51.


      StrCat(madetext,"Use ");
this line -->     GetInvName (player.activeinv, buffer);
      StrCat(madetext,buffer);
      StrCat(madetext," with ");

I am using Proskritos LEC GUI but I think it's an older version, can anyone help.

Edit: I believe the problem to be in the player.activeinv line, I think that it isn;t getting the data from the new character or hasn't realised that the inventory has changed. How could I perhaps incorporate a GetPlayerCharacter command and would this work?
Title: Re: Problems with inventory and LEC GUI
Post by: Ashen on Fri 07/01/2005 19:24:31
I think the player thing is set when the game starts, and isn't updated when/if you change characters, so, yeah, that might be the problem.

Try using this instead:

GetInvName (character[GetPlayerCharacter()].activeinv, buffer);
Title: Re: Problems with inventory and LEC GUI
Post by: magintz on Fri 07/01/2005 20:06:11
Cheers Ashen, that seemed to do the trick.