Follow players movement . . ?

Avatar
7Voo
18 Posts
Posted Jun 06, 2011

Hey guys, I'm currently trying to get some life in this little guy:

http://dl.dropbox.com/u/14645664/hammer.JPG

By letting him shoot bullets (rockets).
There is a model called rocket which is exact the same he's wearing as ammo.
Unfortunately he has no animation, but I can still let him rotate.

I first made a spawner for the bullets.
But I couldn't track these because they are no physics objects.

So now I made a func_tracktrain and parented the rocket to it.
Because I want to rotate the guy later I need to track the rocket/tracktrain so it'll explode and start from the beginning if it hits a wall.

Also I need to know how to let objects rotate (follow) to the players movement.
If anyone knows a solution please answer. (:

Advertisement
Registered users don’t see ads! Register now!
Avatar
7Voo
18 Posts
Posted Jun 06, 2011
Replied 2 hours later
I GOT A SOLUTION!! :biggrin:

I had to set the model to prop_physics_override.
Then suround it by a trigger_once which sets the !acttivator parented to the tracktrain.

Avatar
7Voo
18 Posts
Posted Jun 06, 2011
Replied 4 hours later
Now I just need to know how to let something follow the players movement . .
Avatar
Kasc
77 Posts
Posted Jun 06, 2011
Replied 1 hour later
parent an entity to the player on spawn.
Avatar
7Voo
18 Posts
Posted Jun 06, 2011
Replied 23 minutes later
Actually I just want to track the movement, so I can rotate things facing to the players position.
Avatar
Kasc
77 Posts
Posted Jun 06, 2011
Replied 6 hours later
Yes, but to do so you need something to target that you can call upon in hammer. If you place the spawn point within a trigger that sets the parent of an info_target to the !activator (making sure the info_target is in the spawn points position then you can use the info_target's position for the players.
Avatar
yohoat9
274 Posts
Posted Jun 06, 2011
Replied 34 minutes later
Can you make a vmf of this if you get it to work? Would be greatly appreciated.
Avatar
7Voo
18 Posts
Posted Jun 07, 2011
Replied 9 hours later

yohoat9 wrote:
Can you make a vmf of this if you get it to work? Would be greatly appreciated.

Yes maybe, I'm going to release the map anyways.

Kasc wrote:
Yes, but to do so you need something to target that you can call upon in hammer. If you place the spawn point within a trigger that sets the parent of an info_target to the !activator (making sure the info_target is in the spawn points position then you can use the info_target's position for the players.

Since the rocket the turret shoots, is controlled by a func_tracktrain and func_rotating or func_door_rotating have to target to rotate to, I tried to set the parent of a "path_track" to the !activator when triggered.
But it doesn't seem to work. I tried this with the !activator as the player and with a cube as the !activator.
I also tried it via the target but this wouldn't make any difference anyway.

Avatar
7Voo
18 Posts
Posted Jun 08, 2011
Replied 23 hours later
No one has an answer ? :/
It would help me too if I had an alternative for the tracktrain.
I tried env_shooter, but it has no target and does no damage . .

The env_laser can follow the player, but I can't make use of this, since it doesn't rotate the source block.
There must be a simple way to create a npc.

Avatar
Rand0mNumbers
76 Posts
Posted Jun 11, 2011
Replied 2 days later
Use Func_tank and send it the following input: SetTargetEntity !player. Then, send it "Activate" when you want it to start tracking (No control volume needed).

That's what is used here: http://www.youtube.com/watch?v=wa6QaGCFWeE

Avatar
7Voo
18 Posts
Posted Jun 11, 2011
Replied 9 hours later
Mh, I've been playing around with func_tank a bit before, but I didn't know it can move/rotate automaticly.
But there is another thing that I need now. A thing, that shoots . . currently it "shoots" via a func_tracktrain but I would need to clear the parent everytime it shoots and get it back to the objekts rotate position so it'll shoot out of the weapon thing again . .

Right now I stoped the objekt (the turret) everytime it shoots.
I'm currently uploading a video for demonstration.

Avatar
7Voo
18 Posts
Posted Jun 11, 2011
Replied 3 hours later
Here it is: http://www.youtube.com/watch?v=wNkp2b62Boo (:
Avatar
Rand0mNumbers
76 Posts
Posted Jun 11, 2011
Replied 5 hours later
If I understand correctly, you need the projectile to return to the turret after it explodes. Couldn't you use a template to spawn the projectiles and kill them upon detonation? That way, when you need another projectile, you send the template "ForceSpawn" and repeat as necessary?

Alternatively, you could use a point_futbol_shooter, parent it to the func_tank, and have it fire at set intervals.

Avatar
7Voo
18 Posts
Posted Jun 12, 2011
Replied 12 hours later
Yup that would be the solution, but the problem is I don't know how to set a targetname for the spawned objekt . . :neutral:

I tried the filter and stuff, but it didn't seem to work.
I could use the !activator, but that could be a cube too.

Or would it work if I create a filter for the cube that won't let him pass ?
But the problem there again would be that the cube gets spawned too.

A last solutuion that I haven't tried yet would probably be to set an "AddOutput" to the activator right where it spawns, but I don't exactly know, how this AddOutput thing works. Something like AddOutput -> !activator -> targetname rocket ?

Advertisement
Registered users don’t see ads! Register now!
Avatar
Rand0mNumbers
76 Posts
Posted Jun 12, 2011
Replied 7 hours later
The spawned object will have the same targetname as defined in Hammer every time (you have to name it for the template to use it).

I suggest taking a look at the VDC for AddOutput, but you're pretty much right.