Hotspots different when using inventory item.

Started by Ghostlady, Sun 31/05/2009 01:16:34

Previous topic - Next topic

Ghostlady

I seemed to have broke something in my game and am not sure what I did.  I have a hallway with 6 doors, three on each side.  Each of the doors is a hotspot.  If the cursor interacts with any of the 6 doors, everything seems to be working correctly.  If I use an inventory key on the each of the doors, the hotspot seems to have shifted forward.  So now door #6's hotspot is at door #5.

This is part of my repeatedly execute, (it changes the way the key is pointing)

if (player.ActiveInventory == iKey) {   
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hBedroomD) {
      iKey.Graphic = 10; } 
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hBedroomP) {
      iKey.Graphic = 10; } 
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hBathroom) {
      iKey.Graphic = 10; } 
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hDoor) {
      iKey.Graphic = 9; } 
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hHistoryRoom) {
      iKey.Graphic = 9; } 
  if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hBedroom) {
      iKey.Graphic = 9; }}
     
if (GUI.GetAtScreenXY(mouse.x, mouse.y)!=null) {
    if(Mouse.Mode!=eModeUseinv) {
       mouse.UseModeGraphic(eModePointer);}}

And

I am using this for using the inventory on the hotspot:

function hDoor_UseInv()
{
  if (player.ActiveInventory == iKey) {
      gGui3.Visible = true;
      SaySpecial2(player, "I guess this isn't my room then.");
      gGui3.Visible = false; }
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Trent R

Have you correctly marked the 'hotspot' (ie. where the mouse clicks) on the inventory item correctly? That seems like it may mess things up (especially since you see the mouse.x/y results immediately in the rep_exec)


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Ghostlady

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Ghostlady

The first image shows the hotspot on the last door, the bathroom, see the arrow.

The second image show the inventory key on the "now" bathroom hotspot, the middle door.

I am using the "overhotspot" gui so don't let the wording throw you.

Sample1

Sample2
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

Ghostlady

I figured out what is causing this problem.  I upgraded to the latest AGS version, SP1, and one of the enhancements is this: * Added inventory item CursorImage property to allow you to set a different image for the mouse cursor to the inventory window *

So when I was coding this: if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hBedroomD) {
      iKey.Graphic = 10;

It must have been getting confused since the CursorImage defaulted to the inventory image, which was something like 200.  Once I changed the image number to 10 in the CursorImage box, it started working correctly again. Yea!
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven
Haunting at Cliffhouse

SMF spam blocked by CleanTalk