Quantcast

Jump to content

» «
Photo

GTA3script Toolchain

RW Released
39 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, 4 weeks ago.

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: 3 weeks ago
  • Chile

#39

Posted A week ago

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 A week ago

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users