Logic gates and one way invisible-wall

Avatar
solix
11 Posts
Posted Aug 23, 2012
Hi, I'd like to add logic gates to my map, but there are no logic_gate entity or anything like that and the wiki does not cover it.
So how do you make simple gates surch as AND OR and XOR (I see how to build the XOR with one logic branch but there got to be an easier solution...)
I successfully built an AND gate with one logic compare but when one input got a falling edge the "close" animation of the door would play. Obviously I want it to play the animation only if it was open, as you would expect...

Then I would like an invisible wall (player_clip) toggle-able and one direction. When not activated the player can go both ways in the door. And when activated the player can go one way (if he is on the right side when the wall is activated) but can not come back.
I know it sounds weird but this is to prevent cheating with bunny hop.

Thank you :wink:

Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Aug 23, 2012
Replied 29 minutes later

The wiki does cover logic gates. You must have missed it.

https://developer.valvesoftware.com/wiki/Logic_gate

Also preventing cheating solutions, fine. However stopping bhoppers: this is a little outrageous. 99% of all people that will play your map cannot bhop and therefore is a lot of extra work for a small audience.
If this is purely a timing issues which can be beaten, then move the corridor etc futher away.

Avatar
Brainstone
401 Posts
Posted Aug 23, 2012
Replied 6 minutes later
You probably are looking for a logic_branch_listener. It can listen to multiple logic_branches you give and has the Outputs "OnAllFalse" "OnMixed" OnAllTrue". the Outputs are fired when one of the branches change state.

AND-Gate is OnAlltrue
XOR-Gate is OnMixed
OR-Gate is when you perform the same actions with the OnMixed and the OnAllTrue Output (Probably you want to trigger the same logic_relay which has then several OnTrigger Outputs.)

For your invisible wall: You may tie a playerclip brush into a func_brush, which you then can enable/disable. But that's not exactly what you want. You could try a strong trigger_push which is enabled/disabled. The player will notice though, when he is speeded up while passing in the allowed direction.

Avatar
solix
11 Posts
Posted Aug 23, 2012
Replied 28 minutes later
I might not add a player clip for bhop, if they can bhop they probably deserve bypassing this part of the puzzle...

As for the logic gate, it works fine except for the closing door part, the door closes when it's already closed.
OnAllTrue | ExitDoor | SetAnimation | open
OnMixed | ExitDoor | SetAnimation | close

The problem is, if all the inputs are low and one goes high it triggers the OnMixed output... How am I supposed to fix that ?

Avatar
zivi7
649 Posts
Posted Aug 23, 2012
Replied 57 minutes later
You could use a math_counter.

Make your different test elements add 1 to the counter when they're activated and subtract 1 when they're deactivated. If you have 5 test elements that need to be activated at once for the door, set the maximum value of the math_counter to 5. Give it an output to open the door "OnHitMax" and to close the door "OnChangedFromMax".

Avatar
ChickenMobile
2,460 Posts
Posted Aug 23, 2012
Replied 18 minutes later
You could always disable the relevant relay to close it once it has been triggered to close and then enable once it is fully open etc.
Avatar
FelixGriffin
2,680 Posts
Posted Aug 23, 2012
Replied 48 minutes later
But XOR would have to be more than OnMixed, you'd need to find if it were even or odd.
Avatar
solix
11 Posts
Posted Aug 23, 2012
Replied 20 minutes later
Thank you all for your help, zivi7's technique is just perfect !
By the way, why when I place a prop_static with this world model : models/props/portal_door_bits_left.mdl it doesn't show in portal ?
Avatar
Bluntman
18 Posts
Posted Aug 23, 2012
Replied 1 hour later

solix wrote:
By the way, why when I place a prop_static with this world model : models/props/portal_door_bits_left.mdl it doesn't show in portal ?

In case you didn't figured it out myself: use prop_dynamic for this model (check the info tab in model browser for available prop types)

Avatar
solix
11 Posts
Posted Aug 23, 2012
Replied 52 minutes later
Ho thanks, that makes sense... Sorry for all those very basic questions.
Avatar
portal2tenacious
393 Posts
Posted Aug 23, 2012
Replied 2 hours later
How far away is the gap? If it gets far enough, you would only need to raise it about 8 units for it to prevent anyone. Even a piece of debris or aesthetic edge could work, depending on the theme.
Avatar
DaMaGepy
361 Posts
Posted Aug 23, 2012
Replied 1 hour later
I use math_counters for almost everything. You can for example set it: onhitmax open, onchangefrommax close, and instead of changing logic branches true, you add 1, on false you substract 1, and change the max value to the number of logic branches.
Avatar
solix
11 Posts
Posted Aug 24, 2012
Replied 10 hours later
Yep math counter seams to be the way to go for gates.

My gap is 184 long, is quite simple to bunny hop ?

Avatar
portal2tenacious
393 Posts
Posted Aug 24, 2012
Replied 6 hours later
184 is about my limit on a good circle jump, so yes. 256 is where a player would cube jump, because it's hard to make a jump over 256 gaps. I like 190 because only a person who bunny hop can make that by jumping, so if you really don't want to let people over there, an invisible wall would work.
Avatar
protoborg
288 Posts
Posted Aug 28, 2012
Replied 4 days later
I think the OP does not understand what bunny hopping is. Bunny hopping is a technique where the player uses a series of rapid short jumps. These jumps mimic the hopping of a rabbit, hence the name. The technique is usually used to move through the test chamber faster. However, bunny hopping has just the opposite effect. It tends to slow you down as each hop drains momentum from your forward movement speed. This is why the technique is not employed by most players. It is also NOT a highly skilled technique. ANYONE can bunny hop successfully.

The gap needs to only be further than the length of a single jump to prevent people jumping it. That means that any gap of one wall or floor panel length is sufficient to prevent jumping it. I believe that distance is 128 units.

Logic gates are actually really simple when done in the PeTI. AND gates merely require two or more inputs tied to a single output.

Advertisement
Registered users don’t see ads! Register now!
Avatar
portal2tenacious
393 Posts
Posted Aug 28, 2012
Replied 4 hours later

protoborg wrote:
I think the OP does not understand what bunny hopping is. Bunny hopping is a technique where the player uses a series of rapid short jumps. These jumps mimic the hopping of a rabbit, hence the name. The technique is usually used to move through the test chamber faster. However, bunny hopping has just the opposite effect. It tends to slow you down as each hop drains momentum from your forward movement speed. This is why the technique is not employed by most players. It is also NOT a highly skilled technique. ANYONE can bunny hop successfully.

The gap needs to only be further than the length of a single jump to prevent people jumping it. That means that any gap of one wall or floor panel length is sufficient to prevent jumping it. I believe that distance is 128 units.

Logic gates are actually really simple when done in the PeTI. AND gates merely require two or more inputs tied to a single output.

No. Not even close. Bunnyhopping is simply strafing while jumping as soon as you hit the ground. This is a tutorial on how it is done and works.

http://www.youtube.com/watch?1&v=CzELVBOZikk