WarFace Script???

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

Re: WarFace Script???

Postby Shthappensbro » Mon Aug 19, 2019 10:41 pm

bonefisher wrote:Yeah that is a PC strafe!



Hey just a question does titan two do Macros ? Like scripts like say I want it to run some where or walk then press a couple of buttons then go back and repeat?
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Mad » Mon Aug 19, 2019 10:48 pm

ConsoleTuner Support Team || Discord
Mad
Major
Major
 
Posts: 1157
Joined: Wed May 22, 2019 5:39 am

Re: WarFace Script???

Postby Shthappensbro » Mon Aug 19, 2019 10:52 pm

Mad wrote:https://www.consoletuner.com/wiki/index.php?id=t2:gpc_scripting:macros



Thanks man if I record it can u loop it for me ? Do you have remnant from the ashes?
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Scachi » Mon Aug 19, 2019 11:29 pm

JamesCaywood wrote:
bonefisher wrote:Yeah that is a PC strafe!



Hey just a question does titan two do Macros ? Like scripts like say I want it to run some where or walk then press a couple of buttons then go back and repeat?

You can put the script "macrorecplay" onto a different slot and use it to record and replay the macros directly without the use of gtuner iv. You need a sd-card in your T2 for this script to work.
macrorecplay script documentation: viewtopic.php?f=23&t=9745#p68771
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2306
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: WarFace Script???

Postby Shthappensbro » Mon Aug 19, 2019 11:32 pm

Scachi wrote:
JamesCaywood wrote:
bonefisher wrote:Yeah that is a PC strafe!



Hey just a question does titan two do Macros ? Like scripts like say I want it to run some where or walk then press a couple of buttons then go back and repeat?

You can put the script "macrorecplay" onto a different slot and use it to record and replay the macros directly without the use of gtuner iv. You need a sd-card in your T2 for this script to work.
macrorecplay script documentation: viewtopic.php?f=23&t=9745#p68771



Oh I'm not smart enough for all this lol.

Do u play remnant from the ashes?? On xbox
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Scachi » Mon Aug 19, 2019 11:44 pm

JamesCaywood wrote:Oh I'm not smart enough for all this lol.

Using the script macrorecplay doesn't require any coding/scripting. You do all the inputs direclty in the game.
Only requirement is a sd-card.

JamesCaywood wrote:Do u play remnant from the ashes?? On xbox

..No and no .. I am on ps4.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 2306
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: WarFace Script???

Postby Shthappensbro » Mon Aug 19, 2019 11:45 pm

Scachi wrote:
JamesCaywood wrote:Oh I'm not smart enough for all this lol.

Using the script macrorecplay doesn't require any coding/scripting. You do all the inputs direclty in the game.
Only requirement is a sd-card.

JamesCaywood wrote:Do u play remnant from the ashes?? On xbox

..No and no .. I am on ps4.



Ahhh ps4 has it but dont get it tell the 20th
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Tue Aug 20, 2019 12:17 am

Scachi wrote:
JamesCaywood wrote:Oh I'm not smart enough for all this lol.

Using the script macrorecplay doesn't require any coding/scripting. You do all the inputs direclty in the game.
Only requirement is a sd-card.

JamesCaywood wrote:Do u play remnant from the ashes?? On xbox

..No and no .. I am on ps4.




i see im getting it but keeps masssing up on the movement and pressing i keep have top redo it ill try to go slower
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Tue Aug 20, 2019 2:00 am

Scachi wrote:
JamesCaywood wrote:Oh I'm not smart enough for all this lol.

Using the script macrorecplay doesn't require any coding/scripting. You do all the inputs direclty in the game.
Only requirement is a sd-card.

JamesCaywood wrote:Do u play remnant from the ashes?? On xbox

..No and no .. I am on ps4.



Got it to work but I couldn't turn on game had to set my camera at a point and leave it there and just walk there and back seems like it would cut off a few seconds too after stopping it. Then when I'm turning it on it would like cut a few seconds off the last script for some reason
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Wed Aug 21, 2019 2:13 pm

bonefisher wrote:
Code: Select all
 
#pragma METAINFO("Warface Special", 1, 0, "bonefisher")
/* Special credits goes out to DrNefario for a awesome anti-recoil function!*/
 
