Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Secret Fawful on Tue 15/05/2007 19:38:06

Title: BIGTIME Inventory Problem.
Post by: Secret Fawful on Tue 15/05/2007 19:38:06
All right. I need help with three problems. Problem one. I can't get the Inventory to pop up using a right click like MI 3, Number 2, as of now the inventory is visible, just for testing, but I can't select an inventory item, as in clicking it, it turns into the mouse cursor, I use it with an object. And three, I can't get any of my buttons to work, aka, look, use, ok, and the up and down arrows. In other words, no code I've tried has worked, and yes I've scoured the rest of these forums for codes, but none of them work. Plus whenever I add in a code using the line if, it says I've had a parse error. So, what do I do?
Title: Re: BIGTIME Inventory Problem.
Post by: Maverick on Tue 15/05/2007 20:23:29
It would help if we had some idea what the code was so we could figure out which parts are not working as planned.


Title: Re: BIGTIME Inventory Problem.
Post by: Secret Fawful on Tue 15/05/2007 22:57:15
Actually, I meant the Global script for the inventory that was already in the game isn't working right. I don't know how to code this actually.
Title: Re: BIGTIME Inventory Problem.
Post by: Khris on Tue 15/05/2007 23:19:04
Are you using some template? Or AGS's default game?

1.
function on_mouse_click(...
  ...
  else if (button==eMouseRight) {
    if (!gInv.Visible && player.ActiveInventory==null) gInv.Visible=true;
    ...
  }
  ..
}


2+3 work in the default game. So again, what are you using?
Title: Re: BIGTIME Inventory Problem.
Post by: Secret Fawful on Wed 16/05/2007 00:04:05
AGS's default engine. As far as the mouse right code, I almost had it right except for this line, which I hadn't entered

(!gInv.Visible && player.ActiveInventory==null)
It works now, thank you so much.  ;D

But now my only other problem is getting the inventory items to become active so that I can select them and use them with hotspots.
Title: Re: BIGTIME Inventory Problem.
Post by: Khris on Wed 16/05/2007 00:28:44
In General settings, uncheck "Handle inventory clicks in script".
Title: Re: BIGTIME Inventory Problem.
Post by: Secret Fawful on Wed 16/05/2007 03:05:45
I can look at them, but I still can't select them I'm afraid.  :-[
Title: Re: BIGTIME Inventory Problem.
Post by: SupSuper on Wed 16/05/2007 15:13:04
Make sure you're using the Interact cursor mode to select them.
Title: Re: BIGTIME Inventory Problem.
Post by: Secret Fawful on Wed 16/05/2007 23:49:18
Thanks, that worked. :D But now the inventory won't open again once I've selected an inventory item. (I'm helpless O_O)
(Someone smack me upside the head, sorry)
Title: Re: BIGTIME Inventory Problem.
Post by: Ashen on Wed 16/05/2007 23:56:54
If you insist ... *SMACK*

Anyway, that'll be the && player.ActiveInventory==null bit of Khris' code doing what it's supposed to. Just remove it, or change the code to something like:

else if (button==eMouseRight) {
    if (!gInv.Visible) {
      player.ActiveInventory = null;
      gInv.Visible=true;
    }
    ...
  }

Depending on how you want it to work.
Title: Re: BIGTIME Inventory Problem.
Post by: Secret Fawful on Thu 17/05/2007 01:32:39
Thanks, now it's working perfectly. I don't see any more problems with it. Thank you so much. :D