how to view a compiled acs script
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
how to view a compiled acs script
so i got a compiled acs script and i was wondering how to open it and see whats in it.
so thats why i am asking how?
and yes i know this is asked by someone before but i dodnt find the awnser there.
so thats why i am asking how?
and yes i know this is asked by someone before but i dodnt find the awnser there.
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: how to view a compiled acs script
I think there's a decompiler somewhere, but I'm pretty sure it only works for vanilla HeXen.
You're pretty much screwed without the source.
You're pretty much screwed without the source.
Re: how to view a compiled acs script
Descript works well for BEHAVIOR lumps compiled with the Raven ACC. That includes all the scripts from Hexen and Deathkings.
It will not work with ACS in ZDoom's enhanced formats; and it's not guaranteed to work with vanilla ACS that was compiled with something else than Raven's ACC.
It will not work with ACS in ZDoom's enhanced formats; and it's not guaranteed to work with vanilla ACS that was compiled with something else than Raven's ACC.
Re: how to view a compiled acs script
DeePsea also has the ability to decompile scripts (and generate code that can then be compiled again) but, like descript, it only works on the older behavior format. I don't think anything is available that can decompile the modern ZDoom script format and generate code that looks like the original ACS source. There might be a tool that can disassemble scripts to let you know which functions have been called etc (I'm sure *someone* mentioned it once) but if you want readable, compilable code that looks like the original source, there isn't anything.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49231
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: how to view a compiled acs script
Well, thank Randy for f*cking this up by some really idiotic PCode constructs that just cannot be decompiled. Believe it or not, the HUDMessage PCode depends on the value of certain parameters and to un-screw this in a decompiler is close to impossible
Re: how to view a compiled acs script
That's a real shame because being able to decompile scripts can come in very useful. 

- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49231
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: how to view a compiled acs script
Indeed - especially if some smartasses think they can keep their ideas a secret (cough... RTC-3057)
I have decompiled the scripts but they are broken, unfortunately. Of course in the HUDMessage commands.
I have decompiled the scripts but they are broken, unfortunately. Of course in the HUDMessage commands.
Re: how to view a compiled acs script
Heh, that's awesome, unless it's your project and you lost your code 

Re: how to view a compiled acs script
That's happened to me. Fortunately it was in the days when it was possible to decompile the scripts. Both that and Graf's example are why I find found the ability to decompile scripts very useful.printz wrote:Heh, that's awesome, unless it's your project and you lost your code
Re: how to view a compiled acs script
What? The generated p-code looks like this:Graf Zahl wrote:Believe it or not, the HUDMessage PCode depends on the value of certain parameters
PCD_BEGINPRINT
...standard printing stuff...
PCD_MOREHUDMESSAGE
...six parameters...
[PCD_OPTHUDMESSAGE
...variable number of parameters...]
PCD_ENDHUDMESSAGE/PCD_ENDHUDMESSAGEBOLD
The compiler does not care what values you use, nor does it even check. Is it really that hard to decompile?
Re: how to view a compiled acs script
You may be interested to know that I am the original author of DeScript. I'm quite amazed that people are still using it, despite the fact that it is pretty ancient software and is limited to the "vanilla" scripts compiled by the original Raven ACC compiler.
I am willing to make the full source code available free of charge into the public domain, in case anybody wants to use it as a base for producing a more advanced decompiler - all I ask is that I am credited with developing the original decompiler. Please remember, however, that it is _very_ old software, written for DOS systems with the 640K memory limit (if I remember rightly, it parses the file several times from the disk, to avoid chewing up too much memory). Therefore, it would take a lot of work to bring it up to modern standards.
If anybody wishes to receive this, please feel free to email me at: robertcoward [at] gmail [dot] com
Use your common sense to convert this to a human readable email address. As I am quite busy, I would not want to receive a flood of emails regarding this, so it would be best if one person contacts me, I send them the code and they then take it over. Also note that the code is supplied "as is", without any warranty, and that I cannot provide any technical support regarding it.
I am willing to make the full source code available free of charge into the public domain, in case anybody wants to use it as a base for producing a more advanced decompiler - all I ask is that I am credited with developing the original decompiler. Please remember, however, that it is _very_ old software, written for DOS systems with the 640K memory limit (if I remember rightly, it parses the file several times from the disk, to avoid chewing up too much memory). Therefore, it would take a lot of work to bring it up to modern standards.
If anybody wishes to receive this, please feel free to email me at: robertcoward [at] gmail [dot] com
Use your common sense to convert this to a human readable email address. As I am quite busy, I would not want to receive a flood of emails regarding this, so it would be best if one person contacts me, I send them the code and they then take it over. Also note that the code is supplied "as is", without any warranty, and that I cannot provide any technical support regarding it.
Re: how to view a compiled acs script
I think the best idea would be to upload the source code, neatly packaged, to the idgames archive. Release it under a permissive open-source license such as the three-clause BSD license; it'll be as good as public domain for most purposes but will take care of the attribution bit.
- Apothem
- Posts: 2070
- Joined: Sat Nov 29, 2003 7:13 pm
- Location: Performing open heart surgery on an ACS compiler.
Re: how to view a compiled acs script
If I remember correctly there was a python based decompiler that was able to decompile the newer ZDoom scripts. However, IIRC, it was made before named scripts were around.