I need help making a working button tapping event. i want an event that last for a few seconds and tapping X really fast would increase a counter. the one i made doesnt last for the correct amount of time and sometimes doesnt register the x button. i put button input for 1f and made it repeat 60 times so its supposed to last 2 seconds but it was more like 6 seconds when i tested it. sometimes when i press X it wouldnt count it at all in the counter.
Announcement
Collapse
No announcement yet.
Button Tapping Event
Collapse
X
-
pooping11Tags: None
-
Re: Button Tapping Event
Okay, I'm not sure if this'll work (haven't tested it), but it should.
Make 3 scripts. I'll call them "ButtonPress", "Timer", and "The Other Script"
In the "Button Press" script, put these lines.
Script Branch: Repeat (Flag: Temp Flag 9 is OFF)
Input Buttons: Constant Wait
Script Branch: Condition (Temp Flag 9 is OFF)
Script Branch: Condition (User Button=[Whatever X is])
Data: Variable ([Your Counter]=[Your Counter]+1)
Script Branch: End Condition
Script Branch: End Condition
Script Branch: End Repeat
Now, in the "Timer" script, put these lines.
Wait: 60F
Data:Flag (Temp Flag 9=ON)
[Whatever you want to happen when it ends]
Finally, in "The Other Script" should go these lines.
Script: Apply Together
Script: Call Script "Button Press"
Script Call Script "Timer"
Script Branch: Repeat (Flag: Temp Flag 9 is OFF)
Script Branch: End Repeat
The script called "The Other Script" will be the one that goes in the event, by the way. If it doesn't work, then say so and I'll try again.Last edited by DYRE; 07-06-2006, 12:25 PM..
-
pooping11 -
Re: Button Tapping Event
Well, I must have done something wrong. Other than saying Temp Flag 9=OFF instead of ON in the second script, though, I can't see what it was. Sorry, I'll get to work on finding another way.
EDIT: I edited my script in my previous post.Last edited by DYRE; 07-06-2006, 12:24 PM..
Comment
-
pooping11
Re: Button Tapping Event
The event still wont even start. Im 100% sure I have everything set up right.
edit: I just got it to work. it works perfectly. for some reason it wont work when i call both scripts in a third script and apply them together. heres how I did it.
Script: Apply Together
Script Call Script "Timer"
Script Branch: Repeat (Flag: Temp Flag 9 is OFF)
Input Buttons: Constant Wait
Script Branch: Condition (Temp Flag 9 is OFF)
Script Branch: Condition (User Button=[Whatever X is])
Data: Variable ([Your Counter]=[Your Counter]+1)
Script Branch: End Condition
Script Branch: End Condition
Script Branch: End Repeat
instead of having a third script, i called the "Timer" script at the start of the "Button Press" script and applyed them together. Thanks for the help.Last edited by pooping11; 07-06-2006, 05:31 PM.
Comment

Comment