New feature for keyboard users - I call it Crouch Limiter!

GPC2 script programming for Titan Two. Code examples, questions, requests.

New feature for keyboard users - I call it Crouch Limiter!

Postby pablosscripts » Wed Dec 05, 2018 6:03 am

This is another stupidly simple idea like my Grenade Overcook Protection one, but I'm loving it! I don't know if this is an entirely unique idea but anyway thought I'd share it as I recently incorporated this into my Siege script and after some play testing, I don't think I could go back now!

What this does is, for games that use the same button for both crouch and prone (which is most games), it decouples them...so holding down the crouch button for a bit longer no longer makes you go prone. Instead, if you want to go prone, I've created a totally separate dedicated prone button...just like how 99% of PC games are designed. This makes crouching more reliable, as I find time-based inputs very inconsistent. This is why you'll rarely find timing-based features in my script because I hate them! In the heat of a battle you will not be able to reliably press a button for 100ms vs 200ms, for example. When you're playing a game like Siege, there's no scope for errors.

The implementation is so simple:

1) For native kb users, take a key as an input for proning, then limit crouch by using the time_active function.

E.g.
Code: Select all
// Proning code
/* a bit of code here to take native kb input for proning */
 
// Crouch Limiter code
if(time_active(CROUCH) > 40) {
   set_val(CROUCH, 0);
}
 
2) For XIM kb users, dual map two random buttons and create a prone function, then limit crouch by using the same technique in #1.
 
E.g.
 
// Proning code
// this is a technique I call "dual mapping", let me know if you'd like to learn more I've posted about this before
if(randomButtonX && randomButtonY) {
   block X and Y
   prone combo
}
 
// Crouch limiter code
if(time_active(CROUCH) > 40) {
   set_val(CROUCH, 0);
}

I can't believe it's taken me so long to think of this but I can't go without it now! Feels so much better to play this way.
Last edited by pablosscripts on Wed Dec 05, 2018 6:36 am, edited 1 time in total.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby bonefisher » Wed Dec 05, 2018 6:35 am

Code: Select all
 
if(check_active(BUTTON_15, 40)){
        set_val(BUTTON_15, 0.0);
    }
 

Also can use this!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby pablosscripts » Wed Dec 05, 2018 6:37 am

bonefisher wrote:
Code: Select all
 
if(check_active(BUTTON_15, 40)){
        set_val(BUTTON_15, 0.0);
    }
 

Also can use this!


Thank you!

The second piece of this puzzle is then to create a dedicated prone button which I’ve described two techniques for above.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby bonefisher » Wed Dec 05, 2018 7:42 am

Code: Select all
 
if(!is_active(BUTTON_8)){
    if(check_active(BUTTON_15, 40)){set_val(BUTTON_15, 0.0);}}
 
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby Sillyasskid » Wed Dec 05, 2018 8:22 am

pablosscripts wrote:second piece of this puzzle is then to create a dedicated prone button which I’ve described two techniques for above.


so basically this ?

Method 1: GPC keymapping() Script with keyboard plugged into T2.
Code: Select all
#include <keyboard.gph>
 
#define CROUCH_BUTTON BUTTON_15
#define CROUCH_KEY    KEY_C
#define PRONE_KEY     KEY_V
#define CROUCH_LIMIT  100
 
const uint8 kmap[] = {
 CROUCH_KEY, CROUCH_BUTTON,
 PRONE_KEY, CROUCH_BUTTON,
};
 
init {
  keymapping(kmap);
}
main {
  if (check_active(CROUCH_BUTTON, CROUCH_LIMIT)) {
    set_val(CROUCH_BUTTON, key_status(CROUCH_KEY) ? 0 : (int)get_actual(CROUCH_BUTTON));
  }
}


Method 2:
Alternative Input Translator Method. GPC Script with keyboard plugged into T2.
Also works as a GPC Script using a XIM keyboard plugged into Xim
Code: Select all
#define CROUCH_LIMIT  100
#define CROUCH_BUTTON BUTTON_15
 
main {
  // Crouch button should be mapped to d-pad up, and d-pad down using the Input Translator,
  // or Xim Manager, if using a Xim.
  if(is_active(BUTTON_10)&&is_active(BUTTON_11)){
    (set_val(BUTTON_10,0), set_val(BUTTON_11,0));
    set_val(CROUCH_BUTTON, time_active(BUTTON_10) < CROUCH_LIMIT ? 100 : 0);
  }
}
 
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby pablosscripts » Wed Dec 05, 2018 11:16 am

Silly - that’s it!!!
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Brigadier General
Brigadier General
 
Posts: 1976
Joined: Tue Nov 24, 2015 6:27 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby Ximmer 17 » Fri Feb 28, 2020 10:03 am

Hi, New to titan 2 . I feel this trick could be really helpful . I am using xim but kb is connected to T2 . How can I implement this on my config?
I am using a universal gamepack which remains active throughout
User avatar
Ximmer 17
Master Sergeant
Master Sergeant
 
Posts: 30
Joined: Wed Feb 26, 2020 10:11 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby Mad » Fri Feb 28, 2020 10:41 am

Ximmer 17 wrote:Hi, New to titan 2 . I feel this trick could be really helpful . I am using xim but kb is connected to T2 . How can I implement this on my config?
I am using a universal gamepack which remains active throughout

You'd have to create a new script with this feature, however you cannot combine this with a gamepack.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: New feature for keyboard users - I call it Crouch Limite

Postby Ximmer 17 » Fri Feb 28, 2020 11:19 am

Kool ! Thanks for the quick response
User avatar
Ximmer 17
Master Sergeant
Master Sergeant
 
Posts: 30
Joined: Wed Feb 26, 2020 10:11 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 119 guests