Lasers for the most serious map

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
Ok, so this is for a goofy map, but my problem is driving me nuts.

I'm trying to have a certain model move around the map, rotating and shooting the laser along a set path, shooting out until it hits a brush and stops. I can do the movement and rotation and all that just fine, that part is easy enough.

The part I'm looking for is the above bolded section. I want it to cut itself shorter as it hits geometry, so it doesn't go past it. Tracking the end to the surface isn't really an option due to the complex movement I want it to do. I have tried env_laser and env_beam, but both behave the same way, just going from point a to point b, regardless of geometry.

I feel like this should be something that is really easy to do with a game engine. Anyone have any ideas?
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
Ok, this is weird. I got it to kind of work by extending an extremely long connection for the env_laser, but for some reason, the laser goes in reverse.

As in, the origin point (LaserA1) goes in the opposite direction of the target (LaserA2), shooting up inside of the prop. Interestingly, I can see it adjusting it's distance as the prop moves! So.... That's a fun bug.
 
Mar 23, 2013
1,013
347
I think the laser dosn't point away from the target, it goes to point 0 0 0. This happend to me when the parent of the laser gave me huge problems for a map.

As far I remember, only env_beam can be parented without problems, but only to a func_track_train, and env_laser should not have parents from the beginning, instead give it a setParent input with a info_relay....

Unfortunately I noticed that this won't work anymore after the map has reseted and pointed in really random directions.... it was really strange and in the end I used a custom particle effect as laser with a trigger_hurt :/
 
Last edited:

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
I actually already have 3 env_lasers parented on the map, 2 to track trains, and 1 to func_door_rotating.

I might have to figure something else out, but I'm REALLY hoping to get the effect I'm looking for accomplished.

Thanks for your insight on it, though.
 
Last edited:

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
Ok, after fighting it all day I figured it out.

Env_laser has to be targeting a func_brush, NOT a info_target. They didn't work while parented to a prop_dynamic, but now work that I changed their parent to a tracktrain. The target has to be at least as far away as the furthest point you want your laser to go. In my case, this has to be huge, but it's doable.

Victory!

edit: It also works parenting it to a momentary_rot_button which is in turn parented to a tracktrain.
 
Last edited:

deadsource

L3: Member
Jul 11, 2011
121
55
Men, I think we witnessed something magical today- a person who could solve his own problem.
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
9 times out of 10 if I finally give up and post my question on here I solve the problem myself minutes later. Yesterday it took hours.

Sometimes just "talking" out a problem can help solve it. Probably why I verbalize all my entity i/o work and drive those around me nuts.
 

Beetle

L9: Fashionable Member
Aug 17, 2008
627
178
It's infinitely better than the useless response "nvm fixed"
 

deadsource

L3: Member
Jul 11, 2011
121
55
Well the "nvm fixed it" usually comes from people who think that they were stupid for not realising what the problem was in the first place. Although they still should post the answer or at least delete the question entirely so that search engines don't index them. Well, that's where the matureness of the internet user kicks in, I suppose.

//I feel stupid for writing this