Trying to get one switch to activate 2 things

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.
Post Reply
User avatar
nodninja
Posts: 2
Joined: Wed Oct 27, 2021 7:27 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Trying to get one switch to activate 2 things

Post by nodninja »

So I have a wall that I want the player to be able to shoot and raise one floor (to allow them to walk across the lava) and then at the same time raise a wall across the room to reveal another switch (which raises the other floor to complete the bridge.)
I've tried messing with tags/sector tags, but I still havent been able to get both to activate at the same time. I tried a work around of dividing the switches sector into two switches, but then the player can soft lock themself if they try to raise one floor before the other. I just want the floor raise and the wall open to happen at the same time.
Do I need to us ACS? If so, can you guys help? Thanks :)
Here's an image to better illustrate my point:
User avatar
nova++
Posts: 177
Joined: Sat Sep 04, 2021 3:13 am

Re: Trying to get one switch to activate 2 things

Post by nova++ »

What map format and game target are you going for? If it's gzdoom/udmf then you can just use ACS. Classic doom you are probably out of luck. Boom you can do stupid stuff with voodoo dolls.
User avatar
Caligari87
Admin
Posts: 6229
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Trying to get one switch to activate 2 things

Post by Caligari87 »

The vanilla way would be to set up the triggers so they can only be activated in sequence, and the player is gently nudged to activate them as intended. For example, a switch raises the bridge (showing the player they need to walk that way), and then a walk-over linedef on the newly-accessible bridge reveals the next switch.

If you don't want to do this kind of sequential setup, then yes you probably should be using ACS to trigger the actions simultaneously.

8-)
Guest

Re: Trying to get one switch to activate 2 things

Post by Guest »

Actually in classic Doom there are two gun activated line actions that can do that:

46: GR Door open stay
47: G1 Floor Raise to next floor, change texture (trigger method), type -> 0

Because each line can have only one action you'll need to have two action lines layered: One action to the eye-swith line and an other action to a line just in front of it. Make sure there's practicly no chance that you could hit only one of them without activating the other.

If you're mapping in Doom/Hexen or UDMF you could still use the same method and set the actions to activate on projectile impact:

11: Door Open
228: Platform Raise Tx0

However ACS is much more reliable then. And you can still use the very same actions:

Door_Open (tag, speed, 0);
Plat_RaiseAndStayTx0 (tag, speed, 1);

If ACS is all new to you, take a look at:

https://zdoom.org/zdkb/scriptprimer.html
https://zdoom.org/zdkb/scrmikewelsh.html (otherways great but those "const:" things are unnecessary)
https://zdoom.org/wiki/ACS
User avatar
Caligari87
Admin
Posts: 6229
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Trying to get one switch to activate 2 things

Post by Caligari87 »

Closely-layered trigger lines are indeed one way to accomplish simultaneous activation, but I tend to dislike those as they can either be missed (in the case of shootable/walkable triggers) or may behave differently depending on source port implementation or user settings (such as GZDoom's compat_useblocking option).

8-)
User avatar
nodninja
Posts: 2
Joined: Wed Oct 27, 2021 7:27 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Trying to get one switch to activate 2 things

Post by nodninja »

Eugene Doblingshaw wrote:Actually in classic Doom there are two gun activated line actions that can do that:

46: GR Door open stay
47: G1 Floor Raise to next floor, change texture (trigger method), type -> 0

Because each line can have only one action you'll need to have two action lines layered: One action to the eye-swith line and an other action to a line just in front of it. Make sure there's practicly no chance that you could hit only one of them without activating the other.

If you're mapping in Doom/Hexen or UDMF you could still use the same method and set the actions to activate on projectile impact:

11: Door Open
228: Platform Raise Tx0

However ACS is much more reliable then. And you can still use the very same actions:

Door_Open (tag, speed, 0);
Plat_RaiseAndStayTx0 (tag, speed, 1);

If ACS is all new to you, take a look at:

https://zdoom.org/zdkb/scriptprimer.html
https://zdoom.org/zdkb/scrmikewelsh.html (otherways great but those "const:" things are unnecessary)
https://zdoom.org/wiki/ACS
I'm only semi decent at ACS.
So I see how to use those actions, but how would I make it so it activates once the switch is shot? I've only ever used OPEN and ENTER scripts, not specific trigger ones.
User avatar
Enjay
 
 
Posts: 26971
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Trying to get one switch to activate 2 things

Post by Enjay »

Instead of typing OPEN or ENTER after your script number, type (void) - with the brackets.

Then make the line in your map a script execution type (type 80 is probably most common) and use the script number as the first argument on the line. Set the line to have a "projectile impacts" activation type in the line editor.
Post Reply

Return to “Mapping”