Help with func_button Created 11 months ago2023-12-18 19:59:44 UTC by Combined Combined

Created 11 months ago2023-12-18 19:59:44 UTC by Combined Combined

Posted 11 months ago2023-12-18 19:59:44 UTC Post #348271
I have Two question here: the First One, Is how to make a button get used by pressing e, and the second how to make that button work only for NPC (in Scripted Sequences)
Posted 11 months ago2023-12-18 23:44:27 UTC Post #348275
For the first: here's the entity guide page for the entity you'll use.

For a button that's only useable by a NPC, a trick is used where the button itself doesn't do anything (alternatively play a "no access" sound or sentence).

Instead a scripted_sequence is used. In a very basic setup, it uses the Search Radius key (value of roughly 100 units or so, depending on how far/near the monster needs to be before starting the sequence) and Target Monster set to the classname of the NPC you want to use (for example monster_scientist) and Move to Position set to Walk and Action Animation set to the sequence you want it to play (such as retina for monster_scientist).
Then you'll want the scripted_sequence's target to be whatever you want to be triggered when successfully unlocked by the NPC.

Of course it can be made more complicated by chaining multiple scripted_sequences or having the target of the unlocking sequence be a multi_manager that controls a chain of events to take place.
Posted 11 months ago2023-12-19 07:13:53 UTC Post #348276
Interestingly I searched for a tutorial on the second and there's nothing. Like has nobody thought of writing it for the past 25 years? 😵
Posted 11 months ago2023-12-19 08:48:34 UTC Post #348277
I know, which is why I started writing one a few days ago when helping someone in the Discord with the same thing
Posted 11 months ago2023-12-19 12:35:10 UTC Post #348278
Thanks for the fast reply
Posted 11 months ago2023-12-19 14:31:37 UTC Post #348282
Tutorial: Retina Scanners and Other NPC-Only Locked Doors just finished writing a tutorial that explains more in detail how to do that second question
Posted 11 months ago2023-12-19 19:30:03 UTC Post #348283
Oh thanks a lot!
You must be logged in to post a response.