Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    2. News

    1. Red Dead Redemption 2

    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

LINK/2012

GTA3script Toolchain

Recommended Posts

LINK/2012

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.

Edited by LINK/2012

Share this post


Link to post
Share on other sites
Seemann

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.

Share this post


Link to post
Share on other sites
kosticn101

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?

Edited by kosticn101

Share this post


Link to post
Share on other sites
kosticn101

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.

 

Check this out...

 

Another cool thing (you need to open specified file in editor and insert statements that are written in yellow):

<GTA3Script>

<Constants>

<Enum Name="AUDIO_ACTION">

<Constant Name="STOP"/>

<Constant Name="PLAY"/>

<Constant Name="PAUSE"/>

<Constant Name="RESUME"/>

</Enum>

<Enum Name="BOOL" Global="true">

<Constant Name="FALSE"/>

<Constant Name="TRUE"/>

</Enum>

 

<Command ID="0xaad" Name="SET_AUDIO_STREAM_STATE" Hash="0x5a2768ca">

<Args>

<Arg Type="INT" Entity="AUDIO_STREAM"/>

<Arg Type="INT" Enum="AUDIO_ACTION"/>

</Args>

</Command>

 

 

There is no "compilation succeeded" message.

 

Go to Start > (Run) %userprofile%\.vscode\extensions\thelink2012.gta3script-0.2.3\out\src\

if (anyError) {

return Promise.reject("Compilation failed.");

} else {

 

vscode.window.showInformationMessage("GTA3script: Compilation succeeded.");

}

 

 

I can't see the point of showing not supported commands in autocomplete list..

