Quantcast

Jump to content

» «
Photo

GTA3script Toolchain

RW Released
49 replies to this topic
LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#1

Posted 22 December 2016 - 08:09 PM Edited by LINK/2012, 05 June 2017 - 01:40 AM.

KjAOz7nm.png 4pAZhGCm.gif

 

GTA3script Toolchain

 
This is a compiler, editor extension, and debugger for the GTA3script language, which was the de facto language used by Rockstar North to code the mission scripts of the 3D Universe.
 
The compiler is cross-platform, well tested and provides a CLI interface based off GCC/Clang. So if you are familiar with command line interfaces, this should be pretty standard for your tastes.
 
The editor extension is a extension for VSCode, which is a lightweight, cross-platform, and extensible text editor (definitely not Visual Studio). Such extension provides syntax highlighting, auto-completion and documentation crawled from GTAModding and GTAG. This provides access to the compiler as well, so there's no need to touch the command line interface if you aren't familiar with that.
 
The debugger is a client-server protocol which supports breakpoints, variable watching, and more. It's currently work-in-progress, but you should see it working together the editor extension pretty soon. Do note it is a protocol, as such it is game, compiler and editor agnostic, it just needs to be implemented on them.
 
Everything is open source, as usual, and as noticed, it's all future-proof, in such a way that it can be used in future recreations of the game, such as OpenRW.
 
This is compatible with all three games in the trilogy, III, Vice City and San Andreas.
 
Get It:
  • Download the compiler, or compile it yourself.
  • Download VSCode and the extension (read the instructions).
  • Download the debug server... ehh.. not yet.
It's dangerous to go alone, take this:Special Thanks:
  • Wesser for immensurable help in understanding the language, its principles and its future.
  • Deji for his previous research and attempts at making a working compiler.
  • Junior_Djjr and Silent for testing and feedback.
I would also like to thank a certain company, without their slips, this wouldn't be possible.
  • The Hero, Ash_735, gamerzworld and 38 others like this

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#2

Posted 22 December 2016 - 08:15 PM

first

Inadequate
  • Inadequate

    Midnight Emulator

  • Members
  • Joined: 11 Apr 2012
  • None

#3

Posted 22 December 2016 - 08:27 PM

Second.

 

MlqnVaO.jpg

  • Frank.s, Apu889, Mega and 7 others like this

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#4

Posted 24 December 2016 - 10:30 AM

Good job.
Try to make it compatible with other than GTA 3 games, if it's not.

Junior_Djjr
  • Junior_Djjr

    Modding Lover

  • Members
  • Joined: 16 Dec 2011
  • Brazil
  • Best Map 2016 [San Andreas INSANITY] [Contribution]

#5

Posted 25 December 2016 - 03:12 AM

I met LINK/2012 in 2011 when he was still learning a create custom scripts.
Today he totally recreated the way to make such mods, in an incredible way. This renews the forces (and fun) of modding.

Now my mods will be created using it, and I'll share some source codes here.

btw this thing is cool to use together.
  • LINK/2012 and Davve95 like this

Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#6

Posted 25 December 2016 - 09:54 AM

Good job.
Try to make it compatible with other than GTA 3 games, if it's not.

LINK didn't specifically noted it in OP, but III/VC/SA are supported AFAIK.


_Israel_
  • _Israel_

    Everyone gonna remember my name !

  • Members
  • Joined: 22 Dec 2016
  • Brazil

#7

Posted 25 December 2016 - 06:02 PM

Now my mods will be created using it (...)

We are 2, that gives a certain mood !


The_GTA
  • The_GTA

    revenclaw

  • Members
  • Joined: 27 Dec 2012
  • Germany
  • Modding Milestone [Magic.TXD]

#8

Posted 25 December 2016 - 07:07 PM

Very professional product! Noted that I take a look at this in my spare time.

thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#9

Posted 25 December 2016 - 11:34 PM Edited by thehambone, 25 December 2016 - 11:34 PM.

It's great to see a compiler for the native GTA3-era scripting language! Looks very well-built and authentic, as if Rockstar created the tool themselves. Awesome work! :^:

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#10

Posted 25 December 2016 - 11:57 PM

You should implement a support of GTA LCS/VCS as well.

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#11

Posted 26 December 2016 - 12:09 AM Edited by Silent, 26 December 2016 - 12:12 AM.

You should implement a support of GTA LCS/VCS as well.


It is a open source project, you could help with an contribution too ;)
  • Blackbird88, Tomasak, Apu889 and 3 others like this

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#12

Posted 26 December 2016 - 03:36 PM

You should implement a support of GTA LCS/VCS as well.

I don't know if LCS/VCS support is worth it. We'll need to guess a lot of language semantics and command names, and that should be done carefully. Since nobody does Stories scripting, this would be an unnecessary danger.


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#13

Posted 26 December 2016 - 04:51 PM Edited by fastman92, 26 December 2016 - 04:53 PM.

 

You should implement a support of GTA LCS/VCS as well.

I don't know if LCS/VCS support is worth it. We'll need to guess a lot of language semantics and command names, and that should be done carefully. Since nobody does Stories scripting, this would be an unnecessary danger.

 

I have studied LCS/VCS SCM for a long time.

A plenty of commands got carefully researched.


Ash_735
  • Ash_735

  • Members
  • Joined: 15 Nov 2005
  • None
  • Contribution Award [Mods]
    Most Knowledgeable [GTA] 2013
    Best Map 2013 "ViceCityStories PC Edition"

#14

Posted 26 December 2016 - 05:18 PM

So why not help out then? Oh wait, you'll only do it if you can somehow attach f92 in there somewhere ;)

thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#15

Posted 26 December 2016 - 07:14 PM

Support for LCS/VCS would certainly be useful for me. Hex editing main.scm is a pain.

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#16

Posted 26 December 2016 - 08:41 PM

gta3sc aims for accuracy though and we know almost nothing about Stories-exclusive SCM features which requires even more guessing - and the more guessing is used, the worse the tool becomes.
  • Junior_Djjr and thehambone like this

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#17

Posted 26 December 2016 - 10:05 PM

Support for LCS/VCS would certainly be useful for me. Hex editing main.scm is a pain.

I have a simple SCM compiler for GTA LCS and VCS, which uses a limited Sanny Builder syntax.
Hex editing of main.scm is the worst that can be done.

goodidea82
  • goodidea82

    SA Modder

  • Members
  • Joined: 13 Jun 2013
  • Germany

#18

Posted 27 December 2016 - 12:25 PM Edited by goodidea82, 27 December 2016 - 12:26 PM.

A translator from SB would be great, to port existing mods.

A decompiler would also be great, it is very useful for learning and checking scripts from other people.


LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#19

Posted 27 December 2016 - 07:02 PM Edited by LINK/2012, 27 December 2016 - 07:06 PM.

A translator from SB would be great, to port existing mods.
A decompiler would also be great, it is very useful for learning and checking scripts from other people.

I tried writing a high-level decompiler at some point but I failed miserably and ended up frustated :p. A low-level one exists by the way and was used to decompile VC/SA so they could be test cases, it isn't very intuitive to use though. I could try again at some point (don't count on it) since I learnt a lot with the mistakes on the first try, but at the moment I'm expecting Seemann to finish his attempt.

 

The translator should be pretty straightforward to do really, but I invite somebody else to write one since I don't really feel like it. A Python script should be a good pick :).


Junior_Djjr
  • Junior_Djjr

    Modding Lover

  • Members
  • Joined: 16 Dec 2011
  • Brazil
  • Best Map 2016 [San Andreas INSANITY] [Contribution]

#20

Posted 28 December 2016 - 10:54 AM

I also thought about a translator, including the first things I did with GTA3script was to manually translate some mods I've already created. (right now I'm translating one more).

I didn't even give this tip to LINK/2012 because, in a way, not having a translator is good, because you are required to translate it manually, and at the beginning this helps you to practice.


Vadim M.
  • Vadim M.

    Stay tuned

  • Members
  • Joined: 09 Sep 2008
  • Latvia

#21

Posted 07 January 2017 - 01:04 PM

Good job! :catloaf:


LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#22

Posted 07 January 2017 - 06:32 PM

Updated with some fixes.

  • ThirteenAG, Silent, goodidea82 and 1 other like this

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

  • Feroci
  • Joined: 30 Jan 2011
  • Brazil
  • Best Tool 2014 [Mod Loader]
    Contribution Award [Mods]

#23

Posted 27 January 2017 - 03:32 PM Edited by LINK/2012, 27 January 2017 - 03:33 PM.

Added a complete GTA3script tutorial by Junior_Djjr on the OP.

 

It assumes no previous programming knowledge from the reader. It's in Brazilian Portuguese, but still may be helpful.

  • Blackbird88 likes this

gts.
  • gts.

    Gangsta

  • Members
  • Joined: 20 Jun 2015
  • United-States

#24

Posted 29 January 2017 - 05:11 AM

I'm very interested on this. Will be some kind of converter available for Sanny Builder to GTA3script? I mean, will be a pain in the ass re-write long Sanny scripts to port them into GTA3script.


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • Poland
  • Best Conversion 2016 [GTA: Underground] [Contribution]
    Contribution Award [Mods]

#25

Posted 29 January 2017 - 05:27 PM Edited by fastman92, 29 January 2017 - 05:30 PM.

This is the core reason why I cannot develop CLEO scripts using GTA3script Toolchain.
The amount of time that would be required to rewrite the Sanny Builder code into GTA3script is prohibitive.
It's not an option to throw away everything what has already been made for Sanny Builder.

thehambone
  • thehambone

    Don't remind me of home Or I might notice where I am

  • Members
  • Joined: 27 Dec 2013
  • United-States

#26

Posted 30 January 2017 - 09:34 PM

It's not an option to throw away everything what has already been made for Sanny Builder.

Who says you have to do that, though? GTA3script seems more like an alternative, rather than a replacement, for Sanny's scripting.
  • Blackbird88 and Inadequate like this

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Most Helpful [Modding] 2016
    Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#27

Posted 30 January 2017 - 10:35 PM

The way I see it you should treat this as "ok, next time I do SCM stuff I'll use gta3sc".
  • Blackbird88, Junior_Djjr and thehambone like this

spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#28

Posted 08 February 2017 - 08:02 AM

Is it possible to do weird tricks that R* never used, like the assignment of a label to a variable? In SB:
[email protected] = @label

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown
  • Contribution Award [Mods]

#29

Posted 08 February 2017 - 12:31 PM Edited by Wesser, 08 February 2017 - 01:08 PM.

Yes, partially. Doing so, we would pay the price of putting a brand new token in front of *VAR_INTs (alike the dollar sign leading *VAR_TEXT_LABELs), because the identifier of variables and label references can conflict without issues (unlike string constants). Configuring the SET command pair to grant such an assignment, the compiler wouldn't be capable of matching the right alternative and differentiating *VAR_INT from LABEL arguments. That said, featuring the GET_LABEL_FILE_OFFSET command by the runtime is the only way to go (in view of the decompilation process as well).
  • LINK/2012 likes this

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#30

Posted 07 March 2017 - 07:45 PM

Bravo, you managed where I failed in making the essential GTA modding tool which will be heavily underappreciated and mostly unused.

 

Next step is to realise SCR and "CLEO VM" or whatever it should be called ;)

  • Wesser, Blackbird88, Silent and 2 others like this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users