Battlefield 4 horizontal recoil

Titan One general support. Questions, firmware update, feature request.

Re: Battlefield 4 horizontal recoil

Postby Antihawk » Fri Feb 05, 2016 11:49 am

That's definitely something to think about.

So just to clarify for the horizontal recoil values. I assume the anti-recoil values equate to pulling the analog stick a certain amount in a certain direction, right? So if you had 17 as the left anti-recoil value, then it would be as if the analog stick was being pulled that much left. So setting only one horizontal recoil value at a time makes sense, correct? Because you can't move the analog stick left and right at the same time. You basically just work out the average horizontal kick for the gun and set a value for either left of right, depending on which way the gun kicks.
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

Re: Battlefield 4 horizontal recoil

Postby J2Kbr » Mon Feb 08, 2016 11:53 am

Antihawk wrote:So if you had 17 as the left anti-recoil value, then it would be as if the analog stick was being pulled that much left. So setting only one horizontal recoil value at a time makes sense, correct? Because you can't move the analog stick left and right at the same time. You basically just work out the average horizontal kick for the gun and set a value for either left of right, depending on which way the gun kicks.

Correct.
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: Battlefield 4 horizontal recoil

Postby Antihawk » Tue Mar 01, 2016 9:07 pm

// -----------------------------------------------------------------------------
// YOU CAN CUSTOMIZE THIS SCRIPT CHANGING THE FOLLOWING DEFINE VALUES
// -----------------------------------------------------------------------------

// BUTTON LAYOUT
// Make the same as you have configurared on the game
define FIRE_BUTTON = XB1_RT;
define SCOPE_BUTTON = XB1_LT;
define SPOT_BUTTON = XB1_RB;
define SPRINT_BUTTON = XB1_RS;

// RAPIDFIRE
define RAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define RAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define RAPIDFIRE_RELEASETIME = 30; // Release time in ms

// RAPIDFIRE MODE (excluse option, just enable one at time)
define MODE_SCOPE_ENABLE = FALSE; // TRUE or FALSE
define MODE_SCOPE_DISABLE = FALSE; // TRUE or FALSE
define MODE_PRESS_SENSITIVY = FALSE; // TRUE or FALSE

// SECONDARY RAPIDFIRE
define SRAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define SRAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define SRAPIDFIRE_RELEASETIME = 30; // Release time in ms

// AUTO SPOT
define AUTOSPOT_ENABLED = TRUE; // TRUE or FALSE
define AUTOSPOT_SCOPEONLY = TRUE; // TRUE or FALSE
define AUTOSPOT_TIME = 980; // Cicle time in ms

// EASY SPRINT
define EASYSPRINT_ENABLED = FALSE; // TRUE or FALSE

// ANTI RECOIL
define ANTIRECOIL_ENABLED = TRUE; // TRUE or FALSE
define ANTIRECOIL_SCOPEONLY = TRUE; // TRUE or FALSE
define ANTIRECOIL_FORCE = 32; // Anti recoil force (vertical): from 0 to 100
define ANTIRECOIL_LEFT = 0; // Anti recoil force (left): from 0 to 100
define ANTIRECOIL_RIGHT = 15; // Anti recoil force (right): from 0 to 100

// -----------------------------------------------------------------------------
// NO CHANGES ARE NEEDED FROM HERE
// -----------------------------------------------------------------------------

int modz_activated = TRUE;
int cFire_right, cFire_press, cFire_release;
int anti_recoil, anti_recoil_left, anti_recoil_right;

