Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
[McD] James

Hexen script #255

Recommended Posts

What I'm trying to do is edit the repopulation scripts that spawn monsters every few minutes in most of the Hexen maps. The monster repopulating is especially annoying in its expansion; Deathkings of the Dark Citadel. However, I'm having problems compiling the scripts.

I've already downloaded ACC and linked the executable with Slade in the preferences section. However, every time I bring up a map and try to compile the map's ACS script I get an error message along the lines of:

The following errors were encountered while compiling, please fix them and recompile:

Line 1 in file "C:\Users\Jimmy\AppData\Local\Temp\SLADE3\MAP22.acs" ...
C:\Users\Jimmy\AppData\Local\Temp\SLADE3\MAP22.acs:1: Invalid declarator.
> version
> ^


I'm not sure why Slade is creating and accessing files in my Temp folder, as I never specified the program to do so.

*EDIT*: I changed the thread title to most suitably reflect where I presently am. I was originally attempting to compile the info, when I should have been trying to decompile the scripts. It doesn't matter now, as I already have the scripts in a zip file, but I'm having problems editing them.

Edited by Ajora

Share this post


Link to post

There are probably syntax errors in your script. If you can't figure them out, post your entire script.

Also make sure to compile the script in the correct bytecode, which can be either Hexen or ZDoom. Use ZDoom if you're making a wad for ZDoom (regardless of IWAD, Hexen or some other one), and Hexen if you want the wad to be compatible with vanilla Hexen.

Using a Temp folder is normal for SLADE3, don't worry about it.

Share this post


Link to post

I've already set it so that it's trying to compile the script in ACS Hexen, but I've tried many of the other script languages and always get the exact same message.

I've been completely unable to both pull up as well as edit any of the ACS scripts in Hexen. Tried Doom Builder as well, but no such luck.

Share this post


Link to post

So, what exactly is on Line 1 in your script? (As I said before, it would be preferable if you posted your entire script.)

Share this post


Link to post
scifista42 said:

So, what exactly is on Line 1 in your script? (As I said before, it would be preferable if you posted your entire script.)



The only thing I'm getting for all of the map scripts is: "version 2.3" in line one. That's the entirety of what's coming up.

Share this post


Link to post
Ajora said:

The only thing I'm getting for all of the map scripts is: "version 2.3" in line one. That's the entirety of what's coming up.

So the better question to ask is why is that there? ACC can't compile that as it's not a valid script syntax, so why does that line even exist in your map scripts?

Share this post


Link to post

Those are map markers. You absolutely do not stick ACS in them, nor do you compile them, in fact there shouldn't be anything in them at all (unless you are using fraggle script, which you aren't either).
Basically, stop doing that. You've invented a problem that doesn't exist.

What you should actually be compiling is script lumps (behavior lumps are compiled forms of these), and your maps seem to be absent of those (they aren't needed, but decompiling ACS isn't straightforward).

Share this post


Link to post

I think I'm supposed to be decompiling scripts rather than compiling them (oops). I've tried running descript and deacc through dosbox, but when I open the executable, all I get is some basic information about the files in the dosbox window.

After all this time, you'd think that a widely available pwad for both Hexen and Deathkings that edits out all the monster repopulating (with the exceptions being maps 40 and 60) would exist by now.

Share this post


Link to post

Try this decompiler.

Also, Descript is a command-line tool that accepts parameters and generates output, hopefully you didn't launch it plainly without parameters?

Share this post


Link to post

I've downloaded listacs along with the python extensions, but can't seem to find any instructions on how to operate it.

Share this post


Link to post

Okay, got 'em, but I'm not really sure where to go from here. I seem unable to open/edit them with anything in Slade or Doom Builder. I downloaded a few programs used for viewing ACS, but they either have limited to no functionality, or import files as garble.

edit: File Viewer Lite allows me to look at the scripts in text format, but doesn't allow me to edit them in any way. I already know that script 255 is the one that's causing monsters to spawn every few minutes, so I'd imagine that simply deleting the scripts would allow me to achieve my desired result.

edit 2: The "import files" function seems to import the scripts into Slade, so I think I'm on the right track. However, I seem unable to make any permanent changes to the script, and even if I could, I'm not exactly sure how to overwrite the portions that I want to.

Also, I really appreciate everyone's help.

Share this post


Link to post

Okay, I've managed to import the files into Doom Builder's script editor. However, whenever I make any changes to script 255, the only effect it has on my game is that I'm now unable to break any windows or open doors, while seeing an unknown script error message pop up.

Good thing I have everything backed up. Don't really know where to go from here.

Share this post


Link to post

So in SLADE3, the SCRIPTS lump of your map appears below the BEHAVIOR lump of the same map - right? You edit the SCRIPTS lump in Doom Builder and compile it by clicking the Compile button - right? And it doesn't compile properly - right?

Share this post


Link to post
scifista42 said:

So in SLADE3, the SCRIPTS lump of your map appears below the BEHAVIOR lump of the same map - right? You edit the SCRIPTS lump in Doom Builder and compile it by clicking the Compile button - right? And it doesn't compile properly - right?


According to Edward850, the map markers don't contain any actual coding in them.

I couldn't find out how to modify any of the ACS coding in either Slade or Doom Builder by accessing the IWAD. I was using Doom Builder to load up the unzipped map scripts that were previously provided to me. However, any minute alterations made to it would do nothing but corrupt the Hexen IWAD (even when I didn't save any changes to whatever map I had loaded).

I found the script editor in the map building segment of Slade, but I'm still unable to interact or even load up the scripts in any way. I see the library that contains all of the scripting, but nothing loads up or compiles. At any rate, its functionality seems to be limited when compared to Doom Builder.

Share this post


Link to post

1. You absolutely shouldn't modify your IWAD. However, you can open it in any editor in read-only mode, and you can copy its maps or lumps to your own PWAD to experiment with modifying them.

2. "Map markers" are just the header lumps above other map lumps, for example "MAP01", "MAP12", etc. "BEHAVIOR" lumps actually contain the map's scripts in a compiled form, that you may decompile to view them. "SCRIPTS" lumps contain script sources in text form, that you must compile (into a "BEHAVIOR" lump) to make it have effect on the map when playing it.

Share this post


Link to post
scifista42 said:

1. You absolutely shouldn't modify your IWAD. However, you can open it in any editor in read-only mode, and you can copy its maps or lumps to your own PWAD to experiment with modifying them.

2. "Map markers" are just the header lumps above other map lumps, for example "MAP01", "MAP12", etc. "BEHAVIOR" lumps actually contain the map's scripts in a compiled form, that you may decompile to view them. "SCRIPTS" lumps contain script sources in text form, that you must compile (into a "BEHAVIOR" lump) to make it have effect on the map when playing it.


Yeah, I can see why it isn't wise to modify an IWAD. I've actually never created a PWAD before, to be honest.

I get the gist of everything you're saying, but I'm kind of at a dead end right now. I'll get back to this in a few days.

Share this post


Link to post

You're just getting a bit confused between the various stuff. It's not especially complicated, but there's a lot of things to note.

There are two main scripting languages in the Doom engine: ACS (developed by Raven Software for Hexen) and FraggleScript (developed by fraggle for SMMU, found its way into Doom Legacy).

FraggleScript is interpreted and its source code is placed in the map header. That's why SLADE has an option to "edit map header script", it's for FraggleScript and not at all for ACS. If you want to do ACS, just forget about map header scripts entirely.

ACS is compiled into bytecode, this is the BEHAVIOR lump. The source code is not included or distributed. When you edit maps with Doom Builder (or SLADE) the ACS source will be included as a SCRIPTS lump after BEHAVIOR, but this SCRIPTS lump is not used by the engine and therefore optional. It's just there to allow the editor to retrieve the source code so you can recompile it and change the BEHAVIOR.

Descript works fine for Hexen's official levels, but it's a command-line tool so you can't just click it and hope it'll work. You'll have to run it in DOS (perhaps DOSBox) and tell it what you want to do exactly. Descript will only decompile one map's scripts at a time, so you'll have to run the operation for each map.

