Quantcast

Jump to content

» «
Photo

GTA3script Toolchain

RW Released
50 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]

#31

Posted 17 March 2017 - 03:18 AM Edited by LINK/2012, 17 March 2017 - 03:19 AM.

Deji just added an API to his GTAG Opcode Database and made a few changes in the VSCode extension to use it  :turn:. This means docs got from GTAG are faster and have no crawling errors anymore. Your VSCode should ask for an extension update, just accept it. I recommend to perform a ctrl+shift+p -> GTA3Script: Clear Documentation Cache as well.

  • Blackbird88 and Silent like this

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#32

Posted 18 March 2017 - 06:32 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 ;)

 

sooo..you're alive.

  • Silent, Apu889, LINK/2012 and 1 other like this

kosticn101
  • kosticn101

    Rat

  • Members
  • Joined: 24 May 2017
  • Serbia

#33

Posted 06 June 2017 - 12:36 PM Edited by kosticn101, 06 June 2017 - 12:52 PM.

Is this project still active?

What happened to Seemann's decompiler (last commit was last year)? I can't figure it out how to use it, can somebody provide me some more info on what should I do with files that I've downloaded from GitHub?

With gta3sc I can decompile GTA3 i GTAVC main.scm (with -emit-ir2 flag) but when i try to decompile GTA SA main.scm using gta3sc main.scm --config=gtasa --guesser -emit-ir2 I get fatal error: file 'main.scm/script.img' does not exist. I get same error when I try to decompile some ".cs" file.

So I removed

-fswitch
-farrays
-fconst
-fstreamed-scripts
-fskip-cutscene

from gtasa config and also removed --guesser flag and only then I could decompile GTASA main.scm.
But with CLEO file I get corrupted scm header. Can this thing be used to decompile CLEO scripts?
  • Crspy likes this

kosticn101
  • kosticn101

    Rat

  • Members
  • Joined: 24 May 2017
  • Serbia

#34

Posted 07 June 2017 - 06:24 AM Edited by kosticn101, 25 June 2017 - 06:00 AM.

I don't have very much programming experience but I'm trying to fix some minor things that are bugging me.

Most important is that GTAG OpcodeDB URL is outdated (new address). And changing `http:// gtag.gtagaming .com/api/opcodedb/v1/opcodes?id=${opcode}` to `http:// gtagmodding .com/api/opcodedb/v1/opcodes?id=${opcode}` doesn't seem to help.
Spoiler

There is no "compilation succeeded" message.
Spoiler

I can't see the point of showing not supported commands in autocomplete list..
(I don't understand why those commands exists at all.)
Spoiler

There is no SCRIPT_START and SCRIPT_AND in autosuggestions list.
Spoiler

We are generally supposed to use string literals only with CLEO commands but without documentation how are we gonna now if specific command is CLEO command?
Spoiler

Syntax highlighting with nested multiline comments is wrong. I think that RegEx can come in handy here but I don't know RegEx. This looks interesting.

@LINK/2012
Can you please make SB -> GTA3sc and high-level decompiler (or show me how to use existing one) :D

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

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

#35

Posted 11 June 2017 - 01:54 PM

Is this project still active?

Yes, just moving slowly because of time constraints.
 

With gta3sc I can decompile GTA3 i GTAVC main.scm (with -emit-ir2 flag) but when i try to decompile GTA SA main.scm using gta3sc main.scm --config=gtasa --guesser -emit-ir2 I get fatal error: file 'main.scm/script.img' does not exist. I get same error when I try to decompile some ".cs" file.

Weird. Are you sure you have script.img together main.scm?
 

But with CLEO file I get corrupted scm header. Can this thing be used to decompile CLEO scripts?

Yes, use -mno-header or better yet, --cs, which enables this and other flags for custom scripts.
 

snip

Wow, that's a lot of valuable contributions. Would be happy to include them on future releases.
 

Can you please make SB -> GTA3sc and high-level decompiler (or show me how to use existing one)

There is none yet :/
  • kosticn101 likes this

kosticn101
  • kosticn101

    Rat

  • Members
  • Joined: 24 May 2017
  • Serbia

#36

Posted 28 June 2017 - 06:25 AM Edited by kosticn101, 29 June 2017 - 12:20 PM.

Yes, use -mno-header or better yet, --cs, which enables this and other flags for custom scripts.

Oh, great then :)

Weird. Are you sure you have script.img together main.scm?

Yes, they are in the same folder. I get same error even with CLEO files: regen.cs/script.img doesn't exist. Without -fstreamed-scripts flag it decompiles fine.

Wow, that's a lot of valuable contributions. Would be happy to include them on future releases.

Cool :D

Hmm.. Constants from DEFAULTMODEL are not showing in my autocomplete even after reinstalling.

Spoiler

It looks like GTA3 and GTAVC only commands are showing when GTASA is selected.
Is there a flag to 'add extra info' like in Sanny Builder in order to see all commands in HEX editor?
Can you make that on writing goto or similar statement, document is search for labels and they're listed?

Another enum:

<Enum Name="AUDIO_STATE">
  <Constant Name="PLAYING" Value="1"/>
  <Constant Name="PAUSED" Value="2"/>
  <Constant Name="STOPPED" Value="-1"/>
</Enum>

<Command ID="0xab9" Name="GET_AUDIO_STREAM_STATE">
  <Args>
    <Arg Type="INT" Entity="AUDIO_STREAM"/>
    <Arg Type="INT" Enum="AUDIO_STATE"/>
  </Args>
</Command>

I managed somehow to add support for custom descriptions to Link's VSCode extension.
I don't know about others, but it'll be useful to me. Idk, maybe you want to add notes on your native language...
An5DilQ.png

  • Download mod from Dropbox.
  • Go to Start > (Run) %userprofile%\.vscode\extensions\thelink2012.gta3script-0.2.3\out\src\
  • (optional) Backup original extension files somewhere in case that I broke something.
  • Replace all content of that folder with content of archive that you've downloaded.
  • Download DescEdit from Dropbox.
  • Copy DescEdit.exe and related files to descriptions folder.
  • Use DescEdit to edit custom descriptions.

Mod comes without other fixes that I've suggested. I'm not sure that it works completely, if I find something that's broken I'll fix it. Maybe Link decides to add this to public version, and then he will fix all bugs.

xBKk3ym.png
If you spot any errors (feel free to correct my bad English) or have any comments about DescEdit, send them as private message. Be sure to check often for updates (in upper left corner on Dropbox there is "Modified" info subscribe to get notifications).

Note: You don't have to register on Dropbox to download.

  • pez2k likes this

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2016 [OpenIV]
    Best Tool 2013 [Sanny Builder]
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#37

Posted 28 June 2017 - 05:17 PM Edited by Seemann, 28 June 2017 - 05:19 PM.

What happened to Seemann's decompiler (last commit was last year)? I can't figure it out how to use it, can somebody provide me some more info on what should I do with files that I've downloaded from GitHub?

 
I still have plans to continue this project, I'm just slowly studying the subject. High-level decompiling is not that easy, at least for me. I also would highly appeciate any help on the matter in terms of pull requests, comments, suggestions, etc...
Running the current version is a bit tricky. You have to execute the following commands in a shell (assuming you have Git and NodeJS installed on your machine):
# clone git repository
git clone https://github.com/x87/scout.js.git
cd scout.js
 
# install dependencies
npm install

# build opcode definitions json from ini
node ./opcodes/parser > ./build/gta3.json
 
# build decompiler from sources
npm run build -- -e src/main.ts -o build/scout.js
 
# run decompilation on the file "build/test3.scm" (in GTA3 mode) and print the result
node ./build/scout test3.scm -g gta3 -p
Only headless scripts (CLEO) for GTA3 is supported at the moment. No high level output is available, only raw "opcodes".
  • pez2k and kosticn101 like this

kosticn101
  • kosticn101

    Rat

  • Members
  • Joined: 24 May 2017
  • Serbia

#38

Posted 28 June 2017 - 06:05 PM Edited by kosticn101, 16 July 2017 - 03:38 PM.

Great news :). Will try it as soon as I can (when I fix my laptop).
 
UPDATE
Based on discussion here, it looks like that argument ordering for TASK_ENTER_CAR_AS_PASSENGER (05CA) is wrong... It should be like here. Game simply crashes if you put Time last and seat number before it, and script works if you put it other way around.

UPDATE
http://brmodstudio.f...ariaveis#258340

guru_guru
  • guru_guru

    pajaro culiao

  • Members
  • Joined: 22 Jul 2017
  • Chile

#39

Posted 09 August 2017 - 09:21 PM

It is possible to use Dk's newOpcodes ?
I made a script with Cleo4 using some opcodes from it,but I kinda want to translate it to gta3script for reasons...

spaceeinstein
  • spaceeinstein

    Chocolate

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

#40

Posted 09 August 2017 - 11:22 PM

You can edit the configuration files to add new opcodes. Look for the cleo.xml file.

chatuba
  • chatuba

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • Brazil

#41

Posted 21 August 2017 - 03:43 AM

Very good, but it will be worth migrating to GTA3Script. What do you say?

spaceeinstein
  • spaceeinstein

    Chocolate

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

#42

Posted 21 August 2017 - 06:14 AM

Personally GTA3script is best to use because that's how scripts would have been written by the developers of the game.

kosticn101
  • kosticn101

    Rat

  • Members
  • Joined: 24 May 2017
  • Serbia

#43

Posted 21 August 2017 - 06:30 AM Edited by kosticn101, 21 August 2017 - 06:33 AM.

I first thought that Sanny Builder is the only way to create scripts. (I knew about C++ alternative but there is no documentation) Then I found out about this and I was like "wtf why I spent my time on SB at all". But then I saw this: http://gtaforums.com...987-moonloader/ and I was like "wtf why nobody told me about this earlier" :D. But it was too late, I got bored with GTA 3D, I'm now just waiting for a new PC to play GTA5 :).
  • Davve95 likes this

chatuba
  • chatuba

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • Brazil

#44

Posted 22 August 2017 - 04:31 AM Edited by chatuba, 22 August 2017 - 04:32 AM.

Oh, great, thank you friends, I'll start studying GTA3Script !


Junior_Djjr
  • Junior_Djjr

    Modding Lover

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

#45

Posted 22 August 2017 - 06:48 AM Edited by Junior_Djjr, 22 August 2017 - 06:52 AM.

Very good, but it will be worth migrating to GTA3Script. What do you say?

Let's be clear:
GTA3script is the easiest way to start learning how to coding for GTA SA. And my GTA3script tutorial is very, I said, VERY easy.
After learning GTA3script, you may want to go to Lua.
 
"Why not Lua first?"
 
As I said, GTA3script is the easiest way, and we're in same game... When you need to create a car, you will make the same thing no matter if you are using Lua, GTA3script or Sanny Builder (but plugin-sdk is a bit harder to do such things as creating cars etc). After learning GTA3script, you'll be very close to going to Lua (MoonLoader) or Sanny Builder. Everything is very similar, but Lua (MoonLoader, more specifically) is more advanced than CLEO. But even so you can also do almost everything with CLEO (GTA3script / Sanny Builder), it is more a matter of facilities (Lua brings some facilities).

  • kosticn101 likes this

chatuba
  • chatuba

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • Brazil

#46

Posted 24 August 2017 - 03:00 AM

I understood perfectly djjr, I will delve deeper into GTA3Script, thank you !

LINK/2012
  • LINK/2012

    LIVIN' IN CODE

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

#47

Posted 12 September 2017 - 07:44 PM

gta3sc 0.9.5

  • Support for III/VC CLEO commands.
  • Support for strings inside DUMP...ENDDUMP.
  • Breaking Change: The BITWISE_ family of CLEO4 commands were renamed to BIT_, as well as INT_ was added. (e.g. BIT_AND, INT_ADD, and others).

Download

Contributions from ThirteenAG and thelostt :)

  • Gramps, Blackbird88, ThirteenAG and 1 other like this

China·XMDS
  • China·XMDS

    Rat

  • Members
  • Joined: 18 Jan 2016
  • China

#48

Posted 18 September 2017 - 06:51 AM Edited by China·XMDS, 18 September 2017 - 11:59 AM.

gta3sc 0.9.5

  • Support for III/VC CLEO commands.
  • Support for strings inside DUMP...ENDDUMP.
  • Breaking Change: The BITWISE_ family of CLEO4 commands were renamed to BIT_, as well as INT_ was added. (e.g. BIT_AND, INT_ADD, and others).
Download

Contributions from ThirteenAG and thelostt :)

I am win10.64 dozen don't open the software click ran out for a moment

spaceeinstein
  • spaceeinstein

    Chocolate

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

#49

Posted 18 September 2017 - 05:51 PM Edited by spaceeinstein, 18 September 2017 - 05:54 PM.

If you want to directly use gta3sc.exe, use Command Prompt (cmd.exe) to run it.

China·XMDS
  • China·XMDS

    Rat

  • Members
  • Joined: 18 Jan 2016
  • China

#50

Posted 18 September 2017 - 07:41 PM

If you want to directly use gta3sc.exe, use Command Prompt (cmd.exe) to run it.


I tried, but I still can't open it

RU VpridGameStudio
  • RU VpridGameStudio

    Player Hater

  • Members
  • Joined: 14 Jun 2017
  • Russia

#51

Posted 2 weeks ago Edited by RU VpridGameStudio, 2 weeks ago.

Hi. Help me please. I can't install it  :panic: . (Linux Mint)
upd: I solve it by sudo apt-get install build-essential





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users