main {
if(get_val(PS4_L3) && event_press(PS4_CROSS)) {
modz_activated = !modz_activated;
}
if(modz_activated) {
// AUTO SPOT
if(AUTOSPOT_ENABLED) {
if(!AUTOSPOT_SCOPEONLY || get_val(SCOPE_BUTTON)) {
combo_run(AutoSpot);
}
}
// EASY SPRINT
if(EASYSPRINT_ENABLED && !get_val(SCOPE_BUTTON)) {
if(get_val(PS4_LY) <= -35) {
combo_run(EasySprint);
}
}
// ANTI-RECOIL
if(ANTIRECOIL_ENABLED && get_val(FIRE_BUTTON)) {
if(!ANTIRECOIL_SCOPEONLY || get_val(SCOPE_BUTTON)) {
combo_run(AntiRecoil);
}
}
// FIREMODES
if(!(MODE_SCOPE_ENABLE + MODE_SCOPE_DISABLE + MODE_PRESS_SENSITIVY)
|| MODE_SCOPE_ENABLE && get_val(SCOPE_BUTTON)
|| MODE_SCOPE_DISABLE && get_val(SCOPE_BUTTON)
|| MODE_PRESS_SENSITIVY && get_val(FIRE_BUTTON) == 100) {
if(get_val(FIRE_BUTTON)) {
if(!cFire_right) {
combo_stop(Fire);
cFire_right = TRUE;
}
} else if(cFire_right) {
combo_stop(Fire);
cFire_right = FALSE;
}
} else if(cFire_right) {
combo_stop(Fire);
cFire_right = FALSE;
}
if(cFire_right) {
// RAPIDFIRE
if(RAPIDFIRE_ENABLED) {
cFire_press = RAPIDFIRE_HOLDTIME;
cFire_release = RAPIDFIRE_RELEASETIME;
combo_run(Fire);
}
} else if(SRAPIDFIRE_ENABLED) { // SECONDARY RAPID FIRE
if(get_val(FIRE_BUTTON)) {
cFire_press = SRAPIDFIRE_HOLDTIME;
cFire_release = SRAPIDFIRE_RELEASETIME;
combo_run(Fire);
}
}
}
}

combo Fire {
set_val(FIRE_BUTTON, 100);
wait(cFire_press);
set_val(FIRE_BUTTON, 0);
wait(cFire_release);
set_val(FIRE_BUTTON, 0);
}

combo AutoSpot {
set_val(SPOT_BUTTON, 100);
wait(40); wait(AUTOSPOT_TIME);
}

combo EasySprint {
set_val(SPRINT_BUTTON, 100);
wait(100); wait(100);
}

/*
combo AntiRecoil {
anti_recoil = get_val(PS4_RY) + ANTIRECOIL_FORCE;
if(anti_recoil > 100) anti_recoil = 100;
else if(anti_recoil < -100) anti_recoil = -100;
set_val(PS4_RY, anti_recoil);
}
*/
combo AntiRecoil {
if(get_val(FIRE_BUTTON)) {
anti_recoil = get_val(10) + ANTIRECOIL_FORCE;
if(anti_recoil > 100) anti_recoil = 100;
set_val(10, anti_recoil);
anti_recoil_left = get_val(9) -ANTIRECOIL_LEFT;
if(anti_recoil_left > 100) anti_recoil_left = 100;
set_val(9, anti_recoil_left);
anti_recoil_right = get_val(9) +ANTIRECOIL_RIGHT;
if(anti_recoil_right > 100) anti_recoil_right = 100;
set_val(9, anti_recoil_right);
}
}
/* *
* GPC SCRIPT
*
* GPC is a scripting language with C-like syntax.
* To learn more access GPC Language Reference on Help menu.
* *********************************************************** */

main {

//
// The main procedure is called before every report be sent to
// console, you can think in this procedure as a loop which only
// ends when the script is unloaded.
//
// TODO: handle/change values of buttons, analog stick and/or sensors
//

}
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

Re: Battlefield 4 horizontal recoil

Postby Antihawk » Tue Mar 01, 2016 9:08 pm

This is a copy and pasted version of the script I tried to load on to the Titan One.

Gtuner said there was an error with it.

I can't see it. Can anyone read it over and identify my error?

Thanks in advance
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

Re: Battlefield 4 horizontal recoil

Postby Antihawk » Tue Mar 01, 2016 9:28 pm

I just realised that there are a lot of PS4-specific values after the "No changes needed after here" part in the script.

I have no idea what to do. Is it possible for you to change it to an XB1 script?
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

Re: Battlefield 4 horizontal recoil

Postby bonefisher » Tue Mar 01, 2016 9:50 pm

Code: Select all

// -----------------------------------------------------------------------------
// YOU CAN CUSTOMIZE THIS SCRIPT CHANGING THE FOLLOWING DEFINE VALUES
// -----------------------------------------------------------------------------

// BUTTON LAYOUT
// Make the same as you have configurared on the game
define FIRE_BUTTON = XB1_RT;
define SCOPE_BUTTON = XB1_LT;
define SPOT_BUTTON = XB1_RB;
define SPRINT_BUTTON = XB1_LS;

// RAPIDFIRE
define RAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define RAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define RAPIDFIRE_RELEASETIME = 30; // Release time in ms

// RAPIDFIRE MODE (excluse option, just enable one at time)
define MODE_SCOPE_ENABLE = FALSE; // TRUE or FALSE
define MODE_SCOPE_DISABLE = FALSE; // TRUE or FALSE
define MODE_PRESS_SENSITIVY = FALSE; // TRUE or FALSE

// SECONDARY RAPIDFIRE
define SRAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define SRAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define SRAPIDFIRE_RELEASETIME = 30; // Release time in ms

// AUTO SPOT
define AUTOSPOT_ENABLED = TRUE; // TRUE or FALSE
define AUTOSPOT_SCOPEONLY = TRUE; // TRUE or FALSE
define AUTOSPOT_TIME = 980; // Cicle time in ms

// EASY SPRINT
define EASYSPRINT_ENABLED = FALSE; // TRUE or FALSE

// ANTI RECOIL
define ANTIRECOIL_ENABLED = TRUE; // TRUE or FALSE
define ANTIRECOIL_SCOPEONLY = TRUE; // TRUE or FALSE
define ANTIRECOIL_FORCE = 32; // Anti recoil force (vertical): from 0 to 100
define ANTIRECOIL_LEFT = 0; // Anti recoil force (left): from 0 to 100
define ANTIRECOIL_RIGHT = 15; // Anti recoil force (right): from 0 to 100

// -----------------------------------------------------------------------------
// NO CHANGES ARE NEEDED FROM HERE
// -----------------------------------------------------------------------------

int modz_activated = TRUE;
int cFire_right, cFire_press, cFire_release;
int anti_recoil, anti_recoil_left, anti_recoil_right;

main {
 if(get_val(XB1_LS) && event_press(XB1_A)) {
 modz_activated = !modz_activated;
 }
 if(modz_activated) {
 // AUTO SPOT
if(AUTOSPOT_ENABLED) {
 if(!AUTOSPOT_SCOPEONLY || get_val(SCOPE_BUTTON)) {
 combo_run(AutoSpot);
 }
 }
 // EASY SPRINT
if(EASYSPRINT_ENABLED && !get_val(SCOPE_BUTTON)) {
 if(get_val(PS4_LY) <= -35) {
 combo_run(EasySprint);
 }
 }
 // ANTI-RECOIL
if(ANTIRECOIL_ENABLED && get_val(FIRE_BUTTON)) {
 if(!ANTIRECOIL_SCOPEONLY || get_val(SCOPE_BUTTON)) {
 combo_run(AntiRecoil);
 }
 }
 // FIREMODES
if(!(MODE_SCOPE_ENABLE + MODE_SCOPE_DISABLE + MODE_PRESS_SENSITIVY)
 || MODE_SCOPE_ENABLE && get_val(SCOPE_BUTTON)
 || MODE_SCOPE_DISABLE && get_val(SCOPE_BUTTON)
 || MODE_PRESS_SENSITIVY && get_val(FIRE_BUTTON) == 100) {
 if(get_val(FIRE_BUTTON)) {
 if(!cFire_right) {
 combo_stop(Fire);
 cFire_right = TRUE;
 }
 } else if(cFire_right) {
 combo_stop(Fire);
 cFire_right = FALSE;
 }
 } else if(cFire_right) {
 combo_stop(Fire);
 cFire_right = FALSE;
 }
 if(cFire_right) {
 // RAPIDFIRE
if(RAPIDFIRE_ENABLED) {
 cFire_press = RAPIDFIRE_HOLDTIME;
 cFire_release = RAPIDFIRE_RELEASETIME;
 combo_run(Fire);
 }
 } else if(SRAPIDFIRE_ENABLED) { // SECONDARY RAPID FIRE
if(get_val(FIRE_BUTTON)) {
 cFire_press = SRAPIDFIRE_HOLDTIME;
 cFire_release = SRAPIDFIRE_RELEASETIME;
 combo_run(Fire);
 }
 }
 }
}

combo Fire {
 set_val(FIRE_BUTTON, 100);
 wait(cFire_press);
 set_val(FIRE_BUTTON, 0);
 wait(cFire_release);
 set_val(FIRE_BUTTON, 0);
}

