Elder Scrolls Online [PS4]- New Script Help!! New User!

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

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby RedactedFA » Wed Sep 04, 2019 10:08 pm

Scachi wrote:
RedactedFA wrote:
You can try to add them yourself as you can compare the existing one to your description.
Copy+modify it to match the other ones. Each section, the set_val() stuff between the wait() lines, should match one section of your ,button, description.
For multiple button pressed at the same time , button+button, just add another set_val to the matching wait section.



So where do I add the second "main" and second "combo"? I have the first one working flawlessly :innocent_smile_1:
User avatar
RedactedFA
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Thu Aug 29, 2019 7:32 pm

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby Scachi » Wed Sep 04, 2019 10:29 pm

RedactedFA wrote:
Scachi wrote:
RedactedFA wrote:
You can try to add them yourself as you can compare the existing one to your description.
Copy+modify it to match the other ones. Each section, the set_val() stuff between the wait() lines, should match one section of your ,button, description.
For multiple button pressed at the same time , button+button, just add another set_val to the matching wait section.



So where do I add the second "main" and second "combo"? I have the first one working flawlessly :innocent_smile_1:

Very good :smile0517:

you can extend the existing main and copy the combo yourname { } and rename it then.
copy the two existing lines "if (event_active....." and "if (Combo1ATK)..."
and paste them below the existing ones.
change the button you want to use for your new combo and change the name to the name of your new combo
Copy the complete existing "combo Combo1ATK " (all the lines of it) and rename it , same name as done above

You should end up with something like this
Code: Select all
 
#include <ps4.gph>
 
#define WAIT_RELEASE 20 // time the button are released before the next section gets pressed
#define WAIT_TAP 20     // short press
#define    WAIT_PRESS 2000 // long press (charge)
 
main {
    if (event_active(PS4_SQUARE)) combo_run(Combo1ATK);
    if (Combo1ATK) InputLock(); // as long the combo is running you can set buttons/input not send to the console
        // the combo is still able to press the buttons and send them to the console
 
    if (event_active(PS4_TRIANGLE)) combo_run(ComboDefense);
    if (ComboDefense) set_val(PS4_TRIANGLE,0); // as long the combo is running do not send the triangle button pressed manually
}
 
// the buttons/inputs to lock
// set_val(BTNNAME,VALUE)  , VALUE 0 when button should be released, VALUE 100 when button should be pressed
void InputLock() {
    set_val(PS4_SQUARE,0);
    // ... more buttons ?
}
 
// set_val(BTNNAME,VALUE)  , VALUE 0 when button should be released, VALUE 100 when button should be pressed
// combos:
//     each "wait(time);" line defines one section
//     when the time of one section has elapsed -> the next section gets run
// all buttons/set_val in the same section are pressed at the same time for the time the wait() specifies
 
//R2, L1, L2, R2, Square, L2, R2, Triangle, L2, R2(hold2s/release), circle, L2, R2
combo Combo1ATK {
    // your already working combo here
}
 
//Combo 2 Defense
// R2, Square, L2, R2, Triangle, L2, R2, Circle, L2, R2, L1, R3
combo ComboDefense {
    set_val(PS4_R2,100);
    wait(WAIT_TAP); // press
    wait(WAIT_RELEASE); // release : empty section : nothing pressed by code
    set_val(PS4_SQUARE,100);
    wait(WAIT_TAP); // press
    wait(WAIT_RELEASE); // release
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_TRIANGLE,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_CIRCLE,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L1,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R3,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
}
 
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby RedactedFA » Sun Sep 08, 2019 2:11 am

OK so.. code works pretty well. What line of code can I add to hit the combo button again to cancel?
User avatar
RedactedFA
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Thu Aug 29, 2019 7:32 pm

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby Mad » Sun Sep 08, 2019 2:41 am

Code: Select all
#include <ps4.gph>
 
#define WAIT_RELEASE 20 // time the button are released before the next section gets pressed
#define WAIT_TAP     20     // short press
#define WAIT_PRESS   2000 // long press (charge)
 
main {
    if (event_active(PS4_SQUARE)) {
      if (Combo1ATK) combo_stop(Combo1ATK);
      else combo_run(Combo1ATK);
    }
    if (Combo1ATK) InputLock(); // as long the combo is running you can set buttons/input not send to the console
        // the combo is still able to press the buttons and send them to the console
 
    if (event_active(PS4_TRIANGLE)) {
      if (ComboDefense) combo_stop(ComboDefense);
      else combo_run(ComboDefense);
    }
    //if (ComboDefense) set_val(PS4_TRIANGLE,0); // as long the combo is running do not send the triangle button pressed manually
}
 
