Problem with func_portal_detector
Quote from Metafrank on July 20, 2011, 2:57 pmHey, got another problem.
Here's the situation: I want something to trigger when you place 2 portals linked to each other in 2 different specific places.
To achieve that, I tried different things:1. Created 2 brushes, one at each of the spots I want a triggering portal to be, selected both and turned them into a func_portal_detector together. Then I had the effect trigger via "OnStartTouchBothLinkedPortals"
Result: It works, but when I put 2 portals next to each other at only one of the two spots, the effect gets triggered when it should not.2. Created 2 different func_portal_detectors and a math_counter. Made both detectors add 1 to the counter via "OnStartTouchLinkedPortal" and substract 1 via "OnEndTouchLinkedPortal" and had the math_counter trigger the effect via "OnHitMax" (which was, of course 2).
Result: It works, but the problem is that walking through a fizzler does NOT seem to fire "OnEndTouchLinkedPortal", thus not substract from the counter. That means that you can place a portal at only ONE of the two desired spots, walk through a fizzler and do the same thing a second time, triggering the effect when it should not.My solution would be to create a trigger the size of every single fizzler in my map that resets the counter to 0 when touched, but is there a more elegant solution?
Hey, got another problem.
Here's the situation: I want something to trigger when you place 2 portals linked to each other in 2 different specific places.
To achieve that, I tried different things:
1. Created 2 brushes, one at each of the spots I want a triggering portal to be, selected both and turned them into a func_portal_detector together. Then I had the effect trigger via "OnStartTouchBothLinkedPortals"
Result: It works, but when I put 2 portals next to each other at only one of the two spots, the effect gets triggered when it should not.
2. Created 2 different func_portal_detectors and a math_counter. Made both detectors add 1 to the counter via "OnStartTouchLinkedPortal" and substract 1 via "OnEndTouchLinkedPortal" and had the math_counter trigger the effect via "OnHitMax" (which was, of course 2).
Result: It works, but the problem is that walking through a fizzler does NOT seem to fire "OnEndTouchLinkedPortal", thus not substract from the counter. That means that you can place a portal at only ONE of the two desired spots, walk through a fizzler and do the same thing a second time, triggering the effect when it should not.
My solution would be to create a trigger the size of every single fizzler in my map that resets the counter to 0 when touched, but is there a more elegant solution?
Quote from Skotty on July 20, 2011, 4:20 pmI will try a solution on my way. I will edit this post if I got a solution (or not).
Edit: Ok I got a good solution (just for Singleplayer!).
The outputs OnEnd-whatever are just partially working on a good way. OnEndPortal works best in this case.I just created two detectors, both will tell their own logic_branch: Yes (value 1) I have a Portal in my volume or No (value 0) I don't have a Portal in my volume.
A branch_listener compares them and if both are 1, it will fire an output. If one of the branches got value 0, it won't fire the output or triggers another one to disable whatever happend.The solution for the fizzlers in this case is very easy. I just made a logic_auto telling all trigger_portal_cleansers (even instances) to fire the output "OnFizzled Detector-Branches SetValue 0".
OnFizzled is just for players with active portals (tested in Singleplayer) not any physics (they use OnDissolved).
How this works can you see in the attached .vmf.
You can use it for your map. I commented all the important entities how they work together.
I will try a solution on my way. I will edit this post if I got a solution (or not).
Edit: Ok I got a good solution (just for Singleplayer!).
The outputs OnEnd-whatever are just partially working on a good way. OnEndPortal works best in this case.
I just created two detectors, both will tell their own logic_branch: Yes (value 1) I have a Portal in my volume or No (value 0) I don't have a Portal in my volume.
A branch_listener compares them and if both are 1, it will fire an output. If one of the branches got value 0, it won't fire the output or triggers another one to disable whatever happend.
The solution for the fizzlers in this case is very easy. I just made a logic_auto telling all trigger_portal_cleansers (even instances) to fire the output "OnFizzled Detector-Branches SetValue 0".
OnFizzled is just for players with active portals (tested in Singleplayer) not any physics (they use OnDissolved).
How this works can you see in the attached .vmf.
You can use it for your map. I commented all the important entities how they work together.
Quote from Metafrank on July 21, 2011, 3:32 pmThanks!
That solution still has the problem that it doesn't trigger when you first put both portal on one of the detectors and then move one of them to the other one, which sadly was the case in my map.I found another way to achieve the effect I wanted without using portal detectors, though.
That OnSpawn + AddOutPut Logic Auto is a very useful trick though, that I'll probably use in some other way.
Vielen Dank jedenfalls f?r den Einsatz!
Thanks!
That solution still has the problem that it doesn't trigger when you first put both portal on one of the detectors and then move one of them to the other one, which sadly was the case in my map.
I found another way to achieve the effect I wanted without using portal detectors, though.
That OnSpawn + AddOutPut Logic Auto is a very useful trick though, that I'll probably use in some other way.
Vielen Dank jedenfalls f?r den Einsatz!
