Changed mouse cursor not activating Hotspot correctly

Started by barefoot, Fri 03/12/2010 14:59:56

Previous topic - Next topic

barefoot

Hi

I am having a bit of trouble with the below code. When I click on a Hotspot with a changed mouse graphic it just acts as 'Walk' and does not activate below code although the
'else' works fine:

After you Click on a particular Object:
Code: ags

object[4].Visible = false;
      mouse.ChangeModeGraphic(0, 167);


This works fine.

Then Click the mouse with the new graphic on a Hotspot:

Code: ags

function hHotspot5_Interact()
{
 
   if (!oball2.Visible) {
   Display("You lower the foul creature into the bath!!");
   cChris.Say("Die you smelly creature of satan!!!!");
   Display("Soon the fur ball breaths no more, it is dead!");
   cChris.Say("Well, I don't have to worry about this one anymore!");
  
}


  else 
  Display("Is this the right time for a bath?!!");

}


All help appreciated

barefoot

I May Not Be Perfect but I Have A Big Heart ..

Khris

Well, you are changing the graphic of eModeWalkto:      mouse.ChangeModeGraphic(0, 167);

So no matter what the cursor looks like, it will still be the Walkto cursor and thus not trigger '"interact with ..." events.

Your way of doing things is bad and error prone, if I may say so. Since I don't really know what kind of gameplay mechanic you're trying to implement here, I can't help you more than that.
But there's bound to be a better way than constantly changing the ModeGraphic.

barefoot

Hi Khris

I understand your meaning, and  im sure in the near future my scripting will be vastly improved, untill then...

The  general idea is that you grab an object (enemy) and you deal with him..

EG: You lasso him with a robe tie (graphic changes so he is the mouse cursor) then you put him in the bath to drown.... So you would need to have him on the mouse to put him in the bath...

The new cursor mouse graphic clicks on a hotspot for this to happen...  this is the general idea Khris.

I overlooked the mode for this event as you mentioned and have now corrected it.

Many thanks Khris...  That's why you have the stripes..

:=

PS Be nice to see a writeup on scripting eitiquette and uses... for mortals like me...

Thanks again

barefoot


I May Not Be Perfect but I Have A Big Heart ..

SMF spam blocked by CleanTalk