/* *****************************************************************************
<cfgdesc>
[Warface Special]
color          = #008000
shortdesc      = Primary/ Secondary switching enabled. If you get on wrong side just hold switch button pass 250 ms to line up class. Runtime operations for manual overrides. <br /><br /> <b><u>Runtime Operations</b></u>  <br /><br />Hold <b>[L2|LT] + </b><br /><br />Press <b>[Touch-Click|View] + [CROSS|A]</b> to quickly enable/disable the mod.
control        = info
 
[WEAPON SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">PRIMARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 0
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Primary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">PRIMARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[Secondary Weapon Setting]
color          = #008000
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 9
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Secondary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">SECONDARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 10
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:</font> <font color="green"> Set to the resting dead zone values for your right stick.</font>
byteoffset     = 18
bitsize        = 32
control        = spinboxf
default        = 1000
minimum        = 0
maximum        = 10000
step           = 100
decimals       = 2
 
[PRIMARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">PRIMARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 22
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Primary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 23
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Primary Anti Recoil]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 1600
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[SECONDARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 29
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Secondary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 30
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Secondary Anti Recoil]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 32
bitsize        = 32
control        = spinboxf
default        = 1400
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[AIM ABUSE SETTINGS:]
color          = #008000
collapsible    = 2
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 350
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 80
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
item        = Enabled Strafe On single press ads and double press ads Off.
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 400
minimum     = 0
maximum     = 2000
step        = 10
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define WEAPON_0   0
#define WEAPON_1   1
bool modz = 1;
fix32 prpm;
fix32 psps;
fix32 phold_time, prest_time;
fix32 srpm;
fix32 ssps;
fix32 shold_time, srest_time;
bool pUseRapidFire;
bool sUseRapidFire;
uint8  weapon = 0;
fix32 StickNoise;
bool pUseAntiRecoil;
uint16 pARecoilDelay;
fix32 pARecoil_V;
bool sUseAntiRecoil;
uint16 sARecoilDelay;
fix32 sARecoil_V;
fix32 ARecoil_V_ToUse;
uint16 ARecoilDelay_ToUse;
//Aim Abuse
bool bUseAimAbuse = FALSE;
bool bAutoAimPauseFire;
int AutoAimHoldTime = 650;
int AutoAimReleaseTime = 50;
int AutoAimFirePrePauseTime = 10;
int AutoAimFirePostPauseTime = 10;
bool UseStrafeMod = 1;
uint8 STRAFE_MODz;
uint32 STRAFE_SHUFFLE;
uint32    IND[] = {
    _0_,         // 0
    _1_,         // 1
    _2_,         // 2
    _3_,         // 3
    _P_,         // 4
    _S_          // 5
};
init
{
    pmem_load();
    pUseRapidFire = (pmem_read(0) >> 7) & 0b1;
  pmem_read(1, &prpm);
    sUseRapidFire = (pmem_read(9) >> 7) & 0b1;
  pmem_read(10, &srpm);
  pmem_read(18, &StickNoise);
    pUseAntiRecoil = (pmem_read(22) >> 7) & 0b1;
  pmem_read(23, &pARecoilDelay);
  pmem_read(25, &pARecoil_V);
    sUseAntiRecoil = (pmem_read(29) >> 7) & 0b1;
  pmem_read(30, &sARecoilDelay);
  pmem_read(32, &sARecoil_V);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
  pmem_read(57, &AutoAimHoldTime);
  pmem_read(59, &AutoAimReleaseTime);
  pmem_read(61, &AutoAimFirePrePauseTime);
  pmem_read(63, &AutoAimFirePostPauseTime);
    STRAFE_MODz = pmem_read(115);
  pmem_read(116, &STRAFE_SHUFFLE);
    set_weapon(weapon);
    p_update_rapidfire();
    s_update_rapidfire();
}
 
main
{
    if(get_actual(BUTTON_8)){
        set_val(BUTTON_2, 0.0);
        if(get_actual(BUTTON_2) && event_active(BUTTON_16)){
            modz = !modz;
        }
    }
    if(modz==1){
    //--------------------------WEAPON-SWITCHING----------------------------------//
  if(event_release(BUTTON_14) && time_active(BUTTON_14) < 250){
    if(weapon == WEAPON_0) set_weapon(WEAPON_1);
    else if(weapon == WEAPON_1) set_weapon(WEAPON_0);
    }
 
    switch(weapon) {
    case WEAPON_0: {
    if(pUseRapidFire == 0)
    {
        set_val(BUTTON_5, 0.0);
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            set_val(BUTTON_5, 100.0);
        }
        }
    }
    if(pUseRapidFire == 1)
    {
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            combo_run(pRapidFire);
        }
        }
    }
    if(pUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = pARecoilDelay;
        ARecoil_V_ToUse = pARecoil_V;
    }
    } break;
    case WEAPON_1: {
    if(sUseRapidFire == 1)
    {
      if (get_actual(BUTTON_5))
        {
      if (bAutoAimPauseFire == FALSE)
        {
          combo_run(sRapidFire);
        }
        }
    }
    if(sUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = sARecoilDelay;
        ARecoil_V_ToUse = sARecoil_V;
    }
    } break;
  }
 
    if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay_ToUse)
    {
      if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
        //We currently only want shoot to be on during the hold phase of rapid fire
        if (get_actual(BUTTON_8)&& get_actual(BUTTON_5))
        {
          AntiRecoil(ARecoil_V_ToUse);
        }
    }
    if (bUseAimAbuse == 1)
    {
        if (get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 3) {
        #define STRAFE_OFF   0
    #define STRAFE_ON    1
    static uint8 strafe;
    if(event_active(BUTTON_8)) {
        strafe = STRAFE_ON;
        display_overlay(_1_, 500);
    } else if(is_active(BUTTON_8) && time_release(BUTTON_8) <= 200) {
        strafe = STRAFE_OFF;
        display_overlay(_0_, 500);
    }
    if(strafe == STRAFE_ON){
        combo_run(super_strafe);
    }else combo_stop(super_strafe);
    if(is_active(STICK_2_Y)){combo_stop(super_strafe);}
    if(is_active(STICK_2_X)){combo_stop(super_strafe);}
    }
}
}
 
combo pRapidFire
{
    set_val(BUTTON_5, 100);
    wait(phold_time);
    set_val(BUTTON_5, 0);
    wait(prest_time);
      set_val(BUTTON_5, 0);
}
 
combo sRapidFire
{
    set_val(BUTTON_5, 100);
    wait(shold_time);
    set_val(BUTTON_5, 0);
    wait(srest_time);
      set_val(BUTTON_5, 0);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo super_strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
void p_update_rapidfire()
{
    printf("<center><font style='color:blue;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", prpm);
    psps = prpm/ 60.0;
    phold_time = 500.0 / psps;
    prest_time = phold_time - 1.0;
    if(prest_time < 0.0) prest_time = 0.0;   
 
    return;
}
 
void s_update_rapidfire()
{
    printf("<center><font style='color:red;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", srpm);
    ssps = srpm/ 60.0;
    shold_time = 500.0 / ssps;
    srest_time = shold_time - 1.0;
    if(srest_time < 0.0) srest_time = 0.0;   
 
    return;
}
 
void AntiRecoil(fix32 recoil) {
  fix32 RY = get_actual(22);
  fix32 RX = get_actual(21);
  fix32 modifiedRY;
 
  fix32 trueRY = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RY*.8;
  fix32 trueRX = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RX*.9;
 
  if (RY > 0.0) modifiedRY = (100.0-StickNoise-recoil)/(100.0-StickNoise)*trueRY + recoil;
  if (RY < 0.0) modifiedRY = (100.0-StickNoise+recoil)/(100.0-StickNoise)*trueRY + recoil;
 
  fix32 altradius = sqrt(trueRX*trueRX + modifiedRY*modifiedRY);
 
  fix32 finalRX = trueRX * (altradius + StickNoise)/altradius;
  fix32 finalRY = modifiedRY * (altradius + StickNoise)/altradius;
 
  if (RX*RX+RY*RY <= StickNoise*StickNoise) set_val(22,(StickNoise+recoil));
 
  if (RX*RX+RY*RY > StickNoise*StickNoise) {
    set_val(22,clamp(finalRY, -100f, 100f));
    set_val(21,clamp(finalRX, -100f, 100f));
  }
}
 
void set_weapon(uint8 new_weapon)
{
  static uint8 old_weapon;
 
    if(new_weapon == old_weapon) return;
      old_weapon = new_weapon;
      weapon = new_weapon;
 
    static uint32 timestamp;
    uint32 elapsed = system_time() - timestamp;
 
    if(!elapsed || elapsed >= 10) {
    // Set LED
    switch(weapon) {
    case WEAPON_0: { // BLUE LED
      led_set(LED_1, 100.0, 0);
      led_set(LED_2, 0.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (4);
    } break;
    case WEAPON_1: { // RED LED
      led_set(LED_1, 0.0, 0);
      led_set(LED_2, 100.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (5);
    } break;
    }
    timestamp = system_time();
    }
    return;
}
 
 // Display Numbers
void display (uint8 indc)
{
    uint8 VIE;
    VIE = IND[indc];
    display_overlay(VIE, 2000 );
}
 
 

here give a try!



How's stuff going just updating? U been playing the game ? Are you Busy atm?
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 13 guests