xensik / gsc-tool

A utility to compile & decompile IW engine game scripts.
GNU General Public License v3.0
214 stars 40 forks source link

[Decompiler] Prepending hash symbol next to defined dvar strings #207

Closed Jbleezy closed 3 weeks ago

Jbleezy commented 3 weeks ago

All calls to built-in dvar functions such as getdvar have a # prepended to the string of the dvar name. I believe this should only be the case for the unknown dvar hashes, as that is how it was in a previous version of the tool.

Example:

level.scr_zm_ui_gametype = getdvar( #"ui_gametype" );

should be:

level.scr_zm_ui_gametype = getdvar( "ui_gametype" );
ineedbots commented 3 weeks ago

this is intended behavior because it is what the GSC bytecode is doing, it's passing a hash (that we know of) to the builti

we want the decompiler to produce a GSC script that when compiled produces matching bytecode to the original