Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Wretched on Tue 03/05/2005 17:32:04

Title: v2.7 mouse.x
Post by: Wretched on Tue 03/05/2005 17:32:04
mouse.x is changing through the script. I think this function is not working properly. It says in the help that it should be the value when the script is started, however it seems to be changing through the script. Has this changed or is the help file incorrect?
Title: Re: v2.7 mouse.x
Post by: strazer on Tue 03/05/2005 17:44:30
Hm, I think while the script runs the mouse coordinates should not be updated unless you let the game advance some game loops by using the Wait function.

Can you please post an example script?
Title: Re: v2.7 mouse.x
Post by: Wretched on Tue 03/05/2005 17:57:28
Sufficient to say I have a MoveCharacterBlocking() function and a DisplaySpeech() function before I test mouse.x, but I'm sure this is behaving differently to how it did in v2.6. I've tested both builds and the mouse.x is changing in 2.7.
Title: Re: v2.7 mouse.x
Post by: strazer on Tue 03/05/2005 18:07:56
MoveCharacterBlocking(EGO, 100, 150) is a short version of


MoveCharacter(EGO, 100, 150);
while(character[EGO].walking) Wait(1);


thus because of the Wait the game runs in the background and the mouse coordinates are updated.

Quote
I've tested both builds and the mouse.x is changing in 2.7.

As it should be.

Btw, unlike AGS v2.62, in AGS v2.7 the mouse coordinates are updated before each call to repeatedly_execute_always:

Quote from: Pumaman on Sat 13/11/2004 21:02:00
* The mouse.x/y variables are now updated for rep_exec_always.
Title: Re: v2.7 mouse.x
Post by: Wretched on Tue 03/05/2005 18:55:43
Ok that's fine it was not the neatest bit of code and easily changed. Maybe you could make this a bit more clear in the help file which specifically states;

Quotemouse.x - Mouse X co-ordinate when the script was started (320-res).
Title: Re: v2.7 mouse.x
Post by: Pumaman on Tue 03/05/2005 20:34:38
Ah, because 2.7 now updates it before rep_exec_always calls, this effectively means that if you have any Wait() or blocking calls in your script, it will now get updated where it didn't before. I'll re-word the manual accordingly.