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.

Trying to get one switch to activate 2 things

Postby nodninja » Wed Oct 27, 2021 7:38 pm

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
nodninja
 
Joined: 27 Oct 2021
Discord: obamasdad#1176
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: Trying to get one switch to activate 2 things

Postby nova++ » Thu Oct 28, 2021 12:00 am

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
nova++
Real life space alien (not fake)
 
Joined: 04 Sep 2021
Operating System: Other Linux 64-bit

Re: Trying to get one switch to activate 2 things

Postby Caligari87 » Thu Oct 28, 2021 8:57 am

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-)
User avatar
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: Trying to get one switch to activate 2 things

Postby Eugene Doblingshaw » Thu Oct 28, 2021 12:54 pm

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
Eugene Doblingshaw
 

Re: Trying to get one switch to activate 2 things

Postby Caligari87 » Thu Oct 28, 2021 1:20 pm

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
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: Trying to get one switch to activate 2 things

Postby nodninja » Thu Oct 28, 2021 1:51 pm

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
nodninja
 
Joined: 27 Oct 2021
Discord: obamasdad#1176
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: Trying to get one switch to activate 2 things

Postby Enjay » Thu Oct 28, 2021 2:05 pm

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Mapping

Who is online

Users browsing this forum: No registered users and 1 guest