1 question (SOLVED), and 2 suggestions

Started by Nine Toes, Sat 16/04/2005 08:38:00

Previous topic - Next topic

Nine Toes

I've got this code, see... I've tried putting it everywhere else, but it never seems to work.  So I'm stuck placing it under repeatedly_execute AFAIK.

Code: ags

if (GetCharacterAt(mouse.x, mouse.y)==1){
  SaveCursorForLocationChange();
  SetCursorMode(8);
  }


Basically, what the code does, it makes it so that when you move the mouse cursor over a certain character, the mouse cursor will change to mode 8 (which I'm using as an interaction EXCLUSIVE for the character), and when you move the mouse cursor off of the character, it will revert back to the cursor mode you were using before you moved the cursor over the character in the first place.

Now, the code works just fine, but sere's my problem... Any animated mouse cursors (mode 8 cursor, in this case) will not animate (which isn't really a big deal, but if it doesn't animate, it won't fit in with the whole theme of the game).

Can anybody suggest a different way of doing this, as far as programming mouse-over scripts for characters, and objects?  I didn't see any "Mouse moves over character", or "mouse moves over object" (in "objects" under "room editor") in the interaction editors.  ...that was my first suggestion...

The other suggestion:
1. I'd like to suggest the possibility of choosing which LOOP to use when assigning a view for an animated mouse cursor.  Merely for the sake of preserving game resources.  I think you're only allowed about, what, 200 views in ags, and in the little project I'm working on now, I've got about 10+ animated mouse cursors.  I know it's kinda stupid, but I just figured I'd suggest it.
Watch, I just killed this topic...

strazer

The problem is probably that the mouse cursor is set repeatedly, thus always re-displaying the first frame of the view. Try this:

Code: ags

  if ((GetCharacterAt(mouse.x, mouse.y) == 1) && (GetCursorMode() != 8) {
    SaveCursorForLocationChange();
    SetCursorMode(8);
  }


There are already two tracker entries for your suggestions:
- "Mouse moves over object" event (guess we need one for characters too)
- Allow mouse cursor loop choice

Nine Toes

Cool.  Thank you.  Once I get home, I'll try it out and let you know how it works. :)

So the "mouse moves over ______" is scheduled to be put in the interaction editors for room objects and characters, cool.

I take it that the command to set the loop for mouse cursors is a no, then?
Watch, I just killed this topic...

strazer

QuoteI take it that the command to set the loop for mouse cursors is a no, then?

That's up to CJ, let's see what he says.
Personally, I'd like that, but it depends on how much trouble it is to implement. I guess choosing the loop could be done with an (optional) parameter for Mouse.ChangeModeView.
Btw, the view limit has been increased from 400 in AGS v2.62 to 600 in v2.7.

Pumaman

Yes, specifying the loop for mouse cursor animations has been on the to-do list for a while now. It's actually more complicated than it sounds, due to a bit of an oversight in the way mouse cursors were originally implmeneted, but yes it's something I'd like to fix at some point.

Nine Toes

Cool.  :)  But trust me, when it comes to programming, everything sounds kinda complicated. ;)

Thank you for answering my questions, gentlemen.

BTW, Strazer, the code works great now.  No problems here.  Thanks for your help.
Watch, I just killed this topic...

strazer

Thanks for letting me know. Glad I could help. :)

SMF spam blocked by CleanTalk