Hammer Editor Scripted Sequence - Getting AI to Activate a Switch. Created 5 years ago2018-06-28 12:25:24 UTC by sluggard sluggard

Created 5 years ago2018-06-28 12:25:24 UTC by sluggard sluggard

Posted 5 years ago2018-06-28 12:25:24 UTC Post #340025
I'm trying to make a switch that can only be activated by AI, Here's my setup:

trigger_once targetting the scripted sequence, which is also targetting the switch, the trigger can be activated by Monsters and clients cannot activate it, I'm using Multisource as a Boolean condition that is set to true once the AI enters the trigger, so that the switch can only be activated after the AI activates the trigger, I'm using func_button for the switch and I have set it's Master to be the Multisource (which again, is only activated once the Monster_scientist enters the trigger).
SetupSetup
It works perfectly fine and the AI faces and does the "retina" animation I want him to do, However I (player) can still activate the switch no matter what, but I only want the AI to activate it, how do I prevent players from pressing the switch? I spent so much time trying to do it but I couldn't figure out how, I'm I doing this the right way? Thank you, and sorry for asking too much questions, I'm fairly new to this :P
sluggard sluggardInsert Creative "Custom Title Text" here
Posted 5 years ago2018-06-28 15:35:35 UTC Post #340026
Assuming that by switch you mean the retinal scanner, instead of it being a func_button, make it a func_wall. When you trigger the retinal scanner, the texture will animate, like as if it's 'used' by the player. That way you can mimic the func_button functionality and the player can't interact with it because it's a func_wall. You may want to add an ambient_generic for the retinal scanner activating sound effect because a func_wall can't play sounds, obviously.

So in short, change the retinal scanner from func_button to func_wall. You also need another trigger to trigger the door or whatever it is that the retinal scanner targets when it was a func_button.
I'd recommend a multimanager.

Also I think the multisource is redundant in this case, this whole set up can totally be done without one.
The Mad Carrot The Mad CarrotMad Carrot
Posted 5 years ago2018-06-28 16:10:30 UTC Post #340027
Oh, so func_wall can also animate? good to know, Thanks for recommending me multimanager, I'll definitely give it a shot :) glad it's not as complicated as I made it seem lol, Thanks again.
sluggard sluggardInsert Creative "Custom Title Text" here
Posted 5 years ago2018-06-28 23:01:43 UTC Post #340030
Posted 5 years ago2018-07-01 14:55:48 UTC Post #340038
Thanks for the example, It helped me find the proper sounds to use for the retinal scanner ambient_generic objects :) , but now I'm having another small problem, the trigger gets activated by other monsters aswell, I only realized this after I placed couple of monsters near the trigger, this calls the scientist to activate the switch eventhough the trigger wasn't activated by him.

Is there anyway to prevent the trigger from being triggered by the other monsters? like a way to check which monster activated the trigger or something?
sluggard sluggardInsert Creative "Custom Title Text" here
Posted 5 years ago2018-07-02 11:00:18 UTC Post #340044
I managed to fix it, I had to change the trigger_once to trigger_multiple, and used another Multisource as a boolean condition that is triggered after I reach the scientist, and remove the trigger using the scripted_sequence KillTarget to make sure it can't be triggered again afterwards, I have a feeling this isn't the best solution but it'll do for now, as long as other monsters are unable to trigger the scripted_sequence.
sluggard sluggardInsert Creative "Custom Title Text" here
Posted 5 years ago2018-07-03 03:21:05 UTC Post #340046
If the solution works, and is repeatable, it's a good solution.

I'm glad it's working for you, also thanks for sharing your solution.
Tetsu0 Tetsu0Positive Chaos
Posted 5 years ago2018-07-03 05:47:40 UTC Post #340047
I was thinking about how they prevented other monsters from triggering retinal scanner sequences, but then realized (only because I did these tests myself recently) that they probably didn't have a trigger at all.

You might be able to greatly simplify this setup using the Search Radius attribute of your scripted_sequence. Set up correctly, I think you'd be able to just have a scripted_sequence that picks up the first scientist that enters its range. More info here. (Of course, this won't work if you need a specific scientist to do it.)
Jessie JessieTrans Rights <3
Posted 5 years ago2018-07-03 22:01:21 UTC Post #340048
Jessie, that's the best thing i've heard about scripted_sequences.... i must try this now
Tetsu0 Tetsu0Positive Chaos
Posted 5 years ago2018-07-04 00:53:30 UTC Post #340049
Let me know how it works!
Jessie JessieTrans Rights <3
Posted 5 years ago2018-07-05 05:12:30 UTC Post #340052
Works like an absolute charm. Check it out: https://twhl.info/vault/view/6287
Tetsu0 Tetsu0Positive Chaos
You must be logged in to post a response.