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

Single switches with multiple states

Question

I'm trying to implement a switch that cycles between 4 states, using one of those old unused textures John Romero posted way back when, and I'm running into a surprising problem. The actual act of having the switch make a sequence of 4 things happen isn't a problem -- I could do that with voodoo script if I really wanted to -- no, the problem I'm running into is actually cycling between the 4 different textures. I've done some digging into a few WADs I have on hand and while I've found a couple that have textures like these, I haven't found a single one that actually implements them. Does anyone know how to make this work? I'm working with ZDoom's ANIMDEFS at the moment, though advice relating to the old ANIMATED or SWITCHES lumps is absolutely welcome. Or if there's a solution that doesn't use any of those lumps, I guess that works too. xD

 

Textures included for reference. Probably not necessary, but you never know.

SW5S0.png

SW5S1.png

SW5S2.png

SW5S3.png

Edited by Caru

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 0

Hmm, I'm not sure that one will work for me, it looks like it can only really work once by design (also the wall "moving" is really noticeable xD), and I'm looking for something that can cycle indefinitely as long as you keep using it.

 

I've never heard of this collection though, it looks super useful for learning other editing techniques, so thanks for sharing it!

Share this post


Link to post
  • 0
3 hours ago, Caru said:

..... I'm working with ZDoom's ANIMDEFS at the moment, .....

 

ANIMDEFS would run a continuous animation. However, if you used scripting then you could specify particular textures by setting SetLineTexture for each switch state and resetting after the last one for the next goaround. Probably with an If or While loop.

Edited by Kappes Buur

Share this post


Link to post
  • 0

A few suggestions off the top of my head:

 

In UDMF it makes sense to use an ACS script to simulate switches. Set the activation of the script not on the switch itself, but on a linedef in front of it, then make the script both play the switch sound and change the texture (or set a switch texture as lower or upper tex so you only need the SetLineTexture). Then using a counter (just an integer will do) to keep track of which orientation the switch is at a given time, and then just loop back. You can either make four if elses or use switch/case.

 

In Boom the appropriate cyclical texture change can be applied using instantly moving sectors with the switch texture upper / lower pegged, depending on whether you're moving the floor or the ceiling, then using fake sector to hide the movement. You can also do texture scrolling according to sector movement, but iirc that can cause rendering interpolation issues with some source ports. Couple this with voodoo doll action you mentioned to achieve the desired effect. Using the generic platform or door action to release the doll would give you a beneficial delay to for the voodoo script to run it's course before you can activate the switch again. In this case, as well as in the previous one, the actual activation line shouldn't be the switch itself, but rather a linedef directly in front of it.

 

Share this post


Link to post
  • 0
5 hours ago, Aurelius said:

A few suggestions off the top of my head:

 

In UDMF it makes sense to use an ACS script to simulate switches. Set the activation of the script not on the switch itself, but on a linedef in front of it, then make the script both play the switch sound and change the texture (or set a switch texture as lower or upper tex so you only need the SetLineTexture). Then using a counter (just an integer will do) to keep track of which orientation the switch is at a given time, and then just loop back. You can either make four if elses or use switch/case.

 

 

Beautiful, works perfectly. I had been a little afraid of using ACS scripting, mostly because I kind of dreaded having to learn new syntax (kind of ironic since I ended up teaching myself the super unintuitive voodoo scripting as a workaround xD), but after doing this it really reminds me of the old C++ stuff I used to work with like 10 years ago; I surprised myself how easily I picked it up again. I might also try your Boom-compatible idea just in case I may need it in the future. Thanks for the help!

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
×