Lasers through Portals?

Avatar
NocturnalGhost
200 Posts
Posted Dec 06, 2007
Does anyone know if it is possible to transmit a laser through a portal? I have a puzzle idea that requires this feature. I have tried using env_beam and env_laser, but both seem to require a starting entity and an ending entity.

Next, I tried using an npc_sniper, but it's beam will not pass through a portal.

I also tried a workaround using the portal turrets, but the rocket turret doesn't seem to be affected by the AI relationship entity, so it kept trying to shoot me, instead of aiming where it was told to.

The closest I got was using a floor turret, but the problem is, i really need the beam to point downwards from it's starting point, which the turret doesn't do, as it thinks it has been knocked over.

I'm probably missing something really simple, but I have been experimenting for a few hours with this, and come up with nothing.

Advertisement
Registered users don't see ads! Register now!
Avatar
msleeper
4,095 Posts
Member
Posted Dec 06, 2007
Replied 5 minutes later
I'm not really sure what it is you're trying to setup, but... You're correct, env_beam and env_laser both require a starting and endpoint. I don't think the actual beam will "travel" through a portal, since all it does is just render a line from A to B - but the good news is that it will render through a wall, the end points don't need to have a line of sight.
Avatar
NocturnalGhost
200 Posts
Posted Dec 06, 2007
Replied 23 minutes later
Basically, I have a large room with a toxic water floor, and moving platforms with buttons, travelling around on a semi-random path. On one side of the room, I have an entity spawner, dropping the object that is needed to trigger the buttons.

The reason i want the laser is to help with targetting, as at the moment, it is very frustrating to fire a portal at the ceiling and judge where the object will hit on the floor, as the room is quite tall.

I figured that a laser, pointing down to the portalable floor where the object starts from would make life easier for players, as when they fire the portal into the ceiling over the slime, they have a bit of feedback on where their portal is, in relation to the floor.

Sorry if this doesn't make much sense. It works better as a puzzle than I have made it sound here, as it s hard to describe. (plus some details are secret)

Avatar
volt
104 Posts
Posted Dec 06, 2007
Replied 9 minutes later
Solution: make any ceiling over water non-portable
Avatar
NocturnalGhost
200 Posts
Posted Dec 06, 2007
Replied 15 minutes later
The ceiling needs to be portalable, as the platforms are moving over the water, and the objects needs to be dropped down from a ceiling portal, onto the moving platforms.

I could completely redesign the puzzle, but i'd rather not at this stage. I just hoped there was some kind of entity that could direct a laser through a portal, as the turrets in portal can do this with no problems.

Avatar
volt
104 Posts
Posted Dec 06, 2007
Replied 11 minutes later
New solution: Place a spotilight on your platforms facing upwards and parent them to the platforms. Make sure you set the radiuses to very small or else you might get a compile error relating to too many dynamic lights on a brush.
Avatar
NocturnalGhost
200 Posts
Posted Dec 07, 2007
Replied 20 minutes later
Are you referring to a light_spot, or an npc_spotlight. I thought light_spots were static, but I may be wrong.

As for npc_spotlights, i only just found out they even existed lol. They look more promising. Is there a limit to how many you can safely use without a performance hit? Because I need quite a few to use the method you described, due to the amount of platforms i am using in this puzzle.

Also, i just found a workaround for the method I originally wanted to use, but it seems like overkill. Basically it involves a friendly turret, and a set of prop_portals to direct it's laser downwards to my entity_spawner. Again, this will cause a performance hit by having 2 sets of portals open, but it seems to work as a crude method of doing what I wanted.

I will experiment with both methods anyway, and figure out which suits my purposes best. Thanks for the ideas.

If anyone has any other solutions, I would be GLaD to hear them.

Avatar
msleeper
4,095 Posts
Member
Posted Dec 07, 2007
Replied 26 minutes later
Well, depending on the effect you want, you can either use light_dynamic (bad idea) or point_spotlight (probably a better idea) to achieve the effect.

