Macros/Modifiers special code
Posted: Wed Jan 09, 2013 12:57 am
Hello Matlo,
First and foremost, happy new year!
Now for some background on why this thread was created.
Recently (with the new year holiday) I've had some additional free time and have started playing some BF3.
I've tried to play jets and have came up with an idea on how to add a particular "probably usefulness" feature to compensate for the way the mouse works.
So I use the mouse to steer the jet but in dogfights I have to switch to keyboard because I can't move the mouse in one direction for an extended period of time.
What I was thinking is a button that while hold would "lock" the value of a stick axis to the max value based on the last direction the mouse was moved.
So picture the scenario when you hold one of the mouse side buttons and slightly move the mouse like you would the stick in one particular direction.
The output would be the highest value for the axis based on the vector the mouse was moved towards, as long as you hold the side button.
You should be able to move the mouse around to change the vector but the vector would always result in the max values for the particular controller stick.
So you can't normally go to the (0,0) value unless you release the key and the input would then be processed normally.
That way you should be able to somewhat effectively dogfight and when you have your enemy in sight you can release the button and fine tune your aim, arguably more so then with the controller joysticks.
A small side note that could be taken into consideration is another feature that would be useful in fighting games. If macros could be processed for specific values based on a specific state.
Ex of a trivial "magic" combo in a fighting game where you need to do: Down + Backwords+ SomeOtherKey, Backwords would change based on the players position (left or right).
It would be nice if you could simplify that action with a macro like this: Forward (assumed direction towards the player) and the MACRO_KEY ex:
MACRO MACRO_KEY
KEYDOWN Down
KEYDOWN {{NotDirection}} // direction would be automatically replaced with the last Direction you've imputed, "NotDirection" would be the oposite direction making "Left" into "Right"
KEYDOWN SomeOtherKey
... ... ...
That would make it simple to execute "smart macros" that modify the output based on the state of the system.
In the scenario presented all I would have to do is push the direction toward the player (the system would store that as the last state) then execute the "smart macros".
--------------
Now for the technical part ... a few questions on how you see this being implemented and other similar questions.
1) mainloop.c, why are there 2 similar files with mostly the same code for linux and windows? I see you've started to refactor/change these quite recently ... wip?
2) can the macro_process() function be called last, or more precisely, after process_event(event) but probably before macro_lookup(event) that way implementing "smart" macros would be possible, it would execute on the most "up to date" state
3) the key that changes the behavior (for BF3 jet fights) can probably be considered a macro? .. but It would be useful if it was called based on a specific active profile (because I would like the side button to not do that if I'm playing infantry not jets). Or probably there should be a execute_modifiers(event) function after all other processes that executes specific behaviors and change the outcome of the system?
4) why is there a core2? Is that an attempt to re-write the core of the application, a major refactoring?
Thank you for your input.
First and foremost, happy new year!
Now for some background on why this thread was created.
Recently (with the new year holiday) I've had some additional free time and have started playing some BF3.
I've tried to play jets and have came up with an idea on how to add a particular "probably usefulness" feature to compensate for the way the mouse works.
So I use the mouse to steer the jet but in dogfights I have to switch to keyboard because I can't move the mouse in one direction for an extended period of time.
What I was thinking is a button that while hold would "lock" the value of a stick axis to the max value based on the last direction the mouse was moved.
So picture the scenario when you hold one of the mouse side buttons and slightly move the mouse like you would the stick in one particular direction.
The output would be the highest value for the axis based on the vector the mouse was moved towards, as long as you hold the side button.
You should be able to move the mouse around to change the vector but the vector would always result in the max values for the particular controller stick.
So you can't normally go to the (0,0) value unless you release the key and the input would then be processed normally.
That way you should be able to somewhat effectively dogfight and when you have your enemy in sight you can release the button and fine tune your aim, arguably more so then with the controller joysticks.
A small side note that could be taken into consideration is another feature that would be useful in fighting games. If macros could be processed for specific values based on a specific state.
Ex of a trivial "magic" combo in a fighting game where you need to do: Down + Backwords+ SomeOtherKey, Backwords would change based on the players position (left or right).
It would be nice if you could simplify that action with a macro like this: Forward (assumed direction towards the player) and the MACRO_KEY ex:
MACRO MACRO_KEY
KEYDOWN Down
KEYDOWN {{NotDirection}} // direction would be automatically replaced with the last Direction you've imputed, "NotDirection" would be the oposite direction making "Left" into "Right"
KEYDOWN SomeOtherKey
... ... ...
That would make it simple to execute "smart macros" that modify the output based on the state of the system.
In the scenario presented all I would have to do is push the direction toward the player (the system would store that as the last state) then execute the "smart macros".
--------------
Now for the technical part ... a few questions on how you see this being implemented and other similar questions.
1) mainloop.c, why are there 2 similar files with mostly the same code for linux and windows? I see you've started to refactor/change these quite recently ... wip?
2) can the macro_process() function be called last, or more precisely, after process_event(event) but probably before macro_lookup(event) that way implementing "smart" macros would be possible, it would execute on the most "up to date" state
3) the key that changes the behavior (for BF3 jet fights) can probably be considered a macro? .. but It would be useful if it was called based on a specific active profile (because I would like the side button to not do that if I'm playing infantry not jets). Or probably there should be a execute_modifiers(event) function after all other processes that executes specific behaviors and change the outcome of the system?
4) why is there a core2? Is that an attempt to re-write the core of the application, a major refactoring?
Thank you for your input.