Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
RoboticRocketeer

Scripts in SLADE 3.1.0.1

Recommended Posts

After figuring out how to do all the vanilla stuff, I'm at the point where I'm trying to figure out ACS.

Chubz, the guide by John Anderson, and most Doom Wikis usually refer to the scripting process in DoomBuilder, but SLADE seems to be different.

How can I make the Script Editor, which I access through the Map Editor, save its work? It doesn't seem to have any relation to the WAD. If I restart SLADE, I cannot find the scripts I thought I'd saved. When I press compile, it doesn't make a SCRIPTS lump.

My intuition is telling me that compiling and creating a lump named "SCRIPTS" are two separate things.

Is the Script Editor just a notepad for me to copy-paste my code to my SCRIPTS lump?

I know that SLADE was a poor choice for a noob like me. I had my reasons for choosing it...

Thanks for your help! Once I reach a certain level of competence, I will make a "How to SLADE" video series.

Share this post


Link to post

Open Slade3 and go to

    Edit - Preferences... - Scripting - ACS
and browse for the path to the ACS compiler located on your computer:



The latest ACS compiler is at http://zdoom.org/files/utils/acc/acc154win.zip
Check zdefs.acs and zspecial.acs at https://github.com/rheit/acc for latest versions. If they are not the same as the ones with the compiler download, then simply overwrite them.

Next, open your map with Slade3 and insert a SCRIPTS lump at the end of the namespace, below BEHAVIOR.



Then click on SCRIPTS, select ACS (ZDoom) as the Text Language and type your script:
#include "zcommon.acs"

script 1 (void)
{
    //  stuff here
}
To compile the script, either

1. rightclick the SCRIPTS lump and select Scripts - Compile ACS



or 2. with the script typed in, click on the compile icon



And save the script and save the map.

http://zdoom.org/zdkb/scriptprimer.html
http://zdoom.org/wiki/ACS

Share this post


Link to post

Note that only maps in Hexen format or UDMF may have ACS scripts in them.

Share this post


Link to post

Thank you both!

Thank you Gez, because it seems THAT was where my problem originated. Back when I opened SLADE for the very first time... XD

Compiling my ACS in Hexen format retroactively solved my problem. Now my linedef specials match what Chubz and everyone else talks about.

Thank you Kappes Buur for the illustrative post; it taught me more ways to navigate SLADE and feel competent when doing so.

>-----<

Although, as a result of your posts, I uncovered 5 more questions.

1. In the Entries window, I can click on a map marker, then "View as Text" or "Edit Level Script." I added code, saved, and later on decided to delete the code. But the code returns. I can reduce the code down to an empty comment, and yet still, even if I delete that and save, the empty comment reappears when I click back to the map marker. How to delete it?

2. What does it serve to embed code into a specific map marker? Is it a convenient way for a Doomer to define scope?

3. If I select a map marker script, make no changes, and click "Compile ACS," it creates a clone of the map marker and creates an ACS namespace around the clone. Is that to allow scripting in Doom format, like what this wiki entry talks about?

http://zdoom.org/wiki/Using_ACS_in_Doom-format_maps

4. If there is a seemingly empty BEHAVIOR lump in the Archive, and I delete it, it severely disrupts my levels.

It turns: into:

What's going on there?

5. Without loading a backup, how do I revert the level format, from Hexen or UDMF, back to Vanilla? Removing BEHAVIOR only causes Question 4.

Share this post


Link to post
RoboticRocketeer said:

4. If there is a seemingly empty BEHAVIOR lump in the Archive, and I delete it, it severely disrupts my levels.


The presence or absence of a BEHAVIOR lump is how it's possible to tell the difference between a Doom format map and a Hexen format map. That jumble you see is what you get when SLADE loads a Hexen format map thinking it's a Doom format map. So don't delete it. :)

Share this post


Link to post

Just to clarify. All entries in a map are lumps and are organized into various namespaces.
At the most basic level, as in the case with just a map layout, the map namespace are all the
lumps in the green area. (namespace coloring can be set in Slade3 Preferences)
Coming back to the map marker lump MAP01, that should be left alone.

