Need a way to auto-run in Kingdom Come Deliverance

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

Need a way to auto-run in Kingdom Come Deliverance

Postby Sparky101 » Sat Nov 03, 2018 1:37 pm

Hi folks

So I have Kingdom Come Deliverance on PS4, and there isn't an auto-run feature. I'd really appreciate some help on how to implement this.

To run, one must push the left stick forwards and hold the Circle button.

After about 10-15 secs stamina is depleted so one must either stop walking or, more usually, just walk for a about 4-6 seconds (push the left stick forwards without holding the Circle button).

One option to code for this would be for T2 to handle event when Circle button held for more than, say 0.5 secs (probably best to make this a variable) then T2 will output Circle hold and L stick forwards.

This would be helpful, but it would be even better if, while holding Circle, one could override the L stick direction (by using it briefly) and the T2 allowing this override, but then T2 outputting forwards motion on L stick otherwise...

Thanks in advance :-D
User avatar
Sparky101
Command Sergeant Major
Command Sergeant Major
 
Posts: 114
Joined: Sun Sep 24, 2017 11:54 am

Re: Need a way to auto-run in Kingdom Come Deliverance

Postby J2Kbr » Tue Nov 06, 2018 9:58 am

Hopefully this will do what was described. :smile0517:
Code: Select all
bool autorun_toggle;
 
main {
    if(autorun_toggle) {
        if(event_active(BUTTON_15)) {
            autorun_toggle = FALSE;
        } else {
            // then T2 will output Circle hold and L stick forwards.
            // This would be helpful, but it would be even better if, while
            // holding Circle, one could override the L stick direction (by
            // using it briefly) and the T2 allowing this override, but then T2
            // outputting forwards motion on L stick otherwise...
            set_val(BUTTON_15, 100.0);
            set_val(STICK_2_Y, -100.0);
        }
    } else if(get_val(BUTTON_15) && time_active(BUTTON_15) > 500) {
        // One option to code for this would be for T2 to handle event when Circle
        // button held for more than, say 0.5 secs (probably best to make this a variable)
        autorun_toggle = TRUE;
    }
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Need a way to auto-run in Kingdom Come Deliverance

Postby Sparky101 » Wed Nov 07, 2018 1:52 pm

Thanks J2Kbr! This script works BRILLIANTLY! :smile0517:
User avatar
Sparky101
Command Sergeant Major
Command Sergeant Major
 
Posts: 114
Joined: Sun Sep 24, 2017 11:54 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: trezor and 179 guests