// the buttons/inputs to lock
// set_val(BTNNAME,VALUE)  , VALUE 0 when button should be released, VALUE 100 when button should be pressed
void InputLock() {
    set_val(PS4_SQUARE,0);
    // ... more buttons ?
}
 
// set_val(BTNNAME,VALUE)  , VALUE 0 when button should be released, VALUE 100 when button should be pressed
// combos:
//     each "wait(time);" line defines one section
//     when the time of one section has elapsed -> the next section gets run
// all buttons/set_val in the same section are pressed at the same time for the time the wait() specifies
 
//R2, L1, L2, R2, Square, L2, R2, Triangle, L2, R2(hold2s/release), circle, L2, R2
combo Combo1ATK {
    // your already working combo here
}
 
//Combo 2 Defense
// R2, Square, L2, R2, Triangle, L2, R2, Circle, L2, R2, L1, R3
combo ComboDefense {
    set_val(PS4_R2,100);
    wait(WAIT_TAP); // press
    wait(WAIT_RELEASE); // release : empty section : nothing pressed by code
    set_val(PS4_SQUARE,100);
    wait(WAIT_TAP); // press
    wait(WAIT_RELEASE); // release
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_TRIANGLE,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_CIRCLE,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R2,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_L1,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
    set_val(PS4_R3,100);
    wait(WAIT_TAP);
    wait(WAIT_RELEASE);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby RedactedFA » Tue Sep 10, 2019 4:20 pm

OK, How can I write a command to flip the camera 180 degrees? Like swiftly turn the camera to look behind you? Right Stick ---> 180
User avatar
RedactedFA
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Thu Aug 29, 2019 7:32 pm

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby Scachi » Tue Sep 10, 2019 5:22 pm

Create a combo containing set_val(PS4_RX,100); or PS4_LX , the one you need and add a wait(200);

then you need to adjust the timing until it matches a 180 turn for your sensitivity settings.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby RedactedFA » Tue Sep 17, 2019 6:12 pm

How would I write a rapid fire code for R2, without it interfering with a combo that uses R2?

Thanks :smile0201:
User avatar
RedactedFA
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Thu Aug 29, 2019 7:32 pm

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby Scachi » Wed Sep 18, 2019 7:32 pm

RedactedFA wrote:How would I write a rapid fire code for R2, without it interfering with a combo that uses R2?

Thanks :smile0201:

That one is a bit hard to answer without knowing when the combos are used.
You can avoid the rapid fire combo to start when the other one is already running or you can stop the rapid fire combo when the other one starts.

check for a running combo with
Code: Select all
if (comboname) {  }

or for not running:
Code: Select all
if (!comboname) { }

you can stop another combo by calling combo_stop(comboname);


The order of the combo declaration matters. The order of calling the combos in main doesn't.
Code like this:
Code: Select all
 
main {
 combo_run(c2);
 combo_run(c1);
}
 
 
// declarations
combo c1 { set_val(BUTTON_5,0); }
combo c2 { set_val(BUTTON_5,100); }
 

Will end up pressing BUTTON_5 all the time as the last combo run is c2 which sets the button to pressed.

So declaring your rapid fire combo above your other combo and have your other one set BUTTON_5 to 0 in each wait segment where it shouldn't be pressed and 100 where it should be pressed will work as it will overwrite the rapids set_val(BUTTON_5,value ); in this case.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby RedactedFA » Sun Sep 22, 2019 5:35 am

Ok I think I understand and that answers one question.

How do I actually write the rapid fire code so RT (RightTrigger) is pulled and released as fast as possible when I HOLD it down. Current normal function when held down is a charged shot and when simply pulled and released it is single shot like semi-auto.

Thanks for your help!
User avatar
RedactedFA
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Thu Aug 29, 2019 7:32 pm

Re: Elder Scrolls Online [PS4]- New Script Help!! New User!

Postby Scachi » Sun Sep 22, 2019 6:26 am

Take a look at the examples of the gpc scripting section of the wiki:
https://www.consoletuner.com/wiki/index ... rapid_fire
https://www.consoletuner.com/wiki/index ... rapid_fire

"Fastest" depends on the game so you have to test what works for you by changing the wait times.

I would use the "by value" version or a modfied version of it.
If you pull rt only a bit it does rapid fire, pulling it more than the RapidLimit will do normal charge.
You can iverse the logic if you want to do it the other way around. WHen you want to rapid fire on full pull and normal fire on less than full.

Or use the toggle version and toggle it on when you want to use it.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Previous

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 170 guests