combo AutoSpot {
 set_val(SPOT_BUTTON, 100);
 wait(40); wait(AUTOSPOT_TIME);
}

combo EasySprint {
 set_val(SPRINT_BUTTON, 100);
 wait(100); wait(100);
}

/*
combo AntiRecoil {
 anti_recoil = get_val(PS4_RY) + ANTIRECOIL_FORCE;
 if(anti_recoil > 100) anti_recoil = 100;
 else if(anti_recoil < -100) anti_recoil = -100;
 set_val(PS4_RY, anti_recoil);
}
*/

combo AntiRecoil {
 if(get_val(FIRE_BUTTON)) {
 anti_recoil = get_val(10) + ANTIRECOIL_FORCE;
 if(anti_recoil > 100) anti_recoil = 100;
 set_val(10, anti_recoil);
 anti_recoil_left = get_val(9) -ANTIRECOIL_LEFT;
 if(anti_recoil_left > 100) anti_recoil_left = 100;
 set_val(9, anti_recoil_left);
 anti_recoil_right = get_val(9) +ANTIRECOIL_RIGHT;
 if(anti_recoil_right > 100) anti_recoil_right = 100;
 set_val(9, anti_recoil_right);
 }
}

Here you go!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Battlefield 4 horizontal recoil

Postby bonefisher » Tue Mar 01, 2016 9:57 pm

You playing default layout? If so I changed the SPRINT_BUTTON = XB1_RS to XB1_LS and changed below for turning mods on/off. You had extra main below giving you the error which I remove. Should be ok now!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Battlefield 4 horizontal recoil

Postby Antihawk » Tue Mar 01, 2016 10:16 pm

Yeah. I messed that one up.

There's still an error when loading the script, however. Looking at that script, there's still some PS4-specific code below the "No changes" part of the code. I wonder if that's the issue?
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

Re: Battlefield 4 horizontal recoil

Postby bonefisher » Tue Mar 01, 2016 10:30 pm

Code: Select all

/ -----------------------------------------------------------------------------
// YOU CAN CUSTOMIZE THIS SCRIPT CHANGING THE FOLLOWING DEFINE VALUES
// -----------------------------------------------------------------------------

// BUTTON LAYOUT
// Make the same as you have configurared on the game
define FIRE_BUTTON = XB1_RT;
define SCOPE_BUTTON = XB1_LT;
define SPOT_BUTTON = XB1_RB;
define SPRINT_BUTTON = XB1_LS;

// RAPIDFIRE
define RAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define RAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define RAPIDFIRE_RELEASETIME = 30; // Release time in ms

// RAPIDFIRE MODE (excluse option, just enable one at time)
define MODE_SCOPE_ENABLE = FALSE; // TRUE or FALSE
define MODE_SCOPE_DISABLE = FALSE; // TRUE or FALSE
define MODE_PRESS_SENSITIVY = FALSE; // TRUE or FALSE

// SECONDARY RAPIDFIRE
define SRAPIDFIRE_ENABLED = FALSE; // TRUE or FALSE
define SRAPIDFIRE_HOLDTIME = 40; // Hold time in ms
define SRAPIDFIRE_RELEASETIME = 30; // Release time in ms

// AUTO SPOT
define AUTOSPOT_ENABLED = TRUE; // TRUE or FALSE
define AUTOSPOT_SCOPEONLY = TRUE; // TRUE or FALSE
define AUTOSPOT_TIME = 980; // Cicle time in ms

// EASY SPRINT
define EASYSPRINT_ENABLED = TRUE; // TRUE or FALSE

// ANTI RECOIL
define ANTIRECOIL_ENABLED = TRUE; // TRUE or FALSE
define ANTIRECOIL_SCOPEONLY = TRUE; // TRUE or FALSE
define ANTIRECOIL_FORCE = 32; // Anti recoil force (vertical): from 0 to 100
define ANTIRECOIL_LEFT = 0; // Anti recoil force (left): from 0 to 100
define ANTIRECOIL_RIGHT = 15; // Anti recoil force (right): from 0 to 100

// -----------------------------------------------------------------------------
// NO CHANGES ARE NEEDED FROM HERE
// -----------------------------------------------------------------------------

int modz_activated = TRUE;
int cFire_right, cFire_press, cFire_release;
int anti_recoil, anti_recoil_left, anti_recoil_right;

