Logic_measuremovement measuring eyes, moving an invisible brush
Energy ball launcher entity parented to brush
Nonfunctional portal gun
Game_ui
4 linked_portal_doors
8 info_particle_systems on the portals, 1 per projectile color
1 trigger_multiple to detect energyballs and parent everything to them
Some entities to control orientation (maybe func_tank?)
Felix's Hammer Notepad
A word of advice to anyone thinking of implementing a similar mechanic: make sure there's at least one unit between the two back-to-back world portals, or there'll be that annoying stutter.
wow I'm amazed that I got that right!
Also, couldn't you also use prop_portals alternatively, for a less squared appearance?
By the way, I added some simple checks to prevent portals from being placed touching walls on the sides. Since I'm having great difficulty with portal bumping it just makes it fizzle for now.
Something that may help you check for collisions: try moving an env_entity_maker with the "ForceSpawn: only if room" checked to where the portal should be, then try to ForceSpawn in an invisible func_brush/model the size of the portal. If it fits, the maker should fire a OnSpawned output which you could use to replace the placeholder with a real portal. If it instead outputs OnFailedSpawn, offset it a bit or something and try again. This could allow slight adjustments to be made.
The second is brilliant, and I'm going to try that today. It's far more elegant than my solution (tracing lines between the center of the portal and a bunch of points on the edge), and will detect brush entities as well as world brushes. It'll probably run faster as well, as the env_entity_maker code is all C++.
What you also could do, is add 4 info_targets to the template, one at each corner. After spawning the template, use the TraceLine() script function between each two targets (along each edge) to check for collisions. If one of those tests does not return 1.0, it means that the portal is partially inside a wall and should not be opened.
TraceLine() is a bit finicky in that it only detects world brushes, func_details and func_physboxes. So you may have to take special measures for things like fizzlers and windows. (I have done that with the new version of the sendificator. It's not as bad as it sounds.)
I was actually considering switching to the older Sendificator method, with the lasers (as that would prevent things like opening a portal inside a prop_physics). Are there significant drawbacks to that?