Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Kyka

Defining switches in Doom2

Recommended Posts

So say I create a new set of switches (not replacing existing switches, but new switches.) Lets call them, say, SW1BLOBS and SW2BLOBS.
Is there a lump that I need to add SW1BLOB and SW2BLOB to so that a port like Boom or ZDoom will recognise them as switches rather than simple textures when ingame? If so, which one?

Or is the names of the textures enough to define them as switches?


Thanks. :)

Share this post


Link to post

For Boom(and compatible ports), you will need a SWITCHES lump. To generate one, go here and download the Boom editing tools. There is a tool called SWANTBLS which you can use to define custom animatons and switches. Open up DEFSWANI.DAT in Notepad or whatever, add your switches/animations and drag it onto SWANTBLS. That should create SWITCHES.LMP and ANIMATED.LMP to be included into your WAD.

Share this post


Link to post

Doom: no way.
Heretic: no way.
Hexen: the ANIMDEFS text lump.
Strife: no way.
Boom: the aforementioned ANIMATED/SWITCHES lumps compiled with SWANTBLS (SWitches ANimated TaBLeS).
ZDoom: either ANIMDEFS or ANIMATED/SWITCHES. If both types of lumps are present and there is a definition conflict between both, then ANIMDEFS wins.

Hexen's ANIMDEFS are much better, but are only supported by Hexen ports and ZDoom. (Maybe Eternity as well? If not now, then later down the line as it's necessary for the planned Hexen support.) So the Boom method is recommended if you want to make something compatible with as many ports as possible.

For ports that don't support Boom, there might be other methods. I don't know if Doomsday's DED files can define switches, for example.

Share this post


Link to post
Gez said:

Doom: no way.
Heretic: no way.
Strife: no way.

That's not completely true. What you can do it so modify the existing switch textures. Make them wider and put the new switch textures besides the existing ones. Then use the x offset of the line to show the switch you want.

Share this post


Link to post
Gez said:

For ports that don't support Boom, there might be other methods. I don't know if Doomsday's DED files can define switches, for example.


Doomsday supports the SWITCHES lump from Boom I believe.

While Doomsday's XG automatically assumes that any activation line, with a SW1xxxx or SW2xxxx texture is a switch if both textures are present.

Share this post


Link to post
Gez said:

Doom: no way.

It worked for me. What I did was look up the Unofficial Doom Specs for the switch definition format in the EXE. I hex-edited Doom.exe looking for that table, and what I saw was an empty, free row at the end. I filled it in with one new pair of switch textures.

Nevermind the fact that it subsequently exited with an error whenever the WAD I loaded didn't contain those textures. But otherwise it worked nicely.

Actually, the SWITCHES and ANIMATED lumps of Boom are based on tables found within Doom.exe.

I'll leave it to the Doom port programmers to cringe at my 'discovery' 'find' (the empty, free row in the table in the exe).

Share this post


Link to post
boris said:

That's not completely true. What you can do it so modify the existing switch textures. Make them wider and put the new switch textures besides the existing ones. Then use the x offset of the line to show the switch you want.

The operating parameters from the question included this:

Kyka said:

So say I create a new set of switches (not replacing existing switches, but new switches.)


So, yes, you can modify the existing textures, but then you don't do that without modifying the existing textures.

Share this post


Link to post

Thanks heaps for the replies guys. This is so useful to a complete nub trying to understand this stuff.

boris said:

That's not completely true. What you can do it so modify the existing switch textures. Make them wider and put the new switch textures besides the existing ones. Then use the x offset of the line to show the switch you want.


This actually occured to me while I have been doing all this texture compiling/sorting recently, but I hadn't got around to trying it. I actually thought to myself. "Nah. It can't be that simple."

Thanks for sharing this. What a neat trick it is. This will actually do most of what I need. It still keeps the original switch textures "accessible", while allowing me to create new switches.

Share this post


Link to post

Nice find, printz!

Gez said:
The operating parameters from the question included this:

Kyka said:
So say I create a new set of switches (not replacing existing switches, but new switches.)

Yeah, although it was rather redundant to mention their incapacity since Kyka said "so that a port like Boom or ZDoom will recognise them" :p

EDIT: But it did add a useful info sharing chain.

Share this post


Link to post
Gez said:

Hexen: the ANIMDEFS text lump.



Actually not. This is a ZDoom-only feature. Hexen's switch definitions are still inside p_switch.c - including all the missing error checks that made the switch list such a problem with Doom2.

Share this post


Link to post
myk said:

Nice find, printz!

Uhh, not really. I read somewhere that the last line is deliberately null, to indicate a termination. I left that in my post so someone with more expertise (why not; Doom has a source code) would catch the mistake by responding in a hilarious fashion (I did warn in that last paragraph somewhat).

Maybe it works in Doom anyway, but hopefully it won't crash outright...

Share this post


Link to post

Someone should implement something into the modern ports like Half Life has where information for animations and switches are covered right in the texture name. A switch would be !SWTEX1 and !SWTEX2. Use a wall with !SWTEX1 and make it a switch, and the engine would automatically use !SWTEX2 when it's activated.

Animations are similar. I think they used a + prefix. Or maybe I've got them turned around. Hell, it's been forever since I touched Half Life editing. This could have been the same way in the original Quake engine which Half Life was based on, but I've actually never touched Quake editing.

Share this post


Link to post

That wouldn't work. Animations contain much more information than just a sequence of textures (like animation speed for example) and at least in ZDoom switches can do a lot more than alternate between 2 textures.

Share this post


Link to post

printz said:
Maybe it works in Doom anyway, but hopefully it won't crash outright...

We'll see. In any case it's more of a technical curiosity, because if one wants more animated textures, one simply extends the existing ones, as boris indicated.

Share this post


Link to post
Gez said:

So, yes, you can modify the existing textures, but then you don't do that without modifying the existing textures.

THAT DOES NOT COMPUTE.

He wouldn't be replacing any switches so your argument is false.

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
Sign in to follow this  
×