Need help so when you press a button it activates the script
3 posts
• Page 1 of 1
Need help so when you press a button it activates the script
bool stick_forward;
- Code: Select all
#include <titanone.gph>
//<titanone.gph>
// Fri Dec 07 2018 13:54:52
// Script generated by Visual to GPC
//----------------------------------------
main {
if(event_press(XB1_X)) {
combo_run(Tap_1);
combo_run(Turbo_2);
}
}
combo Tap_1 {
set_val(XB1_X, 0);
wait(400);
set_val(XB1_X, 100);
wait(40);
set_val(XB1_X, 100);
}
combo Turbo_2 {
set_val(XB1_X, 100);
wait(50);
set_val(XB1_X, 0);
if(event_active(STICK_2_Y) && time_release(STICK_2_Y) < 240) {
if(stick_forward == 0) {
stick_forward = 1;
}
}
if(stick_forward == 1){
set_val(STICK_2_Y, -100);
}
if(is_active(STICK_2_X)){
stick_forward = 0;
}
}
-
lBOYDl - Staff Sergeant
- Posts: 11
- Joined: Sat Dec 08, 2018 7:33 am
Re: Need help so when you press a button it activates the sc
You can find some toggle and more example codes here: https://www.consoletuner.com/wiki/index ... examples_1
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Need help so when you press a button it activates the sc
If you change
event_press to event_active
and
XB1_X to BUTTON_17
you have converted your script to gpc2 and don't need to use the titanone.gph header file.
If you want to keep the buttons names add that to the top of your script:
#include <xb1.gph>
event_press to event_active
and
XB1_X to BUTTON_17
you have converted your script to gpc2 and don't need to use the titanone.gph header file.
If you want to keep the buttons names add that to the top of your script:
#include <xb1.gph>
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 130 guests