Portal 2

Portal 2

35 ratings
[PuzzleMaker] fix prop_floor_button output bug
By DrFauli
The 'prop_floor_button' instance used within the PuzzleMaker has a bug.
I recommend all map-makers to fix the instance with the help of this guide.

#bug #glitch #bugfix #glitchfix #button #floor_button #ValvePleaseFix
description of the bug
• happens only in coop mode
• can only be caused by the client (p-body)
• can happen by accident or willingly

how it happens:
1) the client steps on a floor_button for a very short time or jumps repeatedly
2) the outputs of the button will (at some point) get reversed

the bad outcome:
• Whatever is connected with that button will then be permanently toggled.
• Which leads to broken puzzles and/or confused players.

outputs explained:
player stands on button > button > OnPressed > [enable connection]
player leaves the button > button > OnUnPressed > [disable connection]

If you press and release the button fast enough, the enable part is sometimes send
just after the disable part, which leads to permanently toggled connections.
why you should fix it
• it is a bug
• breaks puzzles
• leads to confusion
• might lead to negative feedback
• can happen on all cooperative maps

ingame normal:

ingame bugged:

Buttons are connected to other objects to enable or disable them.
You build your puzzle around that mechanic and trust that it is working.

Now imagine some players on your cooperative map are able to bypass
a big part of the map, because the connection of the button was enabled
all the time, altough no player was standing on the button.

The bug can happen by accident and I have seen many people report it.
Some of them did not even notice that it was a bug.
Which leads to confusion or broken puzzles.
fixing the bug
In order to fix the bug we have to make sure, that the output states
'pressed' and 'unpressed' are always send correctly.

Now we can't edit how the button itself works very easily,
so we use another entity to handle the outputs instead.

The 'logic_branch' entity stores a boolean value (true or false)
in the form of '1' for true and '0' for false.

Now everytime the button is pressed or unpressed we toggle the stored
value of the branch in order to always have a correct connection state.

output flow and connection state
button > OnPressed > branch > ToggleTest
button > OnUnPressed > branch > ToggleTest

branch > OnTrue > [enable connection]
branch > OnFalse > [disable connection]

developer console debugging
<<< normal | bug >>>

As you can see here, the button outputs are switched (after jumping on it)
and the branch still sends "FALSE" as the last connection state.

The PuzzleMaker loads all information about the used instances
from the 'editoritems.txt' file, which includes the connection input/outputs.

In order to integrate the 'logic_branch' into the buttons logic,
we have to change the 'ConnectionStandard':



step by step:
1) goto and open:
"Steam\steamapps\common\Portal 2\portal2_dlc2\scripts\editoritems.txt"

2) search for text:

3) a few lines beneath that text, look for:

4) change the "Activate" and "Deactivate" part to:
"Activate" "instance:branch;OnTrue"
"Deactivate" "instance:branch;OnFalse"

5) save the file and also make an extra copy of the modded file
If the game gets updated you might have to change the editoritems.txt again.
So make sure to make a copy of the modded file to make it easier next time.
fixing the instances
If you know how to work with the Portal 2 Authoring Tools Beta (Hammer Editor),
then you might aswell go ahead and try to fix the bug yourself with the information provided.

files that need fixing:
• floor_button_white_intact.vmf
• floor_button_black_intact.vmf
• floor_cube_button_white.vmf
• floor_cube_button_black.vmf
• floor_ball_button_white.vmf
• floor_ball_button_black.vmf

free download:
For all the other people, that don't know how to use the Hammer Editor,
I have provided the fixed instances via download here:

downloading the fixed instances:
1) click on this link[forums.thinking.withportals.com]
• find and click the "Download" button on that Page

2) go to your Steam folder an navigate to:
"Steam\steamapps\common\Portal 2\sdk_content\maps\instances\p2editor\"

3) extract the downloaded instances into that folder
• overwrite existing files
game file integrity checks and updates
Whenever there is an Portal 2 update, or when you manually check the integrity
of your game files, the 'editoritems.txt' and the fixed instances will be overwritten
and therefore you have to replace these files again with the modded version.
Just keep a copy of each file in a subfolder for easy access.

How did you find this bug?
• noticed it myself while playing coop maps
• heard about it several times from other people
• have been informed about it being present on ALL of my workshop maps
the bug is present on all cooperative maps - so you gotta find it sooner or later

How did you know how to fix it?
• try and error (including several solutions that did NOT work)
• luck and a bit of logic

Why do you edit the cube and ball buttons too?
• Cube and ball button are not actually broken/bugged, but the PuzzleMaker
has the same "ConnectionStandard" for all of them (defined in editoritems.txt).
• This leads to the need of changing all 3 kind of buttons in order to make them work normal.

Why is Valve not fixing it?
• I would love to hear the official answer from Valve myself...

I am not a map-maker - do I need this?
• only if you plan on using the ingame PuzzleMaker / Editor
• and only if you then decide to create a coop map
• ... and then finally decide to upload it into the workshop
• otherwise: no, you don't need this

proxy > ProxyRelay
The 'func_instance_io_proxy' or just 'proxy' is used within instances
to deliver input and output message from and to an instance.

ProxyRelay just takes the output of the calling entity and relays it to the next higher instance:
proxy OnProxyRelay > button;OnPressed
proxy OnProxyRelay > button;OnUnPressed

thumbnail credits
• thumbnail from http://www.thinkwithportals.com

I still have questions...
• leave a comment

guide creation
16. July 2017 - by DrFauli
< >
GallantArc302 Feb 15, 2020 @ 7:58am 
I'm pretty sure you can also do this as Atlas but it's much harder.
1gideon5 Jun 27, 2018 @ 11:48am 
how to get beemod?
4vul Jul 25, 2017 @ 12:35am 
i am TRYING to get beemod 2.4!
DrFauli  [author] Jul 24, 2017 @ 4:58am 
If your game keeps crashing, you might consider to check the game file integrity
of Portal 2 and then just make sure to carefully repeat the steps of this guide.

Maybe you changed something wrong, which leads to the crash.

Also: Are you using BeeMod 2?
If you do, I think it uses other instances and a different setup in edioritems.txt.
4vul Jul 24, 2017 @ 12:09am 
DrFauli  [author] Jul 23, 2017 @ 9:47pm 
I personally did not hear about a crash to desktop, when you stand
on the buttons. But it might be something that happens to some people
on different machines.

Did you try to fix the instances with the files provided in the guide yet?
4vul Jul 23, 2017 @ 4:44pm 
I broke it and when i stood on the button my game crashed!
DrFauli  [author] Jul 22, 2017 @ 5:14am 
One of many serious bugs in Portal 2 coop-mode.
I am glad I was able to fix it, because it can be quite annoying.

Reading the reports of players, who did not understand why it happened,
was just sad and it frustrated me to have no way around the bug.

I do hope that map-makers realize that they should use the fixed instances
on their own maps aswell - in order to get rid of the bug.
4vul Jul 22, 2017 @ 3:00am 
picklas Jul 20, 2017 @ 3:47pm 
i feel like there should be more comments