A light_dynamic is just that, a dynamic light source. However, keep in mind that Source handles these HORRIBLY, and if you have more than 2 or 3 things that will need light_dynamics parented to them, you probably don't want to go this route. Also keep in mind that the size of the light_dynamic's field will determine how much lag it causes - a larger one will be harder to draw than a smaller one.

A point_spotlight doesn't emit any light (by default anyway), and just creates the visual spotlight effect. There is a flag to have it generate dynamic light, but again, you probably don't want to do this.

EDIT light_spot's are infact static. I have no clue what npc_spotlight does.

Avatar
Remmiz
631 Posts
Posted Dec 07, 2007
Replied 6 minutes later

msleeper wrote:
EDIT light_spot's are infact static. I have no clue what npc_spotlight does.

npc_spotlight is just a spotlight that looks at enemies. I am pretty sure they are used in the Nova Prospekt levels.

You could always make the floor have the texture with a couple different color tiles (usually used to indicate flinging but useful for directing where to put a portal. Or you could also put an npc_bullseye which will cause the player to "auto-aim" at that spot.

Avatar
msleeper
4,095 Posts
Member
Posted Dec 07, 2007
Replied 8 minutes later

Remmiz wrote:
npc_spotlight is just a spotlight that looks at enemies. I am pretty sure they are used in the Nova Prospekt levels.

That's what I figured, but I've never looked closely at that VMF so I wasn't sure.

Avatar
NocturnalGhost
200 Posts
Posted Dec 07, 2007
Replied 10 minutes later
lol, of course. I can't believe i forgot about point_spotlight.
/slaps forehead.

I will probably end up using this method, as it seems to be the cheapest to do, in terms of performance. I was just thinking along similar lines, parenting a sprite to each platform at ceiling height. Point_spotlight sort of does that automatically.

I tried as best as I could to make the architecture easier to find reference points on, but since the floor is mainly slime, I couldn't use indicators there. Also, the ceiling is very high, so I felt I had to resort to finding some sort of "targeting" system to help players get their bearings.

Although, the kid in me still wants to use lasers, just for the coolness factor

Thanks for the help guys.

Avatar
msleeper
4,095 Posts
Member
Posted Dec 07, 2007
Replied 6 minutes later
Here's another though, if you want to use visible lasers.

Have the two info_targets for your env_beam/env_laser parented to a single moving platform, and have one at level with the light/platform/whatever is emitting the laser, and have the other at ceiling level. This will create an obvious visible line from the platform to the ceiling. You can mess with the env_beam's settings so that it fades out before it gets to the ceiling and isn't totally obvious and is more of a hint (though you will probably not want the end point on the ceiling and instead a few units away from it).

Avatar
Hurricaaane
189 Posts
Posted Dec 07, 2007
Replied 11 hours later
Excuse me but the rocket turret aiming at a target works.
The entities I used are a logic_relay, a rocketturret and an info_target.
I set the logic_relay like this: OnSpawn rocketturret SetTarget target_1 (you have to write manually the name of the target). If we get on the way of the laser, it does not shoot.

Advertisement
Registered users don't see ads! Register now!
Avatar
NocturnalGhost
200 Posts
Posted Dec 07, 2007
Replied 51 minutes later
I could have sworn I tried that, but I just tested it using that setup, and it works perfectly lol. I must have made a mistake in the entity setup last night.

I ended up using the floor turret in a small remote room, linked to the main chamber with a prop_portal. I then hid the chamber-side prop_portal inside a func_illusionary, so the laser appeared to eminate from it.

I will probably leave it as it is, as it doesn't seem to affect performance as much as I thought it would. However, I have several uses for laser targetting systems involving portals, so I can definately make use of the rocket turret in one of those.

I'm sure in hl1 (or was it just the spirit mod), that one of the lasers had an option to extend past it's end target. It's a shame this is not an option with portal, although it would probably suffer from the same problem as the npc_sniper in not being able to traverse the portal.

Anyway, thanks for the input guys. All you ideas have helped me in one way or another.