Portal 2

Portal 2

39 betyg
[PuzzleMaker] fix prop_floor_button output bug
Av 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
   
Utmärkelse
Favorit
Favoritmarkerad
Avfavoritmarkerad
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:


example:
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.

logic_branch:
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.

editoritems.txt
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':

original:


modded:


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

2) search for text:
"instances/p2editor/floor_ball_button_black.vmf"

3) a few lines beneath that text, look for:
"Outputs" and "CONNECTION_STANDARD"

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
FAQ
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
10 kommentarer
GallantArc302 15 feb, 2020 @ 7:58 
I'm pretty sure you can also do this as Atlas but it's much harder.
1gideon5 27 jun, 2018 @ 11:48 
how to get beemod?
4vul 25 jul, 2017 @ 0:35 
i am TRYING to get beemod 2.4!
DrFauli  [skapare] 24 jul, 2017 @ 4:58 
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 24 jul, 2017 @ 0:09 
yes.
DrFauli  [skapare] 23 jul, 2017 @ 21:47 
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 23 jul, 2017 @ 16:44 
I broke it and when i stood on the button my game crashed!
DrFauli  [skapare] 22 jul, 2017 @ 5:14 
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 22 jul, 2017 @ 3:00 
Yeah...........................
picklas 20 jul, 2017 @ 15:47 
i feel like there should be more comments