Canceling Mouse Clicks

Started by Rainbow Guy, Sat 14/08/2004 00:00:01

Previous topic - Next topic

Rainbow Guy

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 )

Goot

You coudl try putting Wait(1); after process click.
What do you mean by 'it passes 0 to process click'?

Rainbow Guy

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


Scorpiorus

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.

Phemar


If I want to make something run after my ProcessClick function in on_mouse_click I usually put it in repeatedly_execute.

Ishmael

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
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk