Replacement for GSC.EXE in TS2009 or TS2010?

pcas1986

Well-known member
All,
I'm setting up an environment for editing scripts and one suggestion from the TrainDev site says to use GSC.EXE for preliminary script checking - mostly syntax checking I think.

GSC.EXE does not appear to be installed for TS2009 or TS2010 but was for TS2006. Does anyone know if I can use GSC from TS2006 for TS2010 scripts? I was a bit concerned it might rely on DLLs from TS2006.

There was a discussion about GSC on the TrainDev forum but it didn't answer my question.

TIA
Paul

Further to the above, I've tried the GSC from TS2006 and it is reporting parsing errors in standard TS2010 scripts. I had a look at a couple but the reasons for the errors are not obvious. Besides I'd be reluctant to change any standard scripts.

This suggests there might be a later version of GSC or a replacement compiler.
 
Last edited:
It's now part of the TrainzUtil.exe available in the bin folder. Open a commandline window, navigate to the bin folder, and enter TrainzUtil /? to get a listing of all options.

Peter
 
It's now part of the TrainzUtil.exe available in the bin folder. Open a commandline window, navigate to the bin folder, and enter TrainzUtil /? to get a listing of all options.

Peter

Thanks. I saw some references to TrainzUtil but when I ran it the output seemed to indicate it was mostly for database/asset maintenance. Perhaps I should have read ALL the options.:o

Cheers
Paul
 
hi how would I use this to check for errors like the old GSC.exe did

Code:
@echo off
set gsc="C:\N3V Games\TS12\Bin"
set include="C:\N3V Games\TS12\Scripts"
%gsc%\TrainzUtil.exe %1 -i%include% -pc:\windows\temp
set gsc=
set include=
pause

that code does not work.. it returns an error I have looked at the new file out to see what it does but not sure what to replace.. as I did not see what GSC.exe out was like...

this is to use within Context using the f11 key.
 
hi how would I use this to check for errors like the old GSC.exe did

Code:
@echo off
set gsc="C:\N3V Games\TS12\Bin"
set include="C:\N3V Games\TS12\Scripts"
%gsc%\TrainzUtil.exe %1 -i%include% -pc:\windows\temp
set gsc=
set include=
pause

that code does not work.. it returns an error I have looked at the new file out to see what it does but not sure what to replace.. as I did not see what GSC.exe out was like...

this is to use within Context using the f11 key.

I think to access the compiler with TrainzUtil.exe you have to specify the compile param like the following:
%gsc%\TrainzUtil.exe compile %1 -i%include% -pc:\windows\temp

For a slightly different approach for Context see the update that PEV did recently on the wiki:
http://online.ts2009.com/mediaWiki/index.php5/Using_Context_with_Trainzscript

The example is set up for TS2010 but should with change in paths work for TS09 thru 12.

Bob Pearson
 
Hi there - In TS2010 Content Manager you can achieve the same thing by right-clicking the asset and selecting "View Errors & Warnings". This invokes TrainzUtil and displays compiler errors. This is not available in TRS2006. Don't know about TS2009 and TS2012.

Once the asset has been successfully committed then any open script file is invalid and needs to be closed and re-opened.

If you edit a driver command and then check it with View Errors & Warnings it might say: Cannot link compiled script. This is not an error. Committing the asset will clear the error unless there is a genuine reason for the link process to fail.

Trevor
 
If you are dealing with assets involving the 'unable to link compiled class' error, keep an eye on TrainzUtil during/straight after commiting the item.

This will usually tell you what the reason for not being able to link it, which will appear if the asset is still faulty after opening for edit and recommiting.

Shane
 
Personally I think the Context method is the way to go and I use it with TS12.

Context is useful for sorting out some of the simpler parsing errors by using it as your script editor and the Trainzscript "compile" hot key as described in PEV's WiKi page.

Context invokes TrainzUtil and stops are the first parse error. Its a bit quicker than getting to the CM commit and finding you still have those sorts of errors. A clean run doesn't mean your code is perfect. :hehe:

What would be really nice is having Context having access to Trainzscript libraries and providing function syntax like the mainstream programming IDEs.

I wonder if it could be done...

Paul
 
Personally I think the Context method is the way to go and I use it with TS12.

Context is useful for sorting out some of the simpler parsing errors by using it as your script editor and the Trainzscript "compile" hot key as described in PEV's WiKi page.

Context invokes TrainzUtil and stops are the first parse error. Its a bit quicker than getting to the CM commit and finding you still have those sorts of errors. A clean run doesn't mean your code is perfect. :hehe:

What would be really nice is having Context having access to Trainzscript libraries and providing function syntax like the mainstream programming IDEs.

I wonder if it could be done...

Paul

I agree with you .... can you post your compile script for me as I have put mine like pev states in his post but it don't work I get this


Code:
> Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe "C:\N3V Games\TS12\bin\TrainzUtil.exe" compile*C:\Users\targ\Desktop\whyte island provisioning shed vulcan\trainshedindustry.gs -i"C:\N3V Games\TS12\Scripts" -pC:\temp

- <NULL> : Invalid argument, please check the help for the list of valid argument

OK (1 Errors, 0 Warnings)
> Execution finished.

every time I"m not sure if its an error or not but I have checked it with a code from another industry and get the same so I think something is not right in the setup for the compile test...
 
This is what I have for TS12:

Code:
@echo off
set bin="D:\Auran\TS12\Bin"
set here="\."
set include="D:\Auran\TS12\Scripts"
%bin%\trainzutil.exe compile %1 -i%include% -p%here% -b%here%
set bin=
set include=
set here=
pause

Actually, I'm not sure the include is correct because I get errors when I reference N3V scripts but that's not really an issue for me.

My Environment Keys dialog box for F11 looks much like PEV's example although the dialog box is slightly different in the later version of Context.

It's been a while since I put it together so I cannot remember what changes I made.

Edit: ignore this bit - my brain must have been elsewhere. Note that the set include line does not have a line break after "D:\Auran\TS12\Scripts". That's a forum formatting issue.

HTH

Paul
 
Last edited:
I'm going to answer my own question.

...
What would be really nice is having Context having access to Trainzscript libraries and providing function syntax like the mainstream programming IDEs.

I wonder if it could be done...

Paul

This is a partial yes. Trainzscript code templates can be added to Context and stored in .ctpl files. It might be handy to at least have the Trainzscript program syntax (keywords in the WiKi) in there. Maybe I'll add them in my spare time and add the file to PEV's Context WiKI page.

I also noticed on the Context web site that development has ceased due to (run time?) licence issues with Delphi.


Paul
 
Back
Top