Help with momentary_rot_button! Created 10 years ago2014-05-21 11:22:49 UTC by Mr Gnang Mr Gnang

Created 10 years ago2014-05-21 11:22:49 UTC by Mr Gnang Mr Gnang

Posted 10 years ago2014-05-21 11:22:49 UTC Post #319477
Hi everyone, I have been using this website for support for months but finally have to ask a question so I created an account!

I am struggling to get the following scenario to work,

There is a useable valve behind a pane of glass.
The player is to smash the glass, and then the valve can be used.
The valve is used by holding the use button, letting go will allow it to spin back to the beginning.
Once the valve is fully rotated, it will lock into place, and then trigger another event, but only once the valve is fully rotated.

The idea here is to have the player attempt to fully spin the valve while under attack, so that turning away will allow it to spin back, hopefully being tense and not annoying :P

So far, the main issues are:

A momentary_rot_button allows the valve to work like above, but if I get it to trigger something in the target field this will be triggered the second it is used instead of when it has completed it's rotation.

A func_rot_button will begin spinning on it's own once used and just complete the cycle itself, but will trigger something at the end of rotating. Not what I am looking for though!

And also, only allowing this button to be used when the glass is broken. I know it is to do with master entites but I am unsure of how to get this to work.

I am also using spirit of half life 1.5 if this helps!

Hope you guys can help!

If you want to check out my mod as well, I am updating frequenty here :)

http://www.moddb.com/mods/half-life-echoes
Posted 10 years ago2014-05-21 13:40:00 UTC Post #319479
It's a small world aint it MrGnang. :D

I'm not sure about your first question but the master thing should be pretty straight forward.

Normally, this is just a case of assigning a name to the breakable glass and then entering this name in the master field for the button / door in question.

I've used masters quite a few times for locked doors which require keys and such. :)
monster_urby monster_urbyGoldsourcerer
Posted 10 years ago2014-05-21 16:58:18 UTC Post #319483
I think the glass should use target on break on something else and use THAT something else as the master. I've never used masters though, so I might be wrong.

For the triggering part, I have an idea.

If only for clarity in illustrating this, let's say the momentary_rot_button targets something called momentary_target.

Have a momentary_door in a hidden (non-player-accessible) part of the map, also named momentary_target. On top of it put a small func_pushable. At the far end of the momentary_door, put a trigger_once with the "pushables" flag active and make it also target the something else I mentioned in the first paragraph.

If I'm right, once the momentary valve reaches the end of its movement, so will the momentary door carrying the pushable on it. The pushable will at this point activate the trigger_once which will turn off the master, blocking all the momentaries from any further movement.

This is all theoretical and I'm not responsible if it doesn't work. :P
Posted 10 years ago2014-05-22 06:47:10 UTC Post #319492
Thanks guys! :)

Sorry Urby I think I was a bit obtuse about how I described this :P
Basically, remember that valve in surface tension under the dam that you use to open the grate underwater? As you hold down use, the wheel turns, and the grate opens, and once you let go it begins to fall back into it's starting position.

My idea was to have a scenario where the player is under attack, and has to fully turn a valve until it is fully rotated, then that will trigger all the doors in the area to open. But instead of the doors opening slowly with the wheel, I wanted them to only open once the valve is fully spun, and that having the player under attack will cause them to have to choose between fighting enemies and turning the wheel!

The main problem is that this momentary_rot_button appears to only allow you to work with a door that moves as the wheel does! I think the situation I'm hoping to have was done in HL2 episode 1 in the car park with the antlions!

And DiscoStu, that idea is genius haha! I honestly think this should work, I will give it a go and report back! :)
Posted 10 years ago2014-05-22 16:10:12 UTC Post #319500
Holy crud, Stu, that's clever.
Crypt Crypt120% sorry!
Posted 10 years ago2014-05-22 22:11:43 UTC Post #319502
It worked! You crazy fool it worked! :P
Posted 10 years ago2014-05-23 01:47:37 UTC Post #319506
Actually it's based on some tutorial I read forever ago, about something else only related by having momentary doors in it, and since I had never tried it myself, it was a pretty wild guess.

Glad it worked though! :)

If you only want the door to open after the rotation is complete, just make it a normal door and target it with the trigger_once.
Posted 10 years ago2014-05-23 14:32:59 UTC Post #319511
I love solving problems like this.
Use the tools you have in new and creative ways.
Well done stu!
Tetsu0 Tetsu0Positive Chaos
You must be logged in to post a response.