What differentiates between a DOOM2 (vanilla format) map and a ZDOOM (hexen format) is
the BEHAVIOR lump. When you open a map with Slade3 and there is no BEHAVIOR lump, then
you are looking at a vanilla format map.

An empty BEHAVIOR lump looks like this



Adding just a script without contents

#include "zcommon.acs"
script 1 (void)
  { 
  }
and compiling it results in this:



After compilation, strictly speaking. the SCRIPTS lump is no longer needed. Usually it is
left in the map as a courtesy. However, there are tools available to descript a BEHAVIOR
lump.

Simply deleting a SCRIPTS lump will, of course, not effect the BEHAVIOR lump. When I want
to reset the BEHAVIOR lump, then I simply delete both, SCRIPTS and BEHAVIOR and copy/paste
an empty BEHAVIOR lump.

Now we come to this jumble of lines:
Internally, the map structures of a DOOM2 (vanilla format) map and a ZDOOM (hexen format) map are
very different and incompatible. Simply deleting the BEHAVIOR lump will result in the editor
assuming it to be a vanilla map, and hence the jumble of lines.

There are tools to convert a map format (see Map formats) from an older format to a newer format.
See my tutorial for that.

Share this post


Link to post
RoboticRocketeer said:

1. In the Entries window, I can click on a map marker, then "View as Text" or "Edit Level Script." I added code, saved, and later on decided to delete the code. But the code returns. I can reduce the code down to an empty comment, and yet still, even if I delete that and save, the empty comment reappears when I click back to the map marker. How to delete it?

That behavior is definitely odd. However, "edit level script" is not for ACS, it's for FraggleScript. I've since changed the button to the hopefully less confusing "edit level header script".
http://doomwiki.org/wiki/FraggleScript

RoboticRocketeer said:

2. What does it serve to embed code into a specific map marker? Is it a convenient way for a Doomer to define scope?

It's for FraggleScript.

RoboticRocketeer said:

3. If I select a map marker script, make no changes, and click "Compile ACS," it creates a clone of the map marker and creates an ACS namespace around the clone. Is that to allow scripting in Doom format, like what this wiki entry talks about?

http://zdoom.org/wiki/Using_ACS_in_Doom-format_maps

Well in a way yeah. As far as SLADE is concerned, if you're compiling as ACS a lump that isn't a map's SCRIPTS lump, it's that you're compiling something that has to get in the ACS namespace. So it'll create a compiled lump with the same name.

RoboticRocketeer said:

4. If there is a seemingly empty BEHAVIOR lump in the Archive, and I delete it, it severely disrupts my levels.

It turns:

What's going on there?

The presence of a BEHAVIOR lump is the only detectable difference between Doom format and Hexen format. If you delete a Hexen-format map's BEHAVIOR lump, it'll be mistakenly identified as a Doom-format map; and Doom-format maps don't write their linedefs (and things, too) differently from how Hexen-format maps do. So attempting to read Hexen lines and things as if they were Doom lines and things will get you a bunch of garbage, which is what you're seeing.

RoboticRocketeer said:

5. Without loading a backup, how do I revert the level format, from Hexen or UDMF, back to Vanilla? Removing BEHAVIOR only causes Question 4.

SLADE 3 does not do map format conversion.

Share this post


Link to post
Kappes Buur said:

What differentiates between a DOOM2 (vanilla format) map and a ZDOOM (hexen format) is
the BEHAVIOR lump. When you open a map with Slade3 and there is no BEHAVIOR lump, then
you are looking at a vanilla format map.


I prefer speaking about Doom-format and Hexen-format. "Vanilla format" is doubly misleading: on the first count, a vanilla map can be in Hexen format (if it's a vanilla Hexen map). On the second count, a map in Doom-format can perfectly well be intended for advanced source ports, like Boom, Doomsday, or Eternity.

Likewise, using ZDoom as a synonym for Hexen format is misleading, maps created specifically for ZDoom can be (and have been) made in Doom format as well; and nowadays the idea is to use UDMF.

http://zdoom.org/wiki/Map_format

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
×