Within the byond 4.0 release notes there is a part that says....
Keyboard macros support both key presses and key releases. This should make more exotic game controls feasible, but the server will still only respond as fast as every 1/10 second and only as fast as it receives network messages from the client.
Can anyone explain this? whats the purpose, hows it work. etc?
ID:163770
Aug 4 2007, 9:20 am
|
|
You create two macros for a key, say one for space-down, and one for space-up. Keep repeat turned off on both of them.
Then when you press the spacebar, it calls something like StartFiring(). When you let go of the spacebar, it calls something like StopFiring(). Turning on and off stuff like guns like this is often better than rapidly pressing a button to fire a gun. |
In response to Ac19189
|
|
sweet. well how i change it, Do i change it within a verb? or whats the command proc? or hows it done :P.
|
In response to Bladeshifter
|
|
In response to Jon88
|
|
that doesnt really help tho, becuase spacedown and space up are the verb names, but how would it know when to call the space release verb? there has to be like....
mob/verb/space() If i did.... repeat=0 or whatever your saying, wouldnt it just make the verb not be repeatable, how would it know when to call the release of the key? Can i maybe get a simple example? :). |
In response to Ac19189
|
|
ohhh nvm my last post xD
|
In response to Bladeshifter
|
|
There's a checkbox on the macro creation screen for key-up. You make one macro for keydown, and another one with the checkbox for keyup. Each calls a different verb. This way you can tell when someone presses the key and then lets go of it. Good for stuff like shooting a gun, or pulling back the plunger for pinball.
|
In response to Bladeshifter
|
|
ONE more question, is there a var that defines if the key iss pressed down?
for example.. if i wanted to have a weapon charge... while(whatever is pressed) Just an example, but any help? :P. |
In response to Bladeshifter
|
|
No, there isn't. But you can make your own, and set it using the keyup and keydown macros.
|
In response to Jon88
|
|
so how should i do it? When keydown is called by pressing that macro...... what then? i dont think its possible. cus it will just go through the verb only once.... i dont have a var to check if it is or isnt pushed down, And i cant have it repeat if it doesnt know if its pushed in or not :'(
|
In response to Bladeshifter
|
|
OH! i got it nvm, im smart! :). ill just make a var when its pressed and have it keep increasing the var until its released xD.
|
With on press active. When you use a macro say. M to open menu. With on press active as soon as you hit M the menu pops up but if you had it on release you could in theory hold M as long as you wanted an it wouldnt pop up the menu until you left your finger off the M key.
Hope that helps some. o.O