Object in inventory description messed up.

Started by freeplayer, Sat 08/03/2014 22:32:06

Previous topic - Next topic

freeplayer

he pointer will show the description if u put the pointer in the air and not on the object.

Why?

NickyNyce

#1
http://www.adventuregamestudio.co.uk/forums/index.php?topic=47009.msg631959#msg631959

Use the search feature, it's pretty good at finding answers to this stuff.

Ghost

Yup, that's really something that happens a lot. Just make sure that you have the hotspots set for all cursor modes. It's amazing how often one forgets that- i think the same thing happen here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=50144.msg636483344#msg636483344 :=

freeplayer

Yes, in that post that happened and i've solved that.
But now, it seems it's different and i can't solve this issue about items in inventory. Tryed until now since i made this post and no success.

And another thing. What pourpose those the button on the RIGHT of inventory icon, on the Iconbar? The button that looks like an empty border... an empty frame (btnIconCurInv) ?

Ghost

Quote from: freeplayer on Sun 09/03/2014 00:47:46
And another thing. What pourpose those the button on the RIGHT of inventory icon, on the Iconbar? The button that looks like an empty border... an empty frame (btnIconCurInv) ?

I am mind-reading now, but I think you are using the default template? (It's useful if you tell us that stuff). In that case, that frame will change to the last used inventory item, once one has been used. It's a throwback from old Sierra games and these days it's rarely used in games. Basically it's a "quick-slot" for inventory.

So changing the hotspot for the mouse cursors did not work?

freeplayer

Changing the hotspot for the mouse cursor didn't worked on the inventory, no. It only worked on the issue i had in this post: http://www.adventuregamestudio.co.uk/forums/index.php?topic=50144.msg636483344#msg636483344
But the inventory issue still remains.

Please, about using the default template. I dont know if I am or not. Can you be a bit more explicit so I can give u a corect answer? (keep in mind i work with AGS for about 4-5 days).

Ghost

When you started your game, you created a project. At that time, AGS asked you to pick a template to use for the project. There are a couple of them and one of them is the "Default Game".
Basically: When you move the mouse to the top of the screen, does a bar with icons pop up, allowing you to select cursor modes, inventory, and an options panel? And is it all in ugly gray? Then you are using the default template.

Also, don't take me too serious; I may sound teasy sometimes but I'm mostly here to help (nod)

freeplayer

Yes i understand you, and i thank you and really apreciate your help.

Well, yes, i started a default game and also i have that "ugly" gray pop-up bar when i move the mouse on the upper part of screen (which shows the inventory stuff you just mentioned).

Was wrong to do so? The problem is related to that?

Ghost

#8
No, not wrong at all (it is the "default" for a reason ;-D ). Just trying to narrow down why things go wrong for you.

Another reason for your inventory not working could be the size of inventory icons. You see, there is an "inventory window" that holds all the things the character carries. It uses rectangular boxes to create an invisible grid for item display (and click handling). If you open the inventory window GUI, you will see two properties once you select the InventoryWindow element: ItemHeight and ItemWidth. You should make sure your sprites for inv. items are THAT SIZE. I remember another project where this caused trouble, items would occasionally not register a click because they used sprites that did not match the dimensions of the grid.
You don't have to make the actual objecs fit the rectangle, just the image itself.
If that isn't it I'm at a loss though.

freeplayer

#9
That was the problem (i tink). My item was 100x50 px PNG.
I went into GUIs - gInventory and set the ItemHeight and ItemWidth at 100x100 px.

Thanx :smiley:

But once i have the item in hand, how can i get rid of it? to return it to the inventory and not browse again thru it if i make right click?

And what is the pourpose of this inventory buton:


Khris

When you select an inventory item, the UseInv cursor is added to your range of active cursors.
Since all cursor modes in the default game have their own button, there's also one for the inventory item cursor. The item graphic should show up inside the box you marked whenever you have an ActiveInventory.

Regarding unsetting the ActiveInventory, most people accept that by default you'll keep it until you lose the item. If you want to add the possibility to get rid of it, you have to think about how that'll fit in your control scheme. If you used a two button interface (left click: interact/talk/use item, right click: look at) you'd probably do this by right-clicking while "carrying" an active item. In your current setup you could use a middle mouse button / mouse wheel click:
Code: ags
 // add this within on_mouse_click, after the (button == eMouseLeft) block:
  else if (button == eMouseMiddle) {
    player.ActiveInventory = null;
  }

freeplayer


Ryan Timothy B

Quote from: Khris on Sun 09/03/2014 14:38:17
add this within on_mouse_click, after the (button == eMouseLeft) block

It'll be in your global script.

freeplayer

I see now, but i messed up the whole global script somehow.
How can i revert it to the original one? or where can i find a default global script so i can replace it?

Khris

Create a new default game, open the Global Script.

freeplayer

#15
Solved! Reverted to the default. Thanx.
Will try now with that code.

Edit: Thanx Khris and guys! The code works fine! Now if i click on middle mouse button, the item will go back to the inventory!

SMF spam blocked by CleanTalk