Help with Scripting error.

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

Help with Scripting error.

Postby re5lvr » Sun Dec 14, 2014 3:45 am

Hi, I am still working on trying to create a usable Script for Resident Evil So many of the wants are lost without running hacks.
I am trying to create a combo that will act like a recoil reducer. Using a machine gun with heavy recoil causes it to climb and drift (naturally). When playing I tap RS downward for 1/10th a sec every 1/2 sec. while firing my full auto AK.
I have been reading on trying to set this up and I keep getting an error on line 30(combo Turbo_1 line) which actually has nothing to do with my combo?? Below is my script which is one "akhughes90" has been helping me with. I am adding Turbo_3 which I want B/18 to swap(remap) to RT/4 and initiate/run Turbo_4 which is RY/10 for let's say 10ms every .5 sec. P.S. I cannot figure out which "wait" in the turbo section equals depress time and which is time to next event? If that is even right? ">_<"

Here is the error message:
> 2: RevelationsV2SxX4T.gpc* : C:\Users\Mother\Documents\RevelationsV2SxX4T.gpc
> ERROR line 30: syntax error near unexpected token 'combo'.
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.
   

    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);
    }
    if(get_val(18)) {
        combo_run(Turbo_3);
}

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

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

combo Turbo_3 {
    call (turbo_4)
    set_val(4, 100);   
    wait(0);
    set_val(4, 0);
    wait(0);
    set_val(4, 0);
}

combo Turbo_4
    set_val(10, 100);
    wait(30);
    set_val(10, 0);
    wait(400);
    set_val(10, 0);
}
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Sun Dec 14, 2014 4:35 am

I have been reading on trying to set this up and I keep getting an error on line 30(combo Turbo_1 line) which actually has nothing to do with my combo??
This means that your main block was not closed. below is your script fixed, there were a few other errors also, which i fixed and left a note explaining why.


I am adding Turbo_3 which I want B/18 to swap(remap) to RT/4 and initiate/run Turbo_4 which is RY/10 for let's say 10ms every .5 sec.

Have you tried the weapon with another gamepack that has anti recoil to see if those values worked to suit your game? If so i could add that combo in for you.

P.S. I cannot figure out which "wait" in the turbo section equals depress time and which is time to next event?


a value of 100 is fully pressed, where a value of 0 is not pressed at all. So the number between set_val, 100 and set_val, 0 is the button depressed(hold time) and the value after the first set_val, 0 is the wait time.

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.
   
    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);
    }
    if(get_val(18)) {
        combo_run(Turbo_3);
    } // End Turbo_3
} //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(4, 100);
    wait(Hold_Time);
    set_val(4, 0);
    wait(Rest_Time);
    set_val(4, 0);
}

combo Turbo_3 {
    call (Turbo_4) //Not capitalized like below.
    set_val(4, 100);   
    wait(10); //    Wait values cannot be below 10(if you want wait 0 just dont put anything here)
    set_val(4, 0);
    wait(10); //    Wait values cannot be below 10(if you want wait 0 just dont put anything here)
    set_val(4, 0);
}

combo Turbo_4 { //  <--- Missing opening bracket
    set_val(10, 100);
    wait(30);
    set_val(10, 0);
    wait(400);
    set_val(10, 0);
}
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 » Sun Dec 14, 2014 4:50 am

oH hell, man I tell you what I am going by what I see used in my many other Scripts and some of those things I don't have. . . Well atleast not in the same places(multiple lines away for the brackets) Sad day. I hope this does what I was looking for I can play with the timing (which I know I will have to do) to try and get it right. Here's hoping!?!

My next thought it to setup an actual combo, where it initiates a hold of LB(LT +RT) and while the Magnum is charging it is stabbing and with the right timing it should stab 4 times then fire the fully charged magnum. I don't really think it is possible as the controls are so linear it's not funny, but a guy can always dream!
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Sun Dec 14, 2014 5:00 pm

if charging the magnum, does the game still recognize you stabbing without resetting the charge?
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 » Sun Dec 14, 2014 5:42 pm

Only using LB, holding LT + RT fires every second. I kno there's a way to negate it in combo commands. The anti recoil worked great aiming at a light switch. Not so much at bad guys. Since it uses RY you lose the ability to use the right stick for adjusting direction with the bad guy. : (

