Destiny 2 - Strafe&Shoot but keep the aim on target

GPC2 script programming for Titan Two. Code examples, questions, requests.

Destiny 2 - Strafe&Shoot but keep the aim on target

Postby monty34 » Sun Dec 09, 2018 9:08 am

Hi, working on a strafe script while shooting, how do i keep Stick_1_X on the same position during the strafe &shooting?


Code: Select all
 
main {
 
 
    if (get_actual(BUTTON_8) >= 50.0) {
 
        if(get_actual(BUTTON_5)) {
        combo_run(RapidFire);
        combo_run(AutoStrafe);   
        } else {
                combo_stop(RapidFire);
            combo_stop(AutoStrafe);
        }   
    }
 
 
 
}
 
combo RapidFire {
    set_val(BUTTON_5, 100);
    wait (231); //Value for Bygones
    set_val(BUTTON_5, 0);
    wait (231);
}
 
 
combo AutoStrafe {
    set_val(STICK_2_X, 100);
    wait(300);
    set_val(STICK_2_X, 0);
    wait(100);
    set_val(STICK_2_X, -100);
    wait(300);
    set_val(STICK_2_X, 0);
    wait(100);
}
 
User avatar
monty34
Command Sergeant Major
Command Sergeant Major
 
Posts: 165
Joined: Wed Jun 28, 2017 7:25 pm

Re: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby J2Kbr » Tue Dec 11, 2018 4:16 pm

When triggering the strafe you can save the x and y values and apply for a certain time, overwriting the stick values from the controller. However, it seems this is not what you want achieve as the values will be fixed and your target will be moving. In this case not sure if can be done, as the device does not have knowledge of what is happening on the game (screen) to track the target (unless like in Fortnite which has strong aim assist).
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: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby monty34 » Tue Dec 11, 2018 7:20 pm

Hi, as i´m a xim mouse user, i´m searching for something which apply a constant increase of the Stick_1_X over a given time.

As example, when i apply below code i want a increase of 0.1 per ms of Stick_1_X from 1 to 300ms.

Code: Select all
 
    set_val(STICK_2_X, 100);
    wait(300);
 
User avatar
monty34
Command Sergeant Major
Command Sergeant Major
 
Posts: 165
Joined: Wed Jun 28, 2017 7:25 pm

Re: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby Sillyasskid » Tue Dec 11, 2018 9:34 pm

monty34 wrote:As example, when i apply below code i want a increase of 0.1 per ms of Stick_1_X from 1 to 300ms.

Code: Select all
 
    set_val(STICK_2_X, 100);
    wait(300);
 

Is this right?
Code: Select all
fix32 x_val;
init{
  combo_run(one);
}
 
// When this code is active. STICK_1_X value will increase by 0.1, per ms. for 300ms.
combo one {
  set_val(STICK_2_X, 100);
  wait(300);
}
 
main {
  if(one) x_val += 0.1;
  set_val(STICK_1_X, x_val);
}
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby monty34 » Thu Dec 13, 2018 9:04 pm

Thanks, this code helps me to go in the right direction. Still some work to do for me, but now i´ve a better idea what to do.
User avatar
monty34
Command Sergeant Major
Command Sergeant Major
 
Posts: 165
Joined: Wed Jun 28, 2017 7:25 pm

Re: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby grarrg » Thu Jan 03, 2019 11:37 pm

Monty34, any updates to if you got this working?
User avatar
grarrg
Sergeant Major
Sergeant Major
 
Posts: 91
Joined: Thu May 31, 2018 6:49 pm

Re: Destiny 2 - Strafe&Shoot but keep the aim on target

Postby monty34 » Wed Feb 06, 2019 11:22 am

Hi, i've currently no time to work on this, but it's still on my to do list.
User avatar
monty34
Command Sergeant Major
Command Sergeant Major
 
Posts: 165
Joined: Wed Jun 28, 2017 7:25 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: Google [Bot] and 80 guests

cron