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?
It would help if we had some idea what the code was so we could figure out which parts are not working as planned.
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.
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?
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.
In General settings, uncheck "Handle inventory clicks in script".
I can look at them, but I still can't select them I'm afraid. :-[
Make sure you're using the Interact cursor mode to select them.
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)
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.
Thanks, now it's working perfectly. I don't see any more problems with it. Thank you so much. :D