Programming Help Needed (Combo)
10 posts
• Page 1 of 1
Programming Help Needed (Combo)
I need helping finishing this combo because it won't work properly for me. In words, when i hold P1 and press X i want to do the following:
and when I release the X button, i would like for the combo to release RY -100. can someone help me?
- Code: Select all
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, -100.0);
and when I release the X button, i would like for the combo to release RY -100. can someone help me?
-
riribibi - Command Sergeant Major
- Posts: 134
- Joined: Fri Oct 31, 2014 12:33 pm
Re: Programming Help Needed (Combo)
Not sure if I followed correctly:
Or do you just want P1+X to hold RY -100 until release?
- Code: Select all
#include <xb1.gph>
main {
if(is_active(XB1_P1)) {
if(is_active(XB1_X)) {
combo_run(myCombo);
}
}
}
combo myCombo {
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, -100.0);
wait(30);
}
Or do you just want P1+X to hold RY -100 until release?
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Programming Help Needed (Combo)
yes i just want P1+X (after running the initial part) to hold RY -100 until release
and thank you very much for your help
and thank you very much for your help
-
riribibi - Command Sergeant Major
- Posts: 134
- Joined: Fri Oct 31, 2014 12:33 pm
Re: Programming Help Needed (Combo)
Try this:
- Code: Select all
#include <xb1.gph>
main {
if(is_active(XB1_P1)) {
if(is_active(XB1_X)) {
combo_run(myCombo);
if(!myCombo) {
set_val(XB1_RY, -100.0);
}
}
}
}
combo myCombo {
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, -100.0);
wait(30);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Programming Help Needed (Combo)
thanks for your response. basically its a combo with the first two steps being:
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
then after that, i want RY-100 (or any button if it makes it easier) held down until i release the button (in this case X). does that make more sense? sorry if ive been confusing
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
then after that, i want RY-100 (or any button if it makes it easier) held down until i release the button (in this case X). does that make more sense? sorry if ive been confusing
-
riribibi - Command Sergeant Major
- Posts: 134
- Joined: Fri Oct 31, 2014 12:33 pm
Re: Programming Help Needed (Combo)
- Code: Select all
#include <xb1.gph>
bool holdRY;
main {
if(is_active(XB1_LT) && event_active(XB1_X)) {
combo_run(myCombo);
}
if(event_release(XB1_X)) holdRY = 0;
if(holdRY) {
set_val(XB1_RY, -100.0);
}
}
combo myCombo {
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
holdRY = 1;
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Programming Help Needed (Combo)
sorry i been sick and havent replied yet but thank you
it works but the one problem i face is that alot of times after i release the combo, RY -100 is still active long after. any reason why this is happening?
sorry if i wasnt clear, sometimes ill execute and release the combo but then RY is stuck at -100 for a long period of time. any reason why this is happening?
it works but the one problem i face is that alot of times after i release the combo, RY -100 is still active long after. any reason why this is happening?
sorry if i wasnt clear, sometimes ill execute and release the combo but then RY is stuck at -100 for a long period of time. any reason why this is happening?
-
riribibi - Command Sergeant Major
- Posts: 134
- Joined: Fri Oct 31, 2014 12:33 pm
Re: Programming Help Needed (Combo)
- Code: Select all
#include <xb1.gph>
bool holdRY;
main {
if(is_active(XB1_LT) && event_active(XB1_X)) {
combo_run(myCombo);
}
if(event_release(XB1_X)) {
holdRY = 0;
set_val(XB1_RY, 0);
}
if(holdRY) {
set_val(XB1_RY, -100.0);
}
}
combo myCombo {
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
holdRY = 1;
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Programming Help Needed (Combo)
appreciate the help, but the same problem remains...i am not sure why, and ive tried other face buttons besides ry-100, and often that button remains at the value of 100 long after release. any idea why this might be happening? thanks in advance
-
riribibi - Command Sergeant Major
- Posts: 134
- Joined: Fri Oct 31, 2014 12:33 pm
Re: Programming Help Needed (Combo)
riribibi wrote:appreciate the help, but the same problem remains...i am not sure why, and ive tried other face buttons besides ry-100, and often that button remains at the value of 100 long after release. any idea why this might be happening? thanks in advance
The combo should be stopped with the button release event:
- Code: Select all
#include <xb1.gph>
bool holdRY;
main {
if(is_active(XB1_LT) && event_active(XB1_X)) {
combo_run(myCombo);
}
if(event_release(XB1_X)) {
holdRY = 0;
combo_stop(myCombo);
set_val(XB1_RY, 0);
}
if(holdRY) {
set_val(XB1_RY, -100.0);
}
}
combo myCombo {
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 100.0);
wait(30);
set_val(XB1_LX, 0.0);
set_val(XB1_LY, 0.0);
set_val(XB1_RT, 0.0);
set_val(XB1_RY, 0.0);
wait(30);
holdRY = 1;
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
10 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 200 guests