Need script to move side to side

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

Need script to move side to side

Postby sofiereg » Tue Jun 19, 2018 12:13 pm

Can someone help me with a script basically I am looking for something where when i press L2 scope in and i should be able to move left and right to avoid getting shot and then when i fire r2 crouch get up move side to sode
User avatar
sofiereg
Sergeant
Sergeant
 
Posts: 6
Joined: Sat Jun 09, 2018 3:59 pm

Re: Need script to move side to side

Postby J2Kbr » Tue Jun 19, 2018 2:01 pm

this should do, please note I assumed the button to crouch is CIRCLE (BUTTON_15). See the comments on the code.
Code: Select all
main {
    // when i press L2 scope in and i should be able to move left and right
    // to avoid getting shot
    if(get_val(BUTTON_8)) {
        combo_run(LeftRight);
    }
    // and then when i fire r2 crouch get up move side to sode
    if(get_val(BUTTON_5)) {
        if(event_active(BUTTON_5) || event_release(BUTTON_5)) {
            combo_run(Crouch);
        }
        combo_stop(LeftRight);
    }
}
 
combo Crouch {
    set_val(BUTTON_15, 100.0);
    wait(50);
}
 
combo LeftRight {
    set_val(STICK_2_X, -100.0);
    wait(200);   
    set_val(STICK_2_X, 100.0);
    wait(200);   
}
 
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 script to move side to side

Postby sofiereg » Thu Jun 21, 2018 2:03 pm

Thank you sir. U r awesome. Is there a way you can create a script for headshots. basically i play sniper elite 4 headhunter
these guys i dont know what they have they just run stop and shoot and it hits headshot
l2 is scope r2 is fire i want something where i can get headshots easily
User avatar
sofiereg
Sergeant
Sergeant
 
Posts: 6
Joined: Sat Jun 09, 2018 3:59 pm

Re: Need script to move side to side

Postby teckx » Sun Jun 24, 2018 1:59 pm

What’s the difference between stick 1 and stick 2?
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Need script to move side to side

Postby J2Kbr » Mon Jun 25, 2018 6:20 am

teckx wrote:What’s the difference between stick 1 and stick 2?

1 is the right stick (usually for aiming), 2 is for the left stick (move).
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 script to move side to side

Postby teckx » Mon Jun 25, 2018 7:16 pm

When I try to make the mouse move by doing somthing like this. It never works. Any idea why I cannot get the mouse to move with a combo ?

combo LeftRight {
Mouse_set(STICK_1_X, -100.0);
wait(200);
Mouse_set(STICK_1_X, 100.0);
wait(200);
}
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Need script to move side to side

Postby Scachi » Mon Jun 25, 2018 7:47 pm

https://www.consoletuner.com/wiki/index ... :mouse_set
https://www.consoletuner.com/wiki/index ... :mouse_gph

I never used the commands to control the mouse, but I am sure that you can't use it with "STICK_1_X".
The links above may help you.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Need script to move side to side

Postby Sillyasskid » Mon Jun 25, 2018 7:54 pm

teckx wrote:When I try to make the mouse move by doing somthing like this. It never works. Any idea why I cannot get the mouse to move with a combo ?

Use MOUSE_X not STICK_1_X.

like so
Code: Select all
#include <mouse.gph>
combo LeftRight {
    Mouse_set(MOUSE_X, -100.0);
    wait(200);   
    Mouse_set(MOUSE_X, 100.0);
    wait(200);   
}
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Need script to move side to side

Postby teckx » Mon Jun 25, 2018 9:23 pm

thank you.. it works!
User avatar
teckx
Sergeant Major of the Army
Sergeant Major of the Army
 
Posts: 194
Joined: Tue Mar 27, 2018 1:53 pm

Re: Need script to move side to side

Postby sofiereg » Mon Jul 09, 2018 2:22 pm

Can some one make a script or game pack for sniper elite. Looking for anti recoil, fast shot,autotag,aim assist. Hold breath or a script where I can get headshots
User avatar
sofiereg
Sergeant
Sergeant
 
Posts: 6
Joined: Sat Jun 09, 2018 3:59 pm

Next

Return to GPC2 Script Programming

Who is online

Users browsing this forum: fox5 and 81 guests