Help with Scripting error.

GPC1 script programming for Titan One. Code examples, questions, requests.

Re: Help with Scripting error.

Postby re5lvr » Mon Dec 15, 2014 7:33 am

Will try it tomorrow, thanks. It would be great if it works out.

Man there is alot to that. I wonder how it will play out beings that there are 3 selectable weapons. For instance the turbo on RT is by passed by using the LB, but what will this do, will it apply this function all the time ie. with all three weapons. I am getting ready to have surgery so haven't coherently read through the script yet, but will get to it later.
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby re5lvr » Tue Dec 16, 2014 12:25 am

Well I gave it my best at plugging this into one of the working scripts but kept getting error:
> 2: RevelationsV2SxX4T9.gpc* : C:\Users\Mother\Documents\RevelationsV2SxX4T9.gpc
> ERROR line 18: syntax error near unexpected token 'int'.
Build failed with 1 errors ...


Code: Select all
    define Rate_Of_Fire = 20; // Range: 1 to 25 RPS (Round/s) // Values higher than 25 would be so fast that the game probably will not detect 100% of the events.
    define GAME_Y_AIM           =   10; // RY
    define GAME_Y_MOV           =   12; // LY
    define GAME_FIRE            =    4; // RT

    define ANTIRECOIL_RES       =    1;
    define ANTIRECOIL_DEF       =   35;
    define ANTIRECOIL_MAX       =  100;

    define PVAR_ANTIRECOIL      = SPVAR_4;
    define PVAR_AR_ADJUST       = SPVAR_5;
       
    int antirecoil, ar_opt, ar_dir, ar_tmp;
   
    init {
    antirecoil = get_pvar(PVAR_AR_ADJUST,  ANTIRECOIL_RES, ANTIRECOIL_MAX, ANTIRECOIL_DEF);

    int Hold_Time, Rest_Time;
    init {
    Hold_Time = 300 / Rate_Of_Fire;
    Rest_Time = Hold_Time - 20;
    if(Rest_Time < 0) Rest_Time = 0;
}
main {
   
    if(get_val(19)) {
        combo_run(Turbo_1);
    }
    if(get_val(4)) {
        combo_run(Turbo_2);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
    if(get_val(6) && get_val(4)) {
        swap(6, 7);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
     // ANTI-RECOIL
        if(get_val(GAME_FIRE)) {
                combo_run(AntiRecoil);
           
    } // End ANTI-RECOIL
} //End Main Block   <--- was missing

combo Turbo_1 {
    set_val(19, 100);
    wait(40);
    set_val(19, 0);
    wait(40);
    set_val(19, 0);
}

combo Turbo_2 {
    set_val(6, 100);
    wait(Hold_Time);
    set_val(6, 0);
    wait(Rest_Time);
    set_val(6, 0);
}

combo AntiRecoil { // This combo must be the last one
    ar_tmp = get_val(GAME_Y_AIM) + (antirecoil * ar_dir);
    if(ar_tmp > 100) ar_tmp = 100;
    else if(ar_tmp < -100) ar_tmp = -100;
    set_val(GAME_Y_AIM, ar_tmp);
}


Since I couldn't get into a running script successfully, I simply ran it as you sent it to see if it would possibly show me any difference between AutoShot(modifier"xhairs") and using the trigger manually their was no notable difference.
Boo . . . . . . . . . . hoo hoo, this is me crying, why will this silly code not work for me. . . :smile0311:
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Tue Dec 16, 2014 2:45 am

re5lvr wrote:Well I gave it my best at plugging this into one of the working scripts but kept getting error:
> 2: RevelationsV2SxX4T9.gpc* : C:\Users\Mother\Documents\RevelationsV2SxX4T9.gpc
> ERROR line 18: syntax error near unexpected token 'int'.
Build failed with 1 errors ...




Since I couldn't get into a running script successfully, I simply ran it as you sent it to see if it would possibly show me any difference between AutoShot(modifier"xhairs") and using the trigger manually their was no notable difference.
Boo . . . . . . . . . . hoo hoo, this is me crying, why will this silly code not work for me. . . :smile0311:


Fixed it for you and left notes as to what you did wrong so you know in the future. Here it is.

Code: Select all
    define Rate_Of_Fire = 20; // Range: 1 to 25 RPS (Round/s) // Values higher than 25 would be so fast that the game probably will not detect 100% of the events.
    define GAME_Y_AIM           =   10; // RY
    define GAME_Y_MOV           =   12; // LY
    define GAME_FIRE            =    4; // RT

    define ANTIRECOIL_RES       =    1;
    define ANTIRECOIL_DEF       =   35;
    define ANTIRECOIL_MAX       =  100;

    define PVAR_ANTIRECOIL      = SPVAR_4;
    define PVAR_AR_ADJUST       = SPVAR_5;
 
            //VARIABLES
    int antirecoil, ar_opt, ar_dir, ar_tmp;
    int Hold_Time, Rest_Time;     // Variables must come before Initialization
            //INITIALIZATION
init {
    antirecoil = get_pvar(PVAR_AR_ADJUST,  ANTIRECOIL_RES, ANTIRECOIL_MAX, ANTIRECOIL_DEF);
    Hold_Time = 300 / Rate_Of_Fire;
    Rest_Time = Hold_Time - 20;
    if(Rest_Time < 0) Rest_Time = 0//---> Can not have more than one initialization block, combine all into one.



}
main {
   
    if(get_val(19)) {
        combo_run(Turbo_1);
    }
    if(get_val(4)) {
        combo_run(Turbo_2);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
    if(get_val(6) && get_val(4)) {
        swap(6, 7);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
     // ANTI-RECOIL
        if(get_val(GAME_FIRE)) {
                combo_run(AntiRecoil);
           
    } // End ANTI-RECOIL
} //End Main Block   <--- was missing

combo Turbo_1 {
    set_val(19, 100);
    wait(40);
    set_val(19, 0);
    wait(40);
    set_val(19, 0);
}

combo Turbo_2 {
    set_val(6, 100);
    wait(Hold_Time);
    set_val(6, 0);
    wait(Rest_Time);
    set_val(6, 0);
}

combo AntiRecoil { // This combo must be the last one
    ar_tmp = get_val(GAME_Y_AIM) + (antirecoil * ar_dir);
    if(ar_tmp > 100) ar_tmp = 100;
    else if(ar_tmp < -100) ar_tmp = -100;
    set_val(GAME_Y_AIM, ar_tmp);
}
Image
"We always start with completing the difficult. It just takes us a little longer to do the impossible."
Console Tuner Support Team®
User avatar
AKHUGHES90
Major
Major
 
Posts: 927
Joined: Mon Nov 24, 2014 12:19 am
Location: Springfield, IL USA CST (-6:00)

Re: Help with Scripting error.

Postby re5lvr » Wed Dec 17, 2014 5:49 pm

Upon first run, it seems that the B Trigger for the machine gun is not active, the only odd part about that is even if it was not added the B button should cycle the DPad? Okay just confirmed the B button has no programming active, it is default.
I checked the RoF with this Script running and their was no notable difference. I am not sure where to adjust the numbers to test if it is active or not. If this script works I will again play with avail. buttons to move them around so they are best suited for gameplay. ie. the B button is only used to exit out of menus, but when trying to use it for shooting it is a fail overall as you cannot actuate the RStick for aiming purposes if your thumb is on the B button. So I think the remapping of button relative to the use of LB + etc. will be in order to take advantage of the AR Script. I think LB mapped at its current state + RB would be a good fit and in the future if somehow a way to manipulate RoF for a handgun per say were found then LB + RT could be used.
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Wed Dec 17, 2014 6:41 pm

re5lvr wrote:Upon first run, it seems that the B Trigger for the machine gun is not active, the only odd part about that is even if it was not added the B button should cycle the DPad? Okay just confirmed the B button has no programming active, it is default.
I checked the RoF with this Script running and their was no notable difference. I am not sure where to adjust the numbers to test if it is active or not. If this script works I will again play with avail. buttons to move them around so they are best suited for gameplay. ie. the B button is only used to exit out of menus, but when trying to use it for shooting it is a fail overall as you cannot actuate the RStick for aiming purposes if your thumb is on the B button. So I think the remapping of button relative to the use of LB + etc. will be in order to take advantage of the AR Script. I think LB mapped at its current state + RB would be a good fit and in the future if somehow a way to manipulate RoF for a handgun per say were found then LB + RT could be used.



The only 2 turbo combos in this script activate A, and LB. None of the lines in the script point to the B button, Was this a mistake i made when editing it for you? Anti Recoil should work anytime your ADS. As for different fire rate for different weapons, you could use a toggle, I.e. Hold Select and press Dpad Left or Right to lower or raise RoF.(could even have predetermined RoF to cycle between). I don't understand what exactly you need changed in the script. Let me know and ill get it fixed for you. Also the RoF is changed by altering this number below, RoF over 25 for some games does work fine.

Code: Select all
    define Rate_Of_Fire = 20;
Image
"We always start with completing the difficult. It just takes us a little longer to do the impossible."
Console Tuner Support Team®
User avatar
AKHUGHES90
Major
Major
 
Posts: 927
Joined: Mon Nov 24, 2014 12:19 am
Location: Springfield, IL USA CST (-6:00)

Re: Help with Scripting error.

Postby re5lvr » Wed Dec 17, 2014 7:26 pm

Hmm, I will look into it this evening. B button was remapped to DPad Right. No worries I'll try and figure out where it went astray.
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Wed Dec 17, 2014 7:37 pm

Let me know if you need any assistance. Always happy to help. :innocent_smile_1:
Image
"We always start with completing the difficult. It just takes us a little longer to do the impossible."
Console Tuner Support Team®
User avatar
AKHUGHES90
Major
Major
 
Posts: 927
Joined: Mon Nov 24, 2014 12:19 am
Location: Springfield, IL USA CST (-6:00)

Re: Help with Scripting error.

Postby re5lvr » Thu Dec 18, 2014 8:54 am

Will do at some point I am going to have to get the hang of this. I have my thoughts but, really it seems a lot of time is needed to test/play with the variations. I made 4 variants of your latest run 10, 15, 20, 25, and honestly I cannot tell if it is functioning. I want to attempt to add the rapid stab back in there, but I keep going cross-eyed thinking about where what goes and when what will function. Just been to busy the last few days, will hopefully get some time tomorrow. Thanks
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Thu Dec 18, 2014 9:16 am

re5lvr wrote:Will do at some point I am going to have to get the hang of this. I have my thoughts but, really it seems a lot of time is needed to test/play with the variations. I made 4 variants of your latest run 10, 15, 20, 25, and honestly I cannot tell if it is functioning. I want to attempt to add the rapid stab back in there, but I keep going cross-eyed thinking about where what goes and when what will function. Just been to busy the last few days, will hopefully get some time tomorrow. Thanks



Just let me know if you need some help. All else fails you could skype me so we could figure it out. :joia:
Image
"We always start with completing the difficult. It just takes us a little longer to do the impossible."
Console Tuner Support Team®
User avatar
AKHUGHES90
Major
Major
 
Posts: 927
Joined: Mon Nov 24, 2014 12:19 am
Location: Springfield, IL USA CST (-6:00)

Re: Help with Scripting error.

Postby re5lvr » Fri Dec 19, 2014 9:58 pm

Well, I have made every variation I can think of to no avail. the script does not function as an anti recoil combo like the one I had put together at all. I cannot seem to find or make sense of the block covering the Anti recoil commands.

To give an idea I stand in one place and shoot at a door from the bottom to the mid line and count the # of bullets used. I create various modified scripts changing the given numbers from one extreme to another and everything in between and fire for effect. Through 7 variations 9 rounds are all I could get on target. RoF remained the same, hell placement remained the same. and then I took it to Zero(no program/script) and it too was exactly the same?? SMN

below is one of the variations and I just don't know what to try next?

Code: Select all
    define Rate_Of_Fire = 20; // Range: 1 to 25 RPS (Round/s) // Values higher than 25 would be so fast that the game probably will not detect 100% of the events.
    define GAME_Y_AIM           =   10; // RY
    define GAME_Y_MOV           =   200; // LY
    define GAME_FIRE            =    4; // RT

    define ANTIRECOIL_RES       =    1;
    define ANTIRECOIL_DEF       =   35;
    define ANTIRECOIL_MAX       =  100;

    define PVAR_ANTIRECOIL      = SPVAR_4;
    define PVAR_AR_ADJUST       = SPVAR_5;
 
            //VARIABLES
    int antirecoil, ar_opt, ar_dir, ar_tmp;
    int Hold_Time, Rest_Time;     // Variables must come before Initialization
            //INITIALIZATION
init {
    antirecoil = get_pvar(PVAR_AR_ADJUST,  ANTIRECOIL_RES, ANTIRECOIL_MAX, ANTIRECOIL_DEF);
    Hold_Time = 300 / Rate_Of_Fire;
    Rest_Time = Hold_Time - 20;
    if(Rest_Time < 0) Rest_Time = 0//---> Can not have more than one initialization block, combine all into one.



}
main {

    if(get_val(4)) {
        combo_run(Turbo_2);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
    if(get_val(6) && get_val(4)) {
        swap(6, 7);
    }else if (get_val(6) > 1) {
    set_val(4, 100);
    }
     // ANTI-RECOIL
        if(get_val(GAME_FIRE)) {
                combo_run(AntiRecoil);
           
    } // End ANTI-RECOIL
} //End Main Block   <--- was missing

combo Turbo_2 {
    set_val(6, 100);
    wait(Hold_Time);
    set_val(6, 0);
    wait(Rest_Time);
    set_val(6, 0);
}

combo AntiRecoil { // This combo must be the last one
    ar_tmp = get_val(GAME_Y_AIM) + (antirecoil * ar_dir);
    if(ar_tmp > 100) ar_tmp = 100;
    else if(ar_tmp < -100) ar_tmp = -100;
    set_val(GAME_Y_AIM, ar_tmp);
}
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

PreviousNext

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 85 guests