Jump to content

Switches


DT.
Go to solution Solved by DT.,

Recommended Posts

Using func_useable. This what I have now, it cylces through the switch brushes:

 

- switch off - switch will stay like this when switch is not used by player

- switch on - shows up when switch is used by player and won't turn off back to the "switch off" until player toggles the switch again

 

 

This is what I want:

 

- switch off - switch will stay like this when switch is not used by player

- switch on - shows up when switch is used by player, then turns off after a few seconds so the "switch off texture" is shown.

 

 

I have the "switch on" as 'startoff'.

 

 

I hope this is clear enough, finding it a bit hard to explain this lol.

Link to comment

You'll probably want a trigger_multiple (with usable flag set) and func_wall, instead of a setup with func_usable, then.  

Target the trigger_multiple at the func_wall (which is the switch texture for when it's turned on) and a target_delay, which in turn targets the func_wall. Then in the target_delay, specify the length of time that you want to have the switch texture remain in the ON position. (so multiply number of seconds by 1000, so for e.g. 3000 for 3 seconds)

As far as what the switch actually does, you can just target the trigger_multiple at it.

Link to comment

Make a target_scriptrunner. Give it a -1 count so it can be used infinitely. Copy the following text and make it into an Icarus script with Behaved.

 

 

sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/movers/switches/button_09.mp3" );
use ( $get( STRING, "SET_PARM1")$ );
wait ( 2000.000 );
use ( $get( STRING, "SET_PARM1")$ );

 

 

Now, you see above how it's looking at parm1 to figure out what exactly to use? Since we didn't make the scriptrunner use on activator, you can simply designate parm1 on that entity(the target_scriptrunner)

 

For example, "parm1" "SwitchName".

 

 

 

Obviously you have your two func_usable entities as switches, one with your on texture the other with your off texture. Since you want the Off texture one to be displayed constantly when not in use, give it "targetname" "SwitchName". For the other func_usable with the On switch texture, check the spawnflag box for Star Off. ("spawnflags" "1" I believe)

 

 

Also give it the targetname "SwitchName".

 

 

Create a trigger brush over the switch, and target it at the scriptrunner. When the player activates the trigger it hits the scriptrunner, which runs the script. It uses whatever entities are named in parm1, waits 2 seconds and then uses them again. Since one func_usable is on, when used it will disappear. The other one that starts off will appear. After the two seconds the second use will revert the switches back to their original states.

 

 

Make sense?

Link to comment

It works somewhat, the "on" comes on when you press the switch but lingers until the lift goes back to the bottom floor. The only thing I can do, otherwise I get overlapping switches with the effect outlined in the above post. :\

Link to comment
  • Solution

Ok, so the method used in Kejim_post.map works. Using ref_tags to move the elevator, and func_usable for all switches.

 

Thanks guys for the help, your suggestions helped me learn a fair bit about what does what. :D

 

 

 

 

P.S There is no "best answer" but I'll mark this post as the "best answer" to mark this topic solved. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...