Help trying to understand GPC
9 posts
• Page 1 of 1
Help trying to understand GPC
GAME: RAINBOW 6 SIEGE
I was just wondering how I would write a script for a more reliable lean on siege
I was just wondering how I would write a script for a more reliable lean on siege
-
GPCNoob - Staff Sergeant
- Posts: 14
- Joined: Wed Nov 25, 2020 2:24 am
Re: Help trying to understand GPC
Here is a copy of the Auto Lean Mod we have on the R6S Gamepack, hope it helps.
- Code: Select all
int8 lean_direction;
main {
// Auto Lean
if(get_val(BUTTON_5)) {
if(!lean_direction) {
if(get_val(STICK_2_X) > 19.0) {
lean_direction = 1;
combo_run(AutoLean);
} else if(get_val(STICK_2_X) < -19.0) {
lean_direction = -1;
combo_run(AutoLean);
}
}
} else if(event_release(BUTTON_5)) {
lean_direction = 0;
}
}
combo AutoLean {
set_val((lean_direction == 1) ? BUTTON_6 : BUTTON_9, 100.0);
wait(100);
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Help trying to understand GPC
J2Kbr wrote:Here is a copy of the Auto Lean Mod we have on the R6S Gamepack, hope it helps.
- Code: Select all
int8 lean_direction;
main {
// Auto Lean
if(get_val(BUTTON_5)) {
if(!lean_direction) {
if(get_val(STICK_2_X) > 19.0) {
lean_direction = 1;
combo_run(AutoLean);
} else if(get_val(STICK_2_X) < -19.0) {
lean_direction = -1;
combo_run(AutoLean);
}
}
} else if(event_release(BUTTON_5)) {
lean_direction = 0;
}
}
combo AutoLean {
set_val((lean_direction == 1) ? BUTTON_6 : BUTTON_9, 100.0);
wait(100);
}
Holy guacamole I never thought you would reply to one of my posts!! Lmao thanks for the code man sorry to waste more of your time, but how would I make a script where when I press L2 the L3 + R3 wait 10ms before I am able to press them? I really wish I could just understand the code haha.. so I wouldn’t need to ask questions it’s probably an easy answer
-
GPCNoob - Staff Sergeant
- Posts: 14
- Joined: Wed Nov 25, 2020 2:24 am
Re: Help trying to understand GPC
The inhibit command would work fine for that purpose.
-
SirBrass - First Sergeant
- Posts: 55
- Joined: Sat Dec 05, 2020 3:47 am
Re: Help trying to understand GPC
if(get_val(debug_L2)) {
inhibit(debug_R3, 25);
}
this works amazing but after the 25ms, how would I stop it? right now it blocks the knife animation as is. but you are still in ads every 25ms the right lean feels kinda wonky is there another code to remove inhibit????
inhibit(debug_R3, 25);
}
this works amazing but after the 25ms, how would I stop it? right now it blocks the knife animation as is. but you are still in ads every 25ms the right lean feels kinda wonky is there another code to remove inhibit????
-
GPCNoob - Staff Sergeant
- Posts: 14
- Joined: Wed Nov 25, 2020 2:24 am
Re: Help trying to understand GPC
Inhibit times out on its own by useage of the number used as the 2nd argument for inhibit
-
SirBrass - First Sergeant
- Posts: 55
- Joined: Sat Dec 05, 2020 3:47 am
Re: Help trying to understand GPC
J2Kbr wrote:Here is a copy of the Auto Lean Mod we have on the R6S Gamepack, hope it helps.
- Code: Select all
int8 lean_direction;
main {
// Auto Lean
if(get_val(BUTTON_5)) {
if(!lean_direction) {
if(get_val(STICK_2_X) > 19.0) {
lean_direction = 1;
combo_run(AutoLean);
} else if(get_val(STICK_2_X) < -19.0) {
lean_direction = -1;
combo_run(AutoLean);
}
}
} else if(event_release(BUTTON_5)) {
lean_direction = 0;
}
}
combo AutoLean {
set_val((lean_direction == 1) ? BUTTON_6 : BUTTON_9, 100.0);
wait(100);
}
Can I add this code to an already existing GPC?
-
holdinweight - Sergeant First Class
- Posts: 25
- Joined: Tue May 21, 2019 3:47 pm
Re: Help trying to understand GPC
holdinweight wrote:Can I add this code to an already existing GPC?
Yes copy it straight to the bottom of the script.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Help trying to understand GPC
is there any way i can get this code to switch lean from left to right whenever i move the analog. it doesnt switch but only does the initial lean to whatever side a move towards until i let go of LB(button 5) and press it again. thats a pain.
-
holdinweight - Sergeant First Class
- Posts: 25
- Joined: Tue May 21, 2019 3:47 pm
9 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: midg3t2 and 101 guests