Page 1 of 5

Convert Titan One scripts to Titan Two the easy way

PostPosted: Thu Dec 28, 2017 12:30 pm
by Scachi
This is a small tutorial on how to use the header file #include <titanone.gph> to convert the script "black_ops_super_snake_glitch.gpc" to the Titan Two.

If you just need the basic steps scroll down to the section Summary - How to convert T1/CM scripts:

Step One: Creating a new minimum GPC script file
  1. Start GTuner IV
  2. File->New->Minimum GPC Script
  3. Save this new file into a new directory, I name the directory according to the scripts name: "black_ops_super_snake_glitch". The filename: "black_ops_super_snake_glitch"
    1_create.png
    1_create.png (11.43 KiB) Viewed 31181 times
  4. The created file should now be opened in the "GPC Scrip IDE" pane
  5. Keep just the first line (#pragma....), delete everything else.
  6. Add this line:
    Code: Select all
    #include <titanone.gph>

    Note: Put all the #include lines (if more are required) directly below this #include line.
  7. Put in a description with a link/information to the original scripts author, he/she deserves it, the full file content for now:
    Code: Select all
    #pragma METAINFO("black_ops_super_snake_glitch", 1, 0, "yournameappearshere")
    #include <titanone.gph>
     
    /*
    Black Ops Super Snake Glitch Script 1.0 by bonefisher
    http://www.consoletuner.com/gpclib/?s=1170
    converted to the Titan Two by Scachi
    */

     
  8. Hit the Compile button, no error should occur in the "Output Panel": GPC success: GPC Compile succeeded with 0 warning(s).
  9. Fine, continuing...

Step Two: The original T1 script file I want to convert
  1. Download the script from the GPC Library http://www.consoletuner.com/gpclib/?s=1170 and save it as black_ops_super_snake_glitch_org.gpc into the directory "black_ops_super_snake_glitch" (created in Step One)
  2. Open the file in GTuner IV

Step Three: The actual work
  1. Copy all the content from the original script at the end of our work file
  2. Hit the Compile button, no error should occur in the "Output Panel": GPC success: GPC Compile succeeded with .. warning(s).
    3_done.png
    3_done.png (14.28 KiB) Viewed 31181 times
  3. Done ;-) Install the script to a slot of your T2 with the Install button and have fun with it.
    4_install.png
    4_install.png (7.04 KiB) Viewed 31178 times
  4. Here is the full script content of the version for the Titan2
    Code: Select all
    #pragma METAINFO("black_ops_super_snake_glitch", 1, 0, "username")
    #include <titanone.gph>
     
    /*
    Black Ops Super Snake Glitch Script 1.0 by bonefisher
    http://www.consoletuner.com/gpclib/?s=1170
    converted to the Titan Two by Scachi
    */

     
     
    // GPC Online Library
    // black_ops_super_snake_glitch.gpc
     
     
     // ADS TRIGGER + D-PAD LEFT TURNS IT ON/OFF.
     // SNAKES IN ALL DIRECTIONS!
     
    define ADS          =  7;
    define D_PAD_LEFT   = 15;
    define JUMP         = 19;
    define CROUCH       = 18;
     
    int snake;
     
    init {
    snake = get_pvar(SPVAR_1, 1, 2, 2);
    }
     
    main {
     
        if (get_val(ADS) && event_press(D_PAD_LEFT)) {
            if (snake == 1) {
                snake = 2;
            } else if (snake == 2) {
                snake = 1;
            }
            set_pvar(SPVAR_1, snake);
     
            if (snake == 1) {
                combo_run(RumbleNotifier);
            }
        }
        if (snake == 1) { combo_run(Snaking); }
    }
     
    combo RumbleNotifier {
        set_rumble(RUMBLE_A, 100);
        wait(200);
        reset_rumble();
    }
     
    combo Snaking                {
        set_val     (CROUCH, 100);
        wait                (150);
        set_val     (CROUCH, 100);
        set_val       (JUMP, 100);
        wait                (100);
        set_val     (CROUCH, 100);
        set_val         (JUMP, 0);
        wait                (100);
        set_val     (CROUCH, 100);
        set_val       (JUMP, 100);
        wait                (100);
        set_val       (CROUCH, 0);
        set_val         (JUMP, 0);
        wait                (100);
    }
     

--> For another step by step script conversion click here <--

Summary - How to convert T1/CM scripts:
1.: ! Keep the information of the original script author name/url , they did the hard work, you are just converting it.
2.: Add the line below to the very top of the existing script:
Code: Select all
#include <titanone.gph> 

3.: Hit the Compile button
4.: Check the Output panel for error message. If error are found read the common problems/error messages below.


