Author |
Topic |
|
wawsxxwa
1 Posts |
Posted - 01/26/2013 : 12:21:09
|
im pretty terrible at scripting, but i managed to come up with a script for firing commands based on the distance traveled by the gesture. this script won't be useful for gestures that start and end at the same point, like "O", "D", "UpDown" and so on. still, for simple directional gestures it works well enough. the main drawback ive noticed so far is that you have to eyeball the distance traveled since the stroke line is the only feedback you get while drawing. id love for the line to change color based on stroke length as you're drawing it, but oh well.
the example below is for a gesture that draws to the left, so i'm subtracting the ending x coordinate of the gesture from the starting x coordinate. when customizing just check your gesture's starting and ending points, and change "local dist = sx - ex" to fit your needs. clunky, i know. the rest should be self explanatory, but if you have any questions let me know.
anyway, feedback welcome. like I mentioned, i'm terrible at scripting, and i'm sure there are better ways of handling things.
local sx = sp_gesture_start_x local sy = sp_gesture_start_y local ex = sp_gesture_end_x local ey = sp_gesture_end_y local dist = sx - ex if dist < 60 then acDisplayText("wth not even 60, come on guy!", "Arial", 76, 0, 0, 0, 1000, 500, 400) elseif dist < 200 then acDisplayText("less than 200 duder, gotta push it.", "Arial", 76, 0, 0, 0, 1000, 500, 400) elseif dist < 400 then acDisplayText("less than 400 chief, not good enough.", "Arial", 76, 0, 0, 0, 1000, 500, 400) elseif dist < 600 then acDisplayText("pushing 600 bro, superproud of you bro!", "Arial", 76, 0, 0, 0, 1000, 500, 400) elseif dist > 600 then acDisplayText("600+!! BEEFCAKE! BEEFCAKE!!!", "Arial", 96, 255, 0, 0, 1000, 500, 400) end
|
Edited by - wawsxxwa on 01/26/2013 13:34:23 |
|
Rob
USA
2615 Posts |
Posted - 01/30/2013 : 22:29:48
|
Looks pretty good to me! When it comes to scripting, there's always something that someone else would do differently. This will probably be very useful for some folks.
Thanks! |
|
|
iyhk
8 Posts |
Posted - 05/25/2013 : 00:01:19
|
you can use gbr gbl gbb gbt local dist = gbr- gbl + gbb - gbt |
|
|
|
Topic |
|
|
|