ID:168824
Aug 22 2005, 7:55 pm
|
|
How would I make a combo proc that works as you click the correct combination? For example, I have on screen objects and if you were to click.. obj/right & obj/up the expected sequence would happen. Like a proc would be called if done correctly, but if it's the wrong combo, it would not do anything.
|
Aug 26 2005, 1:19 pm
|
|
I could make something like that for you but contact me first, Aim=Same as my key..
|
Variables are a way to go.
Overwrite Click() on the objs and if the variable hasn't been set to 1, set it to 1, then after that make a proc with if() checks. Ex: obj -Sin() |
In response to Sinoflife
|
|
Sinoflife wrote:
Variables are a way to go. Well, your method fails on a few points, notably being that sequence--an important aspect of any combo system--is never taken into account. For a proper combo system you basically want to work with either strings or lists; I recommend strings. For example, on each control you could add a letter or word (for words, usually with a separator like - after each) to the string. Then a proc must be called which checks to see if any valid combo begins with that sequence, or if that sequence completes a combo. If a combo is already complete, perform it and clear the string. If a combo is not complete but this sequence is the beginning of one, do nothing. However if no further controls are pressed for a certain period, you may want to perform the last single action in the sequence (i.e., up or right or what have you). If the sequence is not part of a combo, then you should perform either all individual actions in the sequence, or just the last one, and then clear the string. OR, you can perform all or the last (or none) of all previous actions, and then leave the string with only the most recent action intact. A third option, probably the best, is to perform the first individual action in the sequence, and then repeat the test for a possible combo opener. I.e., if you press up, left, right--and up-left-something is a combo, but up-left-right is not--then you can perform just up, and then retest left-right to see if it begins a combo or is one itself. Lummox JR |