Why do Hexen switches SW_OL and SW_EL not animate when used?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
NicNamSam
Posts: 7
Joined: Thu Aug 18, 2022 6:18 pm
Preferred Pronouns: He/Him

Why do Hexen switches SW_OL and SW_EL not animate when used?

Post by NicNamSam »

It's the one that moves from side to side and the star that flips around. I know there is a whole thing with animdefs that I can get into, but I'm not at that level yet, and these are default switches that should animate by themselves, right?
User avatar
Kappes Buur
 
 
Posts: 4035
Joined: Thu Jul 17, 2003 12:19 am
Location: British Columbia, Canada

Re: Why do Hexen switches SW_OL and SW_EL not animate when used?

Post by Kappes Buur »

Hexen was the first game to introduce scripting and they made good use of it. :D

These switches were animated through scripting.
For example:
for SW_OLx in MAP04 Guardian of Ice see scripts 9, 10 and 11

Code: Select all

script 9 (void)  
{
    sectorsound("Switch1", 127);
    sectorsound("SwitchOtherLevel", 127);
    setlinetexture(3, SIDE_FRONT, TEXTURE_BOTTOM, "SW_OL2");
    delay(const:2);
    setlinetexture(3, SIDE_FRONT, TEXTURE_BOTTOM, "SW_OL3");
    delay(const:2);
    setlinetexture(3, SIDE_FRONT, TEXTURE_BOTTOM, "SW_OL4");
    delay(const:2);
    setlinetexture(3, SIDE_FRONT, TEXTURE_BOTTOM, "SW_OL5");
    printbold(s:"ONE HALF OF THE PUZZLE HAS BEEN SOLVED");
    delay(const:96);
    printbold(s:"ON THE SEVEN PORTALS");
    if(gametype() != GAME_NET_DEATHMATCH)
    {
        ACS_Execute(const:1, 2, 0, 0, 0);
    }
}
The switch linedef was set to a specific tag with Line_Identification, in this case 3, in the editor and then the script applies the texture change.

In your own maps you could do the same if you stick with vanilla Hexen maps or use ANIMDEFS and SNDINFO/SNDSEQ in maps for GZDoom formats.

Return to “Mapping”