Some typical GPC errors "Output Panel" messages
The number in brackets (60) is the line number of the script where the error is found.
Doubleclick on the error line in the output panel should jump to the corresponding line in the script.
  1. Code: Select all
    GPC error: example.gpc(120): syntax error, unexpected SETVAL, expecting T 'set_val'.

    or
    Code: Select all
    GPC error: conv.gpc(665): syntax error, unexpected B_E, expecting T '}'.
    or syntax error in general.
    The first thing to check if the line mentioned or the previous line ends with a ; character where it should - The Titan Two requires a ; at the end of almost all lines that doesn't end with a } or {
    The T1 did allow a line ending without a ; and it even accepted a : so be careful when checking this.

  2. Code: Select all
    GPC error: example.gpc(133): Illegal operation 'arg:1'.

    This is probably a function being called with an argument, to make this work the function definition itself has to be edited.
    Basically every argument has to be prefixed with "int".
    Try to find the function definition in the code, the line you are looking for should start with "function" followed by the name of the function as it is called in line 133.
    Example:
    Code: Select all
    function ExampleFunc( a, b, c)
    should be edited to read
    Code: Select all
    function ExampleFunc(int a, int b, int c)


  3. Code: Select all
    GPC error: example.gpc(124): Invalid symbol redefinition 'LeanRight'

    This is caused by using the same name for different things twice. Like for a variable and a combo. We have to change the name of one of them.
    Renaming the combo by prefixing it with c is the way I do this. Take note of the combo name you have changed as we need to do the renaming in several other places later.
    Jump to the line by a double click on the error message.
    Example:
    Code: Select all
    combo LeanRight {//FastLeanRight
    should be changed to read
    Code: Select all
    combo cLeanRight {//FastLeanRight
    After doing the changes hit the Compile button and check the output panel for errors.

  4. Code: Select all
    GPC error: example.gpc(66): Identifier is not a combo 'LeanLeft'.

    This is most likely the result of renaming a combo to solve a redefinition error.
    When we have renamed LeanLeft to cLeanLeft like in the example above we need to changes all combo commands to use the correct name now.
    Search for the old name: "combo_.*LeanLeft" (without the quotes) and manually edit each occurrence of LeanLeft in a combo_whatever(LeanLeft) command to combo_whatever(LeanLeft) like this:
    Code: Select all
    combo_run(LeanLeft)
    changed to read
    Code: Select all
    combo_run(cLeanLeft)
    Press F3 to jump to the next occurrence and change the name until you are done.

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Wed Jan 10, 2018 4:03 pm
by J2Kbr
wow, wow ... this is amazing. Thank you so much for taking time in making this excellent tutorial.

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Wed Jan 10, 2018 11:54 pm
by Scachi
No problem, it wasn't taking much time as I could use my old t1.gph tutorial as a start and it only needed a few small changes :wink:

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Mon Jan 29, 2018 12:08 am
by dompayne7511
Im having tourblw. im following you tutorial excatly and i keep getting this error message:

GPC error: Fortnite double pump.gpc(2): Can't open include file 'titanone.gph'
GPC: GPC Compile ABORTED with 0 warning(s) and 1 error(s).

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Mon Jan 29, 2018 8:54 am
by J2Kbr
make sure the include line is exactly as this:
Code: Select all
#include <titanone.gph>

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Mon May 28, 2018 1:25 am
by Bushido_24
i need help converting tt1 scripts im getting this error

GPC error: TT DUAL SMG.gpc(128): Identifier not declared 'R_SKILL'.
GPC error: TT DUAL SMG.gpc(128): Illegal variable initialization 'Heal_BTN'.
GPC error: TT DUAL SMG.gpc(153): syntax error, unexpected IDENTIFIER 'define'.

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Mon May 28, 2018 6:31 am
by Scachi
Have you read the first post in this thread and added the line
Code: Select all
#include <titanone.gph>

to the top of the script you are trying to convert ?

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Mon May 28, 2018 7:13 am
by Bushido_24
Scachi wrote:Have you read the first post in this thread and added the line
Code: Select all
#include <titanone.gph>

to the top of the script you are trying to convert ?



yeah i added the line and still not working maybe u can help me with that if not to much to ask
i can give u the scripts that i wanna convert

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Tue May 29, 2018 12:38 pm
by J2Kbr
Bushido_24 wrote:yeah i added the line and still not working maybe u can help me with that if not to much to ask
i can give u the scripts that i wanna convert

you can also PM the script to me.

Re: Convert Titan1 scripts to Titan2 the easy way

PostPosted: Tue Aug 28, 2018 11:59 pm
by W168
Hello there.

I created the script and got this
https://imgur.com/a/7mst2ek no options to configure, is this right?

There is a way for you guys to convert the script and post the titan 2 version on the on-line resources?
Is more user friendly :-)