Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Vince Twelve on Wed 16/02/2005 13:32:10

Title: Many many animated cursors
Post by: Vince Twelve on Wed 16/02/2005 13:32:10
I looked around for a bit.  Sue me if it's been covered.

I'd like for my cursor to change to a short (usually only 2 frame) animation when you mouse over any hotspot or item.  I know how to do this, simply creating a cursor mode that animates with a set view.  My problem is that each object and hotspot has its own cursor animation that gives some idea of what you're about to do with that object.

Hypothetical examples:  mouse over a button, you see a finger pressing a button.  Mouse over a dog, you see a hand petting a dog.  Pick up your inventory key and mouse over a lock, you see the lock fitting in the keyhole... etc.

The problem I have is that I'd like to have more cursor anims than I have cursor modes.  If I can only have 20 cursor modes, and there is no way to change the cursor's animation view in script... does this mean I can only have a maximum of 20 cursor animations?  Or is there a way to change the cursor's view in script that I can't find?

This probably hasn't been a problem before because no one is crazy enough to make that many cursor anims.  Well... I am that crazy, and it is a problem.
Title: Re: Many many animated cursors
Post by: Scummbuddy on Wed 16/02/2005 14:24:11
ChangeCursorGraphic
ChangeCursorGraphic (int mode, int slot)

Changes mouse cursor mode MODE's cursor graphic to SLOT. This permenantely changes the specified mode's cursor graphic. This function may be useful if you need more than the maximum number of mouse cursors.
Example:

ChangeCursorGraphic (MODE_LOOK, 120);

will change the cursor's graphic for look mode to the image that's imported in the sprite's manager slot 120.
---------------------------

Now, if you really need more than 20 or whatever the current max is, and you start your game and actually make your 20 and need more, then Pumaman will bump up the maximums for you and release a new version with the increased amount. Its just that he wants to make sure that its worth him doing.
Title: Re: Many many animated cursors
Post by: Vince Twelve on Wed 16/02/2005 14:39:22
Quote from: Scummbuddy on Wed 16/02/2005 14:24:11
ChangeCursorGraphic (MODE_LOOK, 120);

will change the cursor's graphic for look mode to the image that's imported in the sprite's manager slot 120.

Right, I'm currently using the ChangeCursorGraphic function as a temporary fix, but my hope was to have animated cursors, and this only changes it to a static sprite.

What would be awesome would be a ChangeCursorView function or something like that...

Quote from: Scummbuddy on Wed 16/02/2005 14:24:11
Now, if you really need more than 20 or whatever the current max is, and you start your game and actually make your 20 and need more, then Pumaman will bump up the maximums for you and release a new version with the increased amount. Its just that he wants to make sure that its worth him doing.

Or that would work.  The game is already well underway.  The only thing stopping me from animating the more than twenty cursor graphics, is the fear that I won't be able to use them...
Title: Re: Many many animated cursors
Post by: strazer on Wed 16/02/2005 14:43:39
QuoteWhat would be awesome would be a ChangeCursorView function or something like that...

Yeah, I would like that as well.

For the moment, one could probably code a workaround using ChangeCursorGraphic and rep_ex to manually animate the mouse cursor. But this seems rather messy.
Title: Re: Many many animated cursors
Post by: Vince Twelve on Wed 16/02/2005 14:52:11
Quote from: strazer on Wed 16/02/2005 14:43:39
But this seems rather messy.

Indeed.

If there isn't a tidy scripting workaround here, I'm just going to let the cursors be static images.Ã,  It was only meant to be a simple-get-used-to-AGS-before-moving-on-to-bigger-projects-with-the-engine kind of game, but I'm just such a damn perfectionist that I try to do way more than I need to.

No use in bumping up the number of cursor modes.Ã,  The only reason I'm using more than two in my game is to allow these different animations.Ã,  If you're using cursor modes for the reasons you are supposed to be using cursor modes, there should be no reason to use more than twenty... ever...

But a ChangeCursorView (as well as being able to set a specific loop within that view) would be shiny.
Title: Re: Many many animated cursors
Post by: Pumaman on Wed 16/02/2005 19:24:20
ChangeCursorView sounds a reasonable enough request to me.
Title: Re: Many many animated cursors
Post by: Proskrito on Wed 16/02/2005 21:09:20
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=13321.msg159936#msg159936
fine, cj. you never take my words seriously.  :'(

(means that i second that ; ) )
Title: Re: Many many animated cursors
Post by: strazer on Wed 16/02/2005 21:16:27
Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=506
Title: Re: Many many animated cursors
Post by: Vince Twelve on Wed 16/02/2005 22:06:31
Huzzah!  Thanks.