My Script not working on XIM APEX
Moderator: antithesis
5 posts
• Page 1 of 1
My Script not working on XIM APEX
I did a script for R6 Siege about leaning with one button left/right and it works fine (help me improve it xD) but when i connect it to XIM APEX using M&K it doesnt work, outputs shows on Device Monitor but nothing happens ingame.
And this code works just fine, what is the difference:
Pd. Also if you can help me with my code, because it works fine when im standing still but whenever im moving while using the toggle button it just goes crazy on the Device Monitor and not working properly in-game.
- Code: Select all
#pragma METAINFO("LEANTOGGLE", 1, 8, "User")
#define LEAN_OFF 0
#define LEAN_LEFT 1
#define LEAN_RIGHT 2
uint8 lean = LEAN_OFF;
main {
if(is_active(BUTTON_8)) {
if(get_actual(BUTTON_9)) {lean = LEAN_LEFT;}
if(get_actual(BUTTON_6)) {lean = LEAN_RIGHT;}
if (get_actual(BUTTON_12)){
if (lean == LEAN_LEFT) {
set_val(BUTTON_6, 100.0);
lean = LEAN_RIGHT;
}
else if (lean == LEAN_RIGHT) {
set_val(BUTTON_9, 100.0);
lean = LEAN_LEFT;
}
else
lean = LEAN_OFF;
}
}
}
And this code works just fine, what is the difference:
- Code: Select all
#pragma METAINFO("TEST", 1, 8, "User")
#include <xb1.gph>
main {
if((get_val(XB1_LX) < -99.0) && get_val(XB1_LT) && time_active(XB1_LT) > 300) { set_val(BUTTON_9, 100.0);}
if((get_val(XB1_LX) > 99.0) && get_val(XB1_LT) && time_active(XB1_LT) > 300) { set_val(BUTTON_6, 100.0);}
}]
Pd. Also if you can help me with my code, because it works fine when im standing still but whenever im moving while using the toggle button it just goes crazy on the Device Monitor and not working properly in-game.
-
Raczib - Private First Class
- Posts: 3
- Joined: Fri Sep 14, 2018 8:32 am
Re: My Script not working on XIM APEX
Welcome.
Please give us a brief explanation on how you want the script to work. For example, while pressing L2, dpal left lean to left. Thanks.
Please give us a brief explanation on how you want the script to work. For example, while pressing L2, dpal left lean to left. Thanks.
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: My Script not working on XIM APEX
Ok so lets say im manually leaning right or left with RS or LS while holding LT (ADS), what i had in mind was to make the script know where i left the leaning and just by pressing DPAD LEFT it goes either right or left depending where i left the leaning.
So basically one button to lean right/left depending where i left leaning manually.
Using: Xbox One X, XIM APEX, Titan Two, M&K
Game: R6 Siege
So basically one button to lean right/left depending where i left leaning manually.
Using: Xbox One X, XIM APEX, Titan Two, M&K
Game: R6 Siege
-
Raczib - Private First Class
- Posts: 3
- Joined: Fri Sep 14, 2018 8:32 am
Re: My Script not working on XIM APEX
Sorry for not reply you yet last Friday, please check if the changes made below works as you expect.
- Code: Select all
#pragma METAINFO("LEANTOGGLE", 1, 8, "User")
#define LEAN_OFF 0
#define LEAN_LEFT 1
#define LEAN_RIGHT 2
uint8 lean = LEAN_OFF;
main {
if(is_active(BUTTON_8)) {
if(get_actual(BUTTON_9)) lean = LEAN_LEFT;
if(get_actual(BUTTON_6)) lean = LEAN_RIGHT;
if(get_actual(BUTTON_12)) {
if(lean == LEAN_LEFT) {
set_val(BUTTON_6, 100.0);
if(event_active(BUTTON_12)) lean = LEAN_RIGHT;
} else if(lean == LEAN_RIGHT) {
set_val(BUTTON_9, 100.0);
if(event_active(BUTTON_12)) lean = LEAN_LEFT;
} else lean = LEAN_OFF;
}
set_val(BUTTON_12, 0.0);
}
}
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: My Script not working on XIM APEX
Now it works! Thank You! Sometimes the lean goes to the same side but its fine, will try to improve it more.
-
Raczib - Private First Class
- Posts: 3
- Joined: Fri Sep 14, 2018 8:32 am
5 posts
• Page 1 of 1
Return to XIM Apex, XIM4, XIM Edge with Titan devices
Who is online
Users browsing this forum: No registered users and 63 guests