Elvish Script Conversion

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

Elvish Script Conversion

Postby titanone_fan » Sun Sep 11, 2016 3:20 pm

Hey all,

Sorry to bug but looking for some help. I'm trying to revise/convert an Elvish script to work on T2. The script is below. I'm stuck on an identifier not declared error. Any direction/assistance you can provide for the conversion would be greatly appreciated. Apologies for the long code help and my newbness around this :) . Thanks very much.

Code: Select all

removed
Last edited by titanone_fan on Mon Sep 12, 2016 11:28 am, edited 1 time in total.
titanone_fan
First Sergeant
First Sergeant
 
Posts: 57
Joined: Mon Aug 22, 2016 3:04 pm

Re: Elvish Script Conversion

Postby The_Rabid_Taco » Sun Sep 11, 2016 4:35 pm

Add the following line to your variable declarations:

Code: Select all
int16 Max_Random;


It wasn't defined anywhere that I could see.
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Elvish Script Conversion

Postby titanone_fan » Mon Sep 12, 2016 12:29 am

Thanks. That corrected that error, but now I'm going to see the following error a few times:
GPC error: xxxx.gpc(169): syntax error, unexpected T, expecting C or P_E ';'.


The above relates to the following (rows 168 to 172 included):

Code: Select all

   //Reset all persistant variables if start is held down for 4 seconds
    if(get_ptime(Start_Button) >= 4000 && get_val(Start_Button) == 100 && !get_val(Left_Stick_Click)){
        combo_run(Notification_Rumble);
        combo_run(ResetPvars);
    }


What is the compiler expecting?

Thanks.
titanone_fan
First Sergeant
First Sergeant
 
Posts: 57
Joined: Mon Aug 22, 2016 3:04 pm

Re: Elvish Script Conversion

Postby PaulaTheKoala » Mon Sep 12, 2016 1:22 am

It appears the script you posted is missing a few things, I went ahead and used the script located here: http://www.consoletuner.com/gpclib/?s=1017

Conversion steps:

1. Add the following to the start of the script:

Code: Select all
#include <T1.gph>


2. Search for "^define" and replace all with "int". (without the quotes)

3. Locate the following line "LW_ActionFiveOn = !LW_ActionFiveOn" and make sure it ends with a semi-colon. (";")
User avatar
PaulaTheKoala
Command Sergeant Major
Command Sergeant Major
 
Posts: 131
Joined: Wed Aug 26, 2015 3:45 am

Re: Elvish Script Conversion

Postby J2Kbr » Mon Sep 12, 2016 1:33 am

Omg ... Really, omg... I have never told to any one that regular expressions can be used on the search, and you figure out. impressed. :shocked:
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Elvish Script Conversion

Postby PaulaTheKoala » Mon Sep 12, 2016 2:21 am

J2Kbr wrote:Omg ... Really, omg... I have never told to any one that regular expressions can be used on the search, and you figure out. impressed. :shocked:


I was looking for a regex option but couldn't find one so I figured I'd try it and see If it supported it, glad to see it does. :joia:
User avatar
PaulaTheKoala
Command Sergeant Major
Command Sergeant Major
 
Posts: 131
Joined: Wed Aug 26, 2015 3:45 am

Re: Elvish Script Conversion

Postby titanone_fan » Mon Sep 12, 2016 4:57 am

@PaulaTheKoala, thanks very much. Compiled with no warnings. Cheers.
titanone_fan
First Sergeant
First Sergeant
 
Posts: 57
Joined: Mon Aug 22, 2016 3:04 pm

Re: Elvish Script Conversion

Postby UK_Wildcats » Mon Sep 12, 2016 3:57 pm

J2Kbr wrote:Omg ... Really, omg... I have never told to any one that regular expressions can be used on the search, and you figure out. impressed. :shocked:


LMAO. That was the first thing that I used in converting my BO3 script. LOL
User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Elvish Script Conversion

Postby J2Kbr » Mon Sep 12, 2016 4:02 pm

Nice!!! You guys are really quickly. :) and I was here, planning in making a surprise for you all ... Lol
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 99 guests

cron