Change who can activate a line?

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Change who can activate a line?

Re: Change who can activate a line?

by Enjay » Tue Aug 13, 2019 1:25 pm

Nothing now. :)

I just wasn't sure if a monster walking towards a door (etc) counted as an active engagement with the trigger.

Re: Change who can activate a line?

by Graf Zahl » Tue Aug 13, 2019 1:02 pm

Yes, monsters can *actively* trigger a door when approaching it. But they can also be pushed against the door by a rocket blast, which would be a 'passive' trigger. What's so confusing?

Re: Change who can activate a line?

by Enjay » Tue Aug 13, 2019 12:59 pm

Graf Zahl wrote:using requires active involvement.
That's the part that's confusing me: unless active involvement simply means walking towards the trigger when we are dealing with monsters.

Re: Change who can activate a line?

by Graf Zahl » Tue Aug 13, 2019 10:50 am

Pushing includes being pushed onto the trigger by external force - using requires active involvement.

Re: Change who can activate a line?

by Enjay » Mon Aug 12, 2019 6:39 pm

Supplementary question:
Wiki wrote: SPAC_MUse — Activated by monsters using it.
SPAC_MPush — Activated by monsters bumping into it.
I went for SPAC_MUse. It works but I wonder what, if any, difference there is in the above two. As far as I know, monsters don't have the ability to actively [use] a line (maybe they do?). So, is SPAC_MUse the usual "door opens when monster is near" and perhaps for SPAC_MPush the monster actually has to make contact with the line?

Re: Change who can activate a line?

by Enjay » Mon Aug 12, 2019 3:10 pm

Thanks for the suggestion 22alpha22 (and in this case, the player does already have a tid) but SetLineActivation is exactly what I'm looking for. Thanks. :)

Re: Change who can activate a line?

by Blue Shadow » Mon Aug 12, 2019 3:02 pm

Could it be that you want [wiki]SetLineActivation[/wiki]?

Re: Change who can activate a line?

by 22alpha22 » Mon Aug 12, 2019 3:00 pm

If your player(s) have a unique TID not shared by any monters, you can have the script check the TID of what activated it and if it is not a player who activated it, then the script simply terminates.

Code: Select all

Script "Your_Script_Name" (void)
{
    If (ActivatorTID() == PlayerTID)
     {
         Do stuff...
     }
     Else
     {
         Terminate;
     }
}

Change who can activate a line?

by Enjay » Mon Aug 12, 2019 2:08 pm

I have a map (UDMF) where a line on the front of a door only has a tag at map startup. An ACS script gives the line a special to run a script. Later on, a different script changes the line to a normal door type.

Here's my issue. When the script is first allocated to the line, I only want the player to be able to activate the script; it flashes lights, plays sounds, puts a message up and spawns things. I definitely do not want any enemies triggering that.

However, once the door is "fixed" (i.e. becomes just a normal door) I want anyone to be able to activate it: players or enemies.

In Hexen mode this was easy because of the lax activation types. If a script was set to be run by the player, monsters wouldn't run it; however, as soon as it became a door, monsters can activate those even if they are not explicitly allowed to do so. No special handling required.

I am aware that I can set lax activation via mapinfo, but I don't want it to apply across the whole map, just on certain doors.

What's the best way to go about dealing with this?

Thanks.

Top