Arrow Key Control

  • benthecrazy
    8th Sep 2013 Member 2 Permalink

    Alright so I think there are many users out there who would like to control their saves by using the arrow keys instead of those chunky and sometimes unreliable STKM-controls including me and ohters who's saves recently reached front page (no names here ;) ).

    So my idea is a single pixel of a new element "CTRL" That creates a usual BRAY with a life of 30 in the direction corresponding to the key that is pressed. The behavior is just like a normal METL+ARAY combination so if the arrow key is held down a BRAY with a life of 30 is created and once it has faded out the next BRAY in that direction can be created. If you have the combination CTRL+FILT a new BRAY is created every 8 frames and if you hold down the arrow key the solid BRAY builds up just like the combination METL+ARAY+FILT.

    At the moment I'm not sure whethter or not it should be possible the create two BRAYs in different directions at the same time but I think this would require just more electronics to handle the input so as one BRAY has been created there can't be a nother one created the folling 7 frames regardles of the direction. That way if we have the combination CTRL+FILT+METL and the arrow key is pressed down the METL is sparked every 8 frames.

    Everyone please feel free to make suggestions, you are always welcome!

  • boxmein
    8th Sep 2013 Former Staff 0 Permalink
    Edited once by boxmein. Last: 8th Sep 2013
  • benthecrazy
    8th Sep 2013 Member 0 Permalink

    Of course KSNS gives you much more possibilities but I think this would be easier to code than KSNS and you wouldn't have the problem of pressing the ctrl-key to use hotkeys. 

  • arK
    8th Sep 2013 Member 0 Permalink

    Good idea (it was suggested previously AFAIK), STKM is very unreliable.

     

    I think WASD support for CTRL (with tmp=1 for example) would be nice (since we have STKM2 with WASD controls).

     

    However, I think there is even more general solution: CTRL with tmp=key_code will spark things around it when key_code key is pressed. For example: CTRL with tmp=120 will spark things when "x" is pressed on keyboard. You can find key codes with LUA or show dialog asking you to press a key when placing CTRL. That would be awesome, think of an ARAY typewriter or calculator controlled with your real keyboard :D

     

    UPD

     

    > http://pastebin.com/xgfe6Vc8

    Yep, that's it.

    Edited once by arK. Last: 8th Sep 2013
  • NF
    8th Sep 2013 Member 0 Permalink

    @benthecrazy (View Post)

     Also I've have to admit its a good idea.

  • Pilihp64
    8th Sep 2013 Developer 0 Permalink

    Keyboard access is exactly what Lua scripts are for, boxmein's example is perfect for what you want.  But it is only one example of what you could do with the api, instead of having an element spark something, you could make a script behave specifically for a save that does exactly what you want on any keypress.  Something similar is the 'control tron' script I made, which takes keypresses and controls TRON particles directly (it might not work anymore).

  • boxmein
    8th Sep 2013 Former Staff 0 Permalink
    @cracker64 (View Post)
    There is the downside that saves cannot rely on Lua scripts whatsoever.

    /me is still waiting for the script repo and/or alternate solutions
    edit: /me is no longer waiting
    Edited 2 times by boxmein. Last: 8th Sep 2013