Hotspot won't work over animated object

Started by remixor, Wed 30/04/2003 09:57:36

Previous topic - Next topic

remixor

Sorry for all the questions in this and my other thread...  I've done more AGS work today than I have been lately, so I've run into proportionally more problems  :-\

I have a clock object in my room flashing 12:00.  On the object I have two interactions in the interaction editor: one that changes the cursor to interact mode when the mouse is over the hotspot, and the other that has the character say a message when the player interacts with it.  It works, but only on the non-animated part of the object for some reason.  The hotspot itself covers the whole image and a slight border just to be sure.  Strangely (at least to me), the cursor changes correctly no matter what part of the hotspot the mouse is over.  The message itself however will only display if I click outside of the center of the object, which is the animated part.  This seems strange because clicking on the edges of the object (or slightly outside of it) works totally correctly.  Is this normal, and if so, how do I work around it?  Thanks for your help.
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers

Gilbert

Hmmm is there transparency inside the object?

remixor

I just realized that in fact the interaction does not work anywhere on the object.  It only works when you click outside of the object's area, but on the hotspot.  I got mixed up because my anchor point on the cursor was off-center.

Gilbert: Yes.  Since it is not a perfectly rectangular clock, the edges are rounded off using transparencies.
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers

Gilbert

I think it's just by design, "interact with hotspots" works whenever the cursor is over the hotspot area, and that when you click (interact) on an object, the event "interact with object" is triggered instead of "interact with hotspot".

So I think the best way to "fix" it is to put that response on "interact with object" instead.

remixor

#4
Thanks for your response, I'll try that right now.  EDIT: it worked   :)

I also have a follow-up question.  It's in my other enormous thread too, but it fits here too.  Is there any way to specify an event when the mouse is over an object?  With hotspots it's just in the interactions menu, but with objects it isn't.  My interface kind of hinges on this being possible, so I'll have to radically change things if it isn't.  Thanks for any possible help.
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers

Gilbert

#5
I think because an object is possibly moving all the time, CJ didn't bother adding a "mouse over object" event. In contrary, as hotspot areas are stationary, you have the event.

In your case, if your object never moves, you can already do what you want with the above trick.

But if your object is not stationary, I think you can only hard script that "mouse over" thingy with text scripting. An example is to put in repeatedly-executed something like:

if (GetObjectAt(mouse.x, mouse.y) == 3) {
// put something here, eg. changing cursor mode, etc.
} else {
//you may need else or else if part if you want to restore something, eg. restoring cursor mode, when the cursor moves away
}

remixor

#6
Thanks again for the response.

I have a question regarding repeatedly execute.  this is a total noob question so bear with me.  Is the repeatedly execute script unique to each room?  If it's not, would the following work?  Or if it is, is this the purpose of header files (which I have never used)?

if (GetLocationType(mouse.x,mouse.y)!=0) {
setCursorMode(2);
}
else {
setCursorMode(0);
}

I basically want this to apply to every hotspot, object, or character in the game, since all interactions use the same cursor.  This would also mean I would not have to have one huge hotspot that covers the background in order to get the cursor to be the walk cursor, right?

Also, is there a way to define an interaction if the user right-clicks a hotspot, character, or object?  I want that to be how the character "looks".
Writer, Idle Thumbs!! - "We're probably all about video games!"
News Editor, Adventure Gamers

Gilbert

It depends on where you put it.

In fact you can have the repeatedly executed function in BOTH the global script of in a local room script.

If the codes are put in the global script, they're executed in ALL rooms, whereas they're only be executed in a room locally if they're put into the room script.


SMF spam blocked by CleanTalk