Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Rainbow Guy on Sat 14/08/2004 00:00:01

Title: Canceling Mouse Clicks
Post by: Rainbow Guy on Sat 14/08/2004 00:00:01
I'm not sure where to start on this one, but here goes,
I'm creating a GUI (we all do ) but have run into a wierd problem, i have this script :-


else if (GetGlobalInt(10) > 5 ){Ã,  Ã,  Ã, 
Ã,  ProcessClick( mouse.x,mouse.y, 8 );
Ã,  SetCursorMode(MODE_WALK);
Ã,  StrFormat ( output, "Walk To 2 @OVERHOTSPOT@" );
Ã,  SetLabelText (0, 11,output);
Ã,  SetGlobalInt (10,0);Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, ***this is the problem line***
Ã,  Display("222");


when the Else If statement "runs" it seems to process down to the SetGlobal statement before doing the Process Click, how can i make the program "wait" until the Process Click has finished, or can't i ?
Ã,  }

( if i take this line out with // it works. If i leave it in it passes 0 to Process Click )
Title: Re: Canceling Mouse Clicks
Post by: Goot on Sat 14/08/2004 06:58:25
You coudl try putting Wait(1); after process click.
What do you mean by 'it passes 0 to process click'?
Title: Re: Canceling Mouse Clicks
Post by: Rainbow Guy on Sat 14/08/2004 08:38:57
The first two lines are :-

else if (GetGlobalInt(10) > 5 ){         //so global(10) has to be greater than 5 right
  ProcessClick( mouse.x,mouse.y, 8 );

but if you put a Display("%d", GetGlobalInt(10)); in the first line of usermode1 ( where the ProcessClick points to) it come out as "0"  :o

Title: Re: Canceling Mouse Clicks
Post by: Scorpiorus on Wed 01/09/2004 18:20:56
Due to the fact that AGS can only run one script at a time your usermode1 runscript option's script is delayed till the other one (on_mouse_click) finishs executing. Thus, it calls script after on_mouse_click returns control and not at a time of calling ProcessClick. It will work fine though, if you use other Interaction Editor's actions rather than the RunScript one.
Title: Re: Canceling Mouse Clicks
Post by: Phemar on Fri 03/09/2004 05:25:26

If I want to make something run after my ProcessClick function in on_mouse_click I usually put it in repeatedly_execute.
Title: Re: Canceling Mouse Clicks
Post by: Ishmael on Fri 03/09/2004 08:32:23
When I think of "Cancelling mouse clicks" I think of something I have done, take a look at the thead linked in my siganture, it's hard to miss the big banner, or just see here: http://koti.mbnet.fi/tk-/files/MRC2_TechDemo09.zip