Then when you're done you get a text file with the decompiled source. Create a new lump after BEHAVIOR, name it SCRIPTS, and import the content of the text file created by Descript. (Or just import the text file directly, with drag and drop. Drop in the correct place, though! You can always adjust the lump's position with the blue arrow toolbar buttons if you missed.) Anyway, if the lump is named SCRIPTS, and is placed after BEHAVIOR, then you can edit the scripts from within SLADE 3 (or Doom Builder) and recompile.

Last thing: all ACS source start with an #include to import standard definitions, so that the compiler will know what function names and defined constants refer to. For vanilla Hexen scripts, it'll be #include "common.acs", but if you take the ZDoom ACC you won't have that because it's instead shipped with "zcommon.acs". You'll need the Raven ACC with its own definition files.

Share this post


Link to post

I've imported one of the map scripts into slade, renamed it to "scripts", and placed it below the behaviour lump. Slade is now allowing me to edit the text, but I still get the same "error compiling" message whenever I click on compile. It's also now prevented me from saving changes to the iwad. (error: iwad saving disabled).

Share this post


Link to post

1. Create a new wad and copy the whole map (range of lumps from "MAPxx" to "SCRIPTS") into it, don't modify your IWAD.
2. As Gez told you, either replace "common.acs" with "zcommon.acs" on the first line in the SCRIPTS lump, or get the Raven version of ACC.

Share this post


Link to post

Success! I copied all of the map contents onto a new WAD slate, then removing the repopulating was just a simple matter of replacing script 255 open with script 255 (void). Everything appears to be working. I'd imagine that I'd need to take the exact same steps with Deathkings.

The scripts zip file that I was given contains a folder titled 1.1 that contains 8 map scripts for Hexen. They appear to be almost identical to their counterpart maps with some very slight alterations. I'm guessing that I should concentrate on these scripts and not the other ones, as I'm assuming they exclusively pertain to the 1.1 versions of Hexen's maps.

When I get around to it within the next few weeks I'll post a couple of pk3 files for both Hexen and Deathkings in the WADs sub-forum that nullifies this annoying feature.

Thanks again for all your help!

Share this post


Link to post
Ajora said:

removing the repopulating was just a simple matter of replacing script 255 open with script 255 (void).

You could delete that script 255, or comment it out, it would be a cleaner way of achieving your goal. What you actually did was to keep it in the map, just make it require an explicit call to be executed (instead of being executed automatically at map startup), and since the map doesn't make such a call, the script will be permanently ready to be executed, but never actually executed.

Share this post


Link to post

Ah, okay. I'll be sure to delete the entirety of the 255 scripts then. I'm 99.9% sure they don't do anything besides spawn monsters at timed intervals. To my knowledge, maps 40, 60 and 33 are the only single player maps that don't have any scripted monster spawning.

Share this post


Link to post

The function names should be descriptive enough to tell you if they have something to do with spawning things or with something else, so that you would comment out just those relevant ones (if their parameters are just numbers, you can find out which spawned things are monsters by comparing the spawn numbers with Hexen spawn numbers). I know nothing about Hexen in particular, but it's very frequent that a map's OPEN script contains setup actions that might be important-enough to break the map if removed.

Also, if you're going to distribute the modified scripts, make sure NOT to include the actual maps or other IWAD content with them. As part of a commercial product, it's illegal to distribute those.

Share this post


Link to post

I'm glad you warned me about this. Obviously, uploading the actual iwad anywhere is a no no, but I don't see how I can possibly distribute the pk3 patches without including all of the map lumps.

I'll go test this now.

Tested the first map using only the behaviour and script lumps in my pwad. The respawning is back.

Share this post


Link to post

Unfortunate. I guess you could distribute a non-working WAD and require people to run a script to merge it/pull out their IWAD maps to make it work.

Have you tried this with chocolate-hexen? I wonder if Chocolate's "-merge" feature would work in this case.

Share this post


Link to post

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
×