[Tool] GPC2 Combos to Macro File

Gtuner IV general support. Operation, questions, updates, feature request.

[Tool] GPC2 Combos to Macro File

Postby PoshLemur » Sun May 27, 2018 11:20 pm

Tonight I release my mostly complete (fully functional) GPC2 script to GMK (macro file) converter.
I had plans to make it more robust but I haven't gone about sprucing it up or fixing the known issues,
and don't know if I will.

You can pass it a GPC2 script and it will extract each combo in the script, converting them into a GMK macro files.

So I release it as is:
https://github.com/PoshLemur/GPC2Macro

Please let me know what you think!
Be sure to read the readme on github, as there are some rather important assumptions!
Last edited by PoshLemur on Mon May 28, 2018 10:44 am, edited 2 times in total.
My github account: [link]
User avatar
PoshLemur
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Thu Mar 08, 2018 9:26 am

Re: [Tool] GPC2 Script to Macro File

Postby antithesis » Mon May 28, 2018 7:33 am

Thanks for your contributions of late. This will help to push the Macro development along :)
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: [Tool] GPC2 Script to Macro File

Postby Scachi » Mon May 28, 2018 9:50 am

Great work !

I miss the word "combo" in the description a bit.
When I read the title I was wondering how a script should be able to be converted into a macro file.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: [Tool] GPC2 Script to Macro File

Postby PoshLemur » Mon May 28, 2018 10:42 am

Thanks! :)

Oh you're right! I really did fail to specify combos anywhere.
My github account: [link]
User avatar
PoshLemur
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Thu Mar 08, 2018 9:26 am

Re: [Tool] GPC2 Combos to Macro File

Postby Sillyasskid » Mon May 28, 2018 8:52 pm

Might have wanted to comment out the printf("Hello!"); in the testcombo3.gpc
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: [Tool] GPC2 Combos to Macro File

Postby PoshLemur » Mon May 28, 2018 9:44 pm

Sillyasskid wrote:Might have wanted to comment out the printf("Hello!"); in the testcombo3.gpc


The converter is supposed to loudly abort a combo's conversion if invalid commands are present.
The test scripts are just that, they're there to automatically test that the converter is functioning properly.

On that note though. The printf commands are located within a function and the main loop, both of which are completely ignored by the converter because neither are in a combo. The idea being that you can convert a full fledged script's combos into macros with minimum effort; assuming that is that they are well formed. I had plans to implement some dictionaries for console identifiers PS4_, XBX_, etc. Just haven't gotten around to it yet.
My github account: [link]
User avatar
PoshLemur
Sergeant Major
Sergeant Major
 
Posts: 75
Joined: Thu Mar 08, 2018 9:26 am

Re: [Tool] GPC2 Combos to Macro File

Postby Sillyasskid » Mon May 28, 2018 10:19 pm

I see. that makes more sense. :smile0517:
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: [Tool] GPC2 Combos to Macro File

Postby antithesis » Mon May 28, 2018 10:54 pm

PoshLemur wrote: I had plans to implement some dictionaries for console identifiers PS4_, XBX_, etc. Just haven't gotten around to it yet.

Is that necessary? Index values / button IDs would be simpler as that's what the compiler will use.
Official Australian retailer for Titan One, Titan Two and XIM APEX at Mod Squad
User avatar
antithesis
Colonel
Colonel
 
Posts: 1912
Joined: Sat May 28, 2016 10:45 pm

Re: [Tool] GPC2 Combos to Macro File

Postby Sillyasskid » Mon May 28, 2018 11:35 pm

Also if the users does not actually include a header with different defined button alias like xb1.gph or ps4.gph then the compiler won't compile with the XB1_ or PS4_ alias's.

Aside from the #define method to create the button aliases, the user also can also manually declare a uint8 variable to represent a button, and use that variable freely within their script.

Your program should work with this
Code: Select all
#define FIRE BUTTON_5


But not with this
Code: Select all
uint8 FIRE = BUTTON_5;
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am


Return to Gtuner IV Support

Who is online

Users browsing this forum: monteruntheplay and 130 guests