(I don't understand why those commands exists at all.)

 

Go to Start > (Run) %userprofile%\.vscode\extensions\thelink2012.gta3script-0.2.3\out\src\

for (const command of (CfgNode.Commands[0].Command || [])) {

if (command.$.Supported != null && command.$.Supported == "false")

continue;

let id = null;

let hash = null;

let args = [];

 

I think that this should do the job.

 

 

There is no SCRIPT_START and SCRIPT_AND in autosuggestions list.

 

Open Visual Code and go to File > Preferences > User Snippets, type gta3script and press Return. Paste this snippet there:

 

"New Script": {  "prefix": "scstart",  "body": [    "SCRIPT_START",    "{",    "\t$0",    "}",    "SCRIPT_END"  ]}
Now when you want to write a new script you just need to type scstart, find it in autosuggestions list and hit Return. It may be a good idea to add "editor.snippetSuggestions": "top" in File > Preferences > User Settings.

 

Or simply create file template..

 

 

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?

 

Go to Start > (Run) %userprofile%\.vscode\extensions\thelink2012.gta3script-0.2.3\out\src\

entity: arg.$.Entity || null,

hint: arg.$.Desc || (configfile.includes("cleo.xml") ? ((arg.$.Type == "STRING") ? "STRING[CLEO]" : null) : null),

optional: arg.$.Optional == "true",

You will see "STRING[CLEO]" in argument description if argument is string and command is from CLEO.

 

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

Edited by kosticn101

Share this post


Link to post
Share on other sites
LINK/2012

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 :/

Share this post


Link to post
Share on other sites
kosticn101

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.

 

 

Cannot read property 'map' of undefined: TypeError: Cannot read property 'map' of undefined

at GTA3CompletionItemProvider.provideCompletionItems (C:\Users\Admin\.vscode\extensions\thelink2012.gta3script-0.2.3\out\src\providers\completion.js:25:34)

at d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:356623

at d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:57373

at new n.Class.derive._oncancel (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:46346)

at Object.d [as asWinJsPromise] (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:57336)

at e.provideCompletionItems (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:356577)

at d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:365815

at t._withAdapter (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:360077)

at t.$provideCompletionItems (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:365777)

at t.e.handle (d:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:23:312304)

e.onUnexpectedError @ /D:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29

let constants = this.gta3ctx.getEnumeration(enumName);let items = constants.map(([name, value]) => { //here

 

 

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.

Edited by kosticn101

Share this post


Link to post
Share on other sites
Seemann

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 repositorygit clone https://github.com/x87/scout.js.gitcd scout.js # install dependenciesnpm install# build opcode definitions json from ininode ./opcodes/parser > ./build/gta3.json # build decompiler from sourcesnpm run build -- -e src/main.ts -o build/scout.js # run decompilation on the file "build/test3.scm" (in GTA3 mode) and print the resultnode ./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". Edited by Seemann

Share this post


Link to post
Share on other sites
kosticn101

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.forumeiros.com/t6306-17-tipos-de-entidades-nas-variaveis#258340

Edited by kosticn101

Share this post


Link to post
Share on other sites
guru_guru

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...

Share this post


Link to post
Share on other sites
spaceeinstein

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

Share this post


Link to post
Share on other sites
chatuba

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

Share this post


Link to post
Share on other sites
spaceeinstein

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

Share this post


Link to post
Share on other sites
kosticn101

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/topic/890987-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 :).

Edited by kosticn101

Share this post


Link to post
Share on other sites
chatuba

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

Edited by chatuba

Share this post


Link to post
Share on other sites
Junior_Djjr

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).

Edited by Junior_Djjr

Share this post


Link to post
Share on other sites
chatuba

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

Share this post


Link to post
Share on other sites
LINK/2012

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 :)

Share this post


Link to post
Share on other sites
China·XMDS

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

Edited by China·XMDS

Share this post


Link to post
Share on other sites
spaceeinstein

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

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
China·XMDS

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

Share this post


Link to post
Share on other sites
RU VpridGameStudio

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

Edited by RU VpridGameStudio

Share this post


Link to post
Share on other sites
Inan-Ahammad

The gta3script plugin shouls get improved a little bit for providing better command search/guess?

Share this post


Link to post
Share on other sites
LINK/2012

The gta3script plugin shouls get improved a little bit for providing better command search/guess?

Probably. What do you have in mind?

Share this post


Link to post
Share on other sites
Inan-Ahammad

 

The gta3script plugin shouls get improved a little bit for providing better command search/guess?

Probably. What do you have in mind?

 

I mean i was trying to find some commands(or opcode whatever),and the for some reason even typing the exact word (TEXT) was unable to find the varible for strings and had to relook the tutorial to find it.Its not just with this specific command but in times many commads including the typed word dont appear (unlike sanny builder opcode search).

Share this post


Link to post
Share on other sites
MythicalCreature

0Q0GdWr.png

Why is this not supported? Happens with all other conditional operators as well.

Share this post


Link to post
Share on other sites
LINK/2012

Should work. Except it is `=` not `==`. Also, has `x` been declared as a variable?

Share this post


Link to post
Share on other sites
SHIFAAH9
Posted (edited)

When would we have offline Opcodes or commands?

i mean like now when ever i need a New opcode or a command i need to get online.

Edited by SHIFAAH9

Share this post


Link to post
Share on other sites
Inan-Ahammad

is this right the command TASK_FOLLOW_LEADER_IN_FORMATION does not come with an describtion?

Share this post


Link to post
Share on other sites
MythicalCreature
Posted (edited)

Should work. Except it is `=` not `==`. Also, has `x` been declared as a variable?

 

Yeah it does work. And yes, x has been declared as a variable. It's still kinda weird it has to be like this though; since basically every other programming language uses the '==' notation, it's become sorta habitual.

Also, I was wrong about other conditional operators not working as well. It seems to be an error on the VSCode extension's part; I once had it throw an 'expected command' error on a '/* ' comment line at the beginning of the file too.

And it's still doing it.

Edited by MythicalCreature

Share this post


Link to post
Share on other sites
Inan-Ahammad

 

Should work. Except it is `=` not `==`. Also, has `x` been declared as a variable?

 

Yeah it does work. And yes, x has been declared as a variable. It's still kinda weird it has to be like this though; since basically every other programming language uses the '==' notation, it's become sorta habitual.

Also, I was wrong about other conditional operators not working as well. It seems to be an error on the VSCode extension's part; I once had it throw an 'expected command' error on a '/* ' comment line at the beginning of the file too.

And it's still doing it.

 

i also tested.Doesnt work for me as well.it says expected command.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.