Raised This Month: $ Target: $400
 0% 

Camera after Dying


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlueRaja
Senior Member
Join Date: Nov 2004
Old 11-28-2004 , 01:11   Camera after Dying
Reply With Quote #1

After a player is slayed by setting their health to -1, the camera just moves up and out, and hovers for a second or two above the victim's body.
Is there anyone to force the camera to look towards a specific point (say the center of the map) or towards a specific player (say the admin of the server)?
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
BlueRaja
Senior Member
Join Date: Nov 2004
Old 11-28-2004 , 23:15  
Reply With Quote #2

ok, let me rephrase it then
I'm trying to write this for CS, and CS only.
I've heard that I can create entities, and attach_view them, to make players see through the entity's "eyes". Soo...
1. Is there any way I could move/rotate these entities while the user is attached to them?
2. If so, how would I know what direction to look (that is, if I *can* rotate the view of an entity, how would I make it look towards a certain player or point (x,y,z))?
3. After a few seconds, I'd like for the player to follow living players, as he normally would after dying. I'm assuming that unattaching a view from an entity would bring a player back to his normal view; so...how do I unattach a view? (I'm sorry if that's not proper terminology, but I couldn't think of a better way of putting it)
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 11-29-2004 , 07:35  
Reply With Quote #3

Set his view back to himself.

Code:
engfunc(EngFunc_SetView, id, otherent)

Then later

Code:
engfunc(EngFunc_SetView, id, id)

Where id is the player and otherent is the ent the player should look through.
Johnny got his gun is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 11-30-2004 , 17:50  
Reply With Quote #4

ok, here's what I've got so far (with some help from Damaged Soul):
1. When the victim dies, I'm going to spawn a target_camera entity at get_user_origin(victim) - this camera can be told to follow (that is, watch) the attacker.
2. When the victim dies, the camera typically moves back, away from the victim, on the vector (line) created by attacker-victim. I can do this, I think, by normalizing the vector (to get the angle of the vector) and telling the camera to move in that direction.
3. If the attacker moves, the camera should still focus on both the victim and attacker by "swiveling" around the victim to view the attacker. I don't know how I'd do this without updating every 0.1 seconds (Although I don't even know how I would do that), which I'm afraid might lag up the server for the two+ seconds the victim is using the camera (especially if there's more than one camera at once!). I don't know, though...there wouldn't be *too* many calculations...

Furthermore, I'd like this swiveling to take place *while* the camera is moving away from the player. Again, I could do this with vectors, if I knew how to update every 0.1 seconds, although if anyone has a better idea, my ears are open.

Thanks in advance for any insight you might be able to provide ^_^
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode