A brush that does a command when you touch it.

A brush that does a command when you touch it.

Re: A brush that does a command when you touch it. Posted by Blargdaniel on Sat May 10th 2008 at 12:19am
Blargdaniel
19 posts
Posted 2008-05-10 12:19am
19 posts 2 snarkmarks Registered: Apr 17th 2007 Occupation: Student Location: Australia
Is there a way to make a brush entity that actually enters a command into the console when you touch it? For example you might walk into it and it would put noclip in the console so you would then be in noclip mode. It would be useful if something like this existed.
Re: A brush that does a command when you touch it. Posted by Riven on Sat May 10th 2008 at 12:35am
Riven
1640 posts
Posted 2008-05-10 12:35am
Riven
Wuch ya look'n at?
super admin
1640 posts 1266 snarkmarks Registered: May 2nd 2005 Occupation: Architect Location: Austin, Texas, USA
yea, you can achieve this easily with two entities. You can use a trigger_multiple for your invisible brush trigger area, and a point_clientcommand in order to send the cvar to the console.

The Point_clientcommand works by having other entities send inputs to it. The output from your invisible trigger_multiple will look like this:

My Output> OnStartTouch
Target Entity> Name of your point_clientcommand
Target Input> Command
Parameter> noclip

That would input the "noclip" command into console without you ever actually having to type it in yourself! Note however, if you do not specify "sv_cheats 1" then the command will have no effect. But you can just as easlit fix this by adding in the same output from your trigger_multiple but adding it before your "noclip" command. That should give you the effect you're looking for!
Blog: www.playingarchitecture.net
LinkedIn: Eric Lancon
Twitter:@Riven202
Re: A brush that does a command when you touch it. Posted by Blargdaniel on Sat May 10th 2008 at 12:44am
Blargdaniel
19 posts
Posted 2008-05-10 12:44am
19 posts 2 snarkmarks Registered: Apr 17th 2007 Occupation: Student Location: Australia
Thanks, noclip was just my example but it doesn't matter.
Re: A brush that does a command when you touch it. Posted by fishy on Sat May 10th 2008 at 2:31am
fishy
2623 posts
Posted 2008-05-10 2:31am
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
You'd need a point_servercommand to set sv_cheats, but I don't recommend using it if you're mapping for a multiplayer game. Most server admins wouldn't thank you for a map that messes with their server settings.
i eat paint