Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: spook1 on Fri 19/03/2004 19:33:47

Title: click hotspot behind an object?
Post by: spook1 on Fri 19/03/2004 19:33:47
Once I have placed an object over a hotspot, I cannot reach the hotspot anymore.

is there a solution for this, or do I have to work my way around using GetLocation(.... etc.

Sorry for being silly, but I plan to ask everything only once ;-)

martijn
Title: Re:click hotspot behind an object?
Post by: Ben on Fri 19/03/2004 20:17:51
Have you tried this as an interaction for the object? :

ObjectOff(1);
ProcessClick (mouse.x, mouse.y, MODE_USE)
ObjectOn(1);

I don't know if that will work, but it should..
Title: Re:click hotspot behind an object?
Post by: spook1 on Fri 19/03/2004 20:38:55
Well, I would need to turn off the object before I click the hotspot.
And I want to reach the hotspot itself.
This way I have to turn the object on and off every gamecycle to see if the hotspot was clicked. is that what you mean?
I could test it...
Title: Re:click hotspot behind an object?
Post by: Scummbuddy on Fri 19/03/2004 21:45:48
Can you give us a more descriptive idea about whats going on in the scene? Does the object take over the whole hotspot?
Title: Re:click hotspot behind an object?
Post by: spook1 on Fri 19/03/2004 22:09:55
Quote from: Scummbuddy on Fri 19/03/2004 21:45:48
Can you give us a more descriptive idea about whats going on in the scene? Does the object take over the whole hotspot?
\

Yes,


I have created a somewhat crappy script.
I have defined a number of hotspots, coreresponding to electric circuit elements.

To place an element on a hotspot I interact with hotspot and this turns on the object on the hotspot. To remove the element I cannot see the hotspot anymore. For my script it is easiest to use the hotspotnumber again to unselect the object.
Now I have to rewrite the bunch to do an interaction with objects in the "way back".

Maybe a rescript of the whole thing is the best option :-(
Title: Re:click hotspot behind an object?
Post by: Radiant on Mon 22/03/2004 09:31:03
There is a function GetHotspotAt (x,y).
That should do it.
Title: Re:click hotspot behind an object?
Post by: spook1 on Mon 22/03/2004 10:04:56
Trying that now. I cannot use "interact with hotspot" as event handler though....
Title: Re:click hotspot behind an object?
Post by: SSH on Mon 22/03/2004 10:49:24
You'll need to use it in the on_mouse_click function: check if there's a hotspot then run the hotspot interaction instead of the object interaction...