Need help creating a simple script for Kar98 on MW

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

Need help creating a simple script for Kar98 on MW

Postby Mr.robot » Thu Jan 09, 2020 3:02 pm

Hello,

Can you please help me creating this script for the Kar 98 on MW...

Start watching at 1:34



Big thx in advance
User avatar
Mr.robot
Sergeant
Sergeant
 
Posts: 8
Joined: Sun Jul 28, 2019 10:17 am

Re: Need help creating a simple script for Kar98 on MW

Postby J2Kbr » Thu Jan 09, 2020 10:55 pm

I could not hear the audio where I am at the moment, but watching the video it seem to be Quick-Scope. This mod is available in the MW Gamepack and possible on others user's scripts.
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 help creating a simple script for Kar98 on MW

Postby Mr.robot » Thu Jan 09, 2020 11:36 pm

Nope, it's not... it's a reload then cancel just after every shot... this help to reduce a lot the animation after each shot
User avatar
Mr.robot
Sergeant
Sergeant
 
Posts: 8
Joined: Sun Jul 28, 2019 10:17 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mad » Fri Jan 10, 2020 1:50 am

Mr.robot wrote:Nope, it's not... it's a reload then cancel just after every shot... this help to reduce a lot the animation after each shot

For the Kar98 with the attachments, he shoots, releases and hits reload. When the scope comes back he hits the fire trigger again.

Based on that, here is a script. Make sure you use the same attachments and you'll need to adjust scope_time as I don't have the game to test.
Code: Select all
#include <xb1.gph>
 
#define scope_time 150 // the time it takes for the characters hand the reach the back of the gun after hitting reload.
 
main {
    if(event_release(XB1_RT)) combo_run(Kar98);
}
 
combo Kar98 {
    set_val(XB1_X, 100);
    wait(60);
    wait(scope_time);
    set_val(XB1_RT, 100);
    wait(60);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mr.robot » Fri Jan 10, 2020 2:25 am

it's working... Thank you very much
If not too much, can you create another script for the AX-50? it is the first part of the video ( starting at 0:35 )
Big thx again, you made my day
User avatar
Mr.robot
Sergeant
Sergeant
 
Posts: 8
Joined: Sun Jul 28, 2019 10:17 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mad » Fri Jan 10, 2020 2:47 am

Code: Select all
#include <xb1.gph>
 
#define scope_time 150 // the time it takes for the characters hand the reach the back of the gun after hitting reload.
 
//#define KAR98 // uncomment for Kar98
 
main {
    if(event_release(XB1_RT)) {
        #ifdef KAR98
        combo_run(Kar98);
        #else
        combo_run(AX50);
        #endif
    }
 
}
 
combo Kar98 {
    set_val(XB1_X, 100);
    wait(60);
    wait(scope_time);
    set_val(XB1_RT, 100);
    wait(60);
}
 
combo AX50 {
    set_val(XB1_LB, 100);
    wait(60);
    set_val(XB1_LB, 100);
    wait(60);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mr.robot » Fri Jan 10, 2020 2:57 am

Mad wrote:
Code: Select all
#include <xb1.gph>
 
#define scope_time 150 // the time it takes for the characters hand the reach the back of the gun after hitting reload.
 
//#define KAR98 // uncomment for Kar98
 
main {
    if(event_release(XB1_RT)) {
        #ifdef KAR98
        combo_run(Kar98);
        #else
        combo_run(AX50);
        #endif
    }
 
}
 
combo Kar98 {
    set_val(XB1_X, 100);
    wait(60);
    wait(scope_time);
    set_val(XB1_RT, 100);
    wait(60);
}
 
combo AX50 {
    set_val(XB1_LB, 100);
    wait(60);
    set_val(XB1_LB, 100);
    wait(60);
}


Thank you very much :joia:
User avatar
Mr.robot
Sergeant
Sergeant
 
Posts: 8
Joined: Sun Jul 28, 2019 10:17 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mad » Fri Jan 10, 2020 3:05 am

No problem, Modified it to left trigger + dpad down to switch between kar98/ax50.

By default it will be on kar98.
Code: Select all
#include <xb1.gph>
 
#define scope_time 150 // the time it takes for the characters hand the reach the back of the gun after hitting reload.
 
bool sniper;
 
main {
    if(is_active(XB1_LT) && event_active(XB1_DOWN)) sniper = !sniper;
 
    if(event_release(XB1_RT)) {
        if(!sniper) combo_run(Kar98);
        else combo_run(AX50);
    }       
}
 
combo Kar98 {
    set_val(XB1_X, 100);
    wait(60);
    wait(scope_time);
    set_val(XB1_RT, 100);
    wait(60);
}
 
combo AX50 {
    set_val(XB1_LB, 100);
    wait(40); wait(40);
    set_val(XB1_LB, 100);
    wait(40);
}
 
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Need help creating a simple script for Kar98 on MW

Postby Spartan » Tue Jan 28, 2020 11:55 pm

@mad, hi
im conpletely new to all this , my question is im using a ps4 and notices the script was made for xbox one, so do i change everything thats xbox realated to ps or this would work okay as it is? thanks in advance
User avatar
Spartan
Private First Class
Private First Class
 
Posts: 3
Joined: Tue Jan 28, 2020 1:26 am

Re: Need help creating a simple script for Kar98 on MW

Postby Mad » Wed Jan 29, 2020 12:24 am

Spartan wrote:@mad, hi
im conpletely new to all this , my question is im using a ps4 and notices the script was made for xbox one, so do i change everything thats xbox realated to ps or this would work okay as it is? thanks in advance

Welcome :smile0201:

The buttons are the exact same so no need to change.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 86 guests

cron