P.S. earlier you asked if I had tried any gamepacks for function. Only the turbo one you mentioned, I would have o know which game run time commands in their RoF.
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Sun Dec 14, 2014 6:17 pm

earlier you asked if I had tried any game packs for function. Only the turbo one you mentioned, I would have o know which game run time commands in their RoF.

For instance try my Halo MCC (H1,H2A,H3,H4) gamepack and only enable the anti recoil option. If that works well with your game, you can post your script and ill add it for you.

My next thought it to setup an actual combo, where it initiates a hold of LB(LT +RT) and while the Magnum is charging it is stabbing and with the right timing it should stab 4 times then fire the fully charged magnum.


Only using LB, holding LT + RT fires every second. I know there's a way to negate it in combo commands.


If i understand what your doing with your current combo, holding LB performs a rapid RT pull, and holding LB + RT swaps LT & LB so your effectively doing the same as holding both triggers. Which one of these actions charges the Magnum? Also where does your stab fit in? A button?
I don't completely understand the in game buttons you macroing, This may do what your asking but i could have it activating the wrong combos, i left you some notes.
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.
   
    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)) { // I'm guessing this charges your Magnum?
        swap(6, 7);
    }else if (get_val(6) > 1) {  // I'm guessing this is to run dual rapid fire?
        set_val(4, 100);
    }else if(get_val(6) > 1 && get_val(19)) {   // Change value = 6 to Magnum Charge Button, Change value = 19 to Rapid Stab Button
        swap(6, 7);
        set_val(4, 100);
        combo_run(Turbo_1);  // Change this to Rapid Stab Turbo combo if not correct
    }
    if(get_val(18)) {
        combo_run(Turbo_3);
    } // End Turbo_3
} //End Main Block   

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

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

combo Turbo_3 {
    call (Turbo_4) //Not capitalized like below.
    set_val(4, 100);   
    wait(10); //    Wait values cannot be below 10(if you want wait 0 just dont put anything here)
    set_val(4, 0);
    wait(10); //    Wait values cannot be below 10(if you want wait 0 just dont put anything here)
    set_val(4, 0);
}

combo Turbo_4 { //  <--- Missing opening bracket
    set_val(10, 100);
    wait(30);
    set_val(10, 0);
    wait(400);
    set_val(10, 0);
}
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 » Sun Dec 14, 2014 7:18 pm

LB-nothing, RB-throw grenade, LT-ADS, RT-stab, LT+RT-ADS+fire, A-voice(all right!/you suck), B-action, X-reload, Y-voice(wait/go), LS-fwd/bck/straife(l-r), RS-turn(l-r)/look(up-dwn), UP/DOWN-cycle grenade types, LEFT/RIGHT- cycle weapons.
Weapons have given/variable RoF's.
e.g. pistol =1.3-6 RoF
Sub/mach gun = 3-15++ 30 RoF
Magnum = .37-2.5 RoF
Each weapons has up to 6 slots for in-game modifiers, like RoF1-4 which will increase RoF by a given %, or capacity increase 1-10=10-100% increase, Charge 1 or 2(press & hold)damage x2/x5, Damage1-5, etc.

P.S. semi auto fire=LB hold + RTpress & release, unless you have Auto-Shot modifier loaded then if will fire weapon automatically when crosshairs cross target by just holding LT.

Got all that!?!
Hope this makes it a little clearer!
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Sun Dec 14, 2014 7:57 pm

What button do you hold to charge the magnum? Will the game allow a stab to be performed while charging?
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 » Mon Dec 15, 2014 1:03 am

sadly I don't know if it will or will not. To charge the Magnum you have to press and hold left trigger right trigger. But with the LB, functioning as those two at the same and somehow negating the right trigger turbo I am hoping that I would be able to use a different command such as staff whilst those two are working under LB. I have my doubts such as with anti recoil combo while the combo is running right stick you do not have the ability to use right stick.
User avatar
re5lvr
First Sergeant
First Sergeant
 
Posts: 64
Joined: Thu Dec 11, 2014 1:12 am

Re: Help with Scripting error.

Postby AKHUGHES90 » Mon Dec 15, 2014 1:48 am

Anti Recoil should still let you function the RS. try this combo....


Code: Select all
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);
}

main {
       // ANTI-RECOIL
        if(get_val(GAME_FIRE)) {
                combo_run(AntiRecoil);
           
        }
}


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)

Next

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 44 guests