main {
 if(get_val(XB1_LS) && event_press(XB1_A)) {
 modz_activated = !modz_activated;
 }
 if(modz_activated) {
 // AUTO SPOT
if(AUTOSPOT_ENABLED) {
 if(!AUTOSPOT_SCOPEONLY || get_val(SCOPE_BUTTON)) {
 combo_run(AutoSpot);
 }
 }
 // EASY SPRINT
if(EASYSPRINT_ENABLED && !get_val(SCOPE_BUTTON)) {
 if(get_val(XB1_LY) <= -35) {
 combo_run(EasySprint);
 }
 }
 // ANTI-RECOIL
if(ANTIRECOIL_ENABLED && get_val(FIRE_BUTTON)) {
 if(!ANTIRECOIL_SCOPEONLY || get_val(SCOPE_BUTTON)) {
 combo_run(AntiRecoil);
 }
 }
 // FIREMODES
if(!(MODE_SCOPE_ENABLE + MODE_SCOPE_DISABLE + MODE_PRESS_SENSITIVY)
 || MODE_SCOPE_ENABLE && get_val(SCOPE_BUTTON)
 || MODE_SCOPE_DISABLE && get_val(SCOPE_BUTTON)
 || MODE_PRESS_SENSITIVY && get_val(FIRE_BUTTON) == 100) {
 if(get_val(FIRE_BUTTON)) {
 if(!cFire_right) {
 combo_stop(Fire);
 cFire_right = TRUE;
 }
 } else if(cFire_right) {
 combo_stop(Fire);
 cFire_right = FALSE;
 }
 } else if(cFire_right) {
 combo_stop(Fire);
 cFire_right = FALSE;
 }
 if(cFire_right) {
 // RAPIDFIRE
if(RAPIDFIRE_ENABLED) {
 cFire_press = RAPIDFIRE_HOLDTIME;
 cFire_release = RAPIDFIRE_RELEASETIME;
 combo_run(Fire);
 }
 } else if(SRAPIDFIRE_ENABLED) { // SECONDARY RAPID FIRE
if(get_val(FIRE_BUTTON)) {
 cFire_press = SRAPIDFIRE_HOLDTIME;
 cFire_release = SRAPIDFIRE_RELEASETIME;
 combo_run(Fire);
 }
 }
 }
}

combo Fire {
 set_val(FIRE_BUTTON, 100);
 wait(cFire_press);
 set_val(FIRE_BUTTON, 0);
 wait(cFire_release);
 set_val(FIRE_BUTTON, 0);
}

combo AutoSpot {
 set_val(SPOT_BUTTON, 100);
 wait(40); wait(AUTOSPOT_TIME);
}

combo EasySprint {
 set_val(SPRINT_BUTTON, 100);
 wait(100); wait(100);
}

/*
combo AntiRecoil {
 anti_recoil = get_val(PS4_RY) + ANTIRECOIL_FORCE;
 if(anti_recoil > 100) anti_recoil = 100;
 else if(anti_recoil < -100) anti_recoil = -100;
 set_val(PS4_RY, anti_recoil);
}
*/

combo AntiRecoil {
 if(get_val(FIRE_BUTTON)) {
 anti_recoil = get_val(10) + ANTIRECOIL_FORCE;
 if(anti_recoil > 100) anti_recoil = 100;
 set_val(10, anti_recoil);
 anti_recoil_left = get_val(9) -ANTIRECOIL_LEFT;
 if(anti_recoil_left > 100) anti_recoil_left = 100;
 set_val(9, anti_recoil_left);
 anti_recoil_right = get_val(9) +ANTIRECOIL_RIGHT;
 if(anti_recoil_right > 100) anti_recoil_right = 100;
 set_val(9, anti_recoil_right);
 }
}

Open new page then delete everything off to make blank page. then copy and paste this on blank page then save and load into programming slot.
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: Battlefield 4 horizontal recoil

Postby Antihawk » Tue Mar 01, 2016 10:37 pm

Oh yeah, lol. That was an obvious mistake of mine. Deleting everything from the default page worked. Script works perfectly now. Thanks for the help!
User avatar
Antihawk
Staff Sergeant
Staff Sergeant
 
Posts: 15
Joined: Wed May 13, 2015 10:58 pm

PreviousNext

Return to Titan One Device

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 168 guests

cron