[Won't change] Multi-activation on Line skips sound and animation

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Multi-activation on Line skips sound and animation

Postby Sir Robin » Mon Mar 21, 2022 5:34 pm

Not sure if this is a bug or some intended behavior:

Using the example code on the LineTrace page I created a melee weapon that can activate lines. I wanted it to operate usable, shootable, and bumpable lines, so I did this:
Code: Select allExpand view
            //RemoteRay.HitLine.Activate(self, 0, SPAC_Use); //Original line
            RemoteRay.HitLine.Activate(self, 0, SPAC_Use | SPAC_Impact | SPAC_Push);

It "works" as in it activates the line and everything happens as it should, however if the line is animated switch, it doesn't play it's sound or animation. I see this behavior on my own custom switches as well as switches in stock DOOM2.WAD levels.

The work-around is to break out the activation:
Code: Select allExpand view
         if (RemoteRay.HitLine.Activation & SPAC_Use)
            RemoteRay.HitLine.Activate(self, 0, SPAC_Use);
         else if (RemoteRay.HitLine.Activation & SPAC_Impact)
            RemoteRay.HitLine.Activate(self, 0, SPAC_Impact);
         else if (RemoteRay.HitLine.Activation & SPAC_Push)
            RemoteRay.HitLine.Activate(self, 0, SPAC_Push);
User avatar
Sir Robin
Joined: 22 Dec 2021
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Multi-activation on Line skips sound and animation

Postby Graf Zahl » Tue Mar 22, 2022 12:53 am

The Activate function assumes single activation type and performs no checks for combinations, so the behavior is by design. With a combined activation types there's no way to safely determine if a switch is supposed to be toggled or not.

I think the best way to handle this is to add another parameter to explicitly enable switch toggling for calls from scripts, regardless of activation type.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Joined: 19 Jul 2003
Location: Germany

Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests