Raised This Month: $32 Target: $400
 8% 

Death Camera, Again


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlueRaja
Senior Member
Join Date: Nov 2004
Old 12-05-2004 , 19:52   Death Camera, Again
Reply With Quote #1

Ok, I'm continuing on a post that I started about a week ago, because no one seems to want to reply to a post with 4 replies already

I'm trying to create a fake camera to do my own things when the player dies (instead of looking at the player who killed them, or the ground in the case of being slayed, it might look upwards or towards the admin of the server or something). Here's what I've got:

Code:
        //Create Death Camera         new entity = create_entity("trigger_camera")         if (entity) {             DispatchKeyValue(entity,"classname","trigger_camera")             DispatchKeyValue(entity,"flags","")             DispatchKeyValue(entity,"origin","8192 8192 8192")             DispatchKeyValue(entity,"acceleration",500)             DispatchKeyValue(entity,"deceleration",500)             DispatchKeyValue(entity,"speed",1000)             DispatchKeyValue(entity,"target","camera_move")             DispatchKeyValue(entity,"targetname",id)             DispatchKeyValue(entity,"killtarget",0)             DispatchKeyValue(entity,"delay",0)             DispatchKeyValue(entity,"wait",3)             DispatchKeyValue(entity,"moveto",0)             DispatchSpawn(entity)             entity_set_string(entity, EV_SZ_classname, "trigger_camera")             new vector[3]             entity_get_vector (id, EV_VEC_origin, vector)             entity_set_vector (entity, EV_VEC_origin, vector)         }         //Attach Player's view to it         engfunc(EngFunc_SetView, id, entity)         //Later, unattach         //engfunc(EngFunc_SetView, id, id)

This creates the camera to look through, and attaches it to the player's view. The only problem is, they look through this camera AFTER the whole sequence of looking at the attacker/ground (that is, they don't look through the camera until after they'd normally be spectating)

Does anyone know of anyway to keep their view on the camera even if they die, or force them to view the camera just after their death?
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Ronkkrop
Member
Join Date: May 2004
Old 12-05-2004 , 21:12  
Reply With Quote #2

could you not just hook the DeathMsg event and as soon as it happens switch their view back to the entity?
__________________
"I refuse to join any club that would have me as a member."
--Groucho Marx
Ronkkrop is offline
Send a message via ICQ to Ronkkrop Send a message via AIM to Ronkkrop Send a message via MSN to Ronkkrop Send a message via Yahoo to Ronkkrop
BlueRaja
Senior Member
Join Date: Nov 2004
Old 12-08-2004 , 01:17  
Reply With Quote #3

Nope - even when I code it in the DeathMSG event, it shows the player dying (with the view overhead), THEN switches the players view to my camera (and no longer allows him to spectate or move; not, at least, until the beginning of the next round).

Any other ideas?
I figured that take_damage() would be perfect for my case; after a few frustrating hours, however, I found out that it was taken out of amxx (although not out of the documentation or .inc files...)
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-08-2004 , 02:26  
Reply With Quote #4

Register the Damage event and make your own take_damage function.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 12-08-2004 , 19:57  
Reply With Quote #5

As far as I'm aware, that's not possible.

The take_damage function is supposed to simulate a victim taking damage from an attacker; with the natives I have available to me, I can only take away health from the victim until the victim is shown commiting suicide.
I can fake the death message (to make it say that the admin killed the victim), and I can fake the scores (to give the victim +1 deaths and the admin +1 frags), but I can't seem to fake the camera (when the victim dies, a camera zooms out from their dying body, looking in the direction of the killer; when a player is slayed, the camera zooms out from the body looking towards the ground).
I either need a way to fake a take_damage to fake to the server an admin doing damage to the victim, or I need a way to move that "death camera" around to have it focus on the admin who slayed them.

Please help! I've been trying to figure this out for weeks, and it's driving me insane!
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-08-2004 , 23:25  
Reply With Quote #6

Send a Damage message to the server then.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
BlueRaja
Senior Member
Join Date: Nov 2004
Old 12-09-2004 , 23:25  
Reply With Quote #7

I've asked around, and from what I've heard, it's not possible to do this with a message; messages "never do anything internally".
http://forums.alliedmods.net/showthr...p?t=202+damage

I'd either need to do it with take_damage or by hooking the camera immediately after death. Since the former has been removed from amxx, I'm left with only one option, which, unfortunately, I don't know how to do.

Can anyone help me out?
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-09-2005 , 18:23  
Reply With Quote #8

While trying to find the message for the intermission in CS, I stumbled upon this message:

Code:
L 01/09/2005 - 18:16:45: [msglogging.amxx] MessageBegin director?(51) Arguments=5 Destination=Spec(9) Origin={0.000000 0.000000 0.000000} Entity=NULL Classname=NULL Netname=NULL
L 01/09/2005 - 18:16:45: [msglogging.amxx] Arg 1 (Byte): 9
L 01/09/2005 - 18:16:45: [msglogging.amxx] Arg 2 (Byte): 2
L 01/09/2005 - 18:16:45: [msglogging.amxx] Arg 3 (Short): 1
L 01/09/2005 - 18:16:45: [msglogging.amxx] Arg 4 (Short): 1
L 01/09/2005 - 18:16:45: [msglogging.amxx] Arg 5 (Long): 39
L 01/09/2005 - 18:16:45: [msglogging.amxx] MessageEnd director?(51)
I am certain it is the death camera. You can try playing around with it. These are the arguments I got while I was by myself as a Counter-Terrorist on de_dust (id #1) and used "kill" in console.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 01-10-2005 , 08:16  
Reply With Quote #9

did you change their deadflag? Change it from 3 to 2. 3 means they are w/in the death animation. 2 just means they are dead and respawnable.

Try that
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
BlueRaja
Senior Member
Join Date: Nov 2004
Old 01-10-2005 , 19:34  
Reply With Quote #10

This is what I've found out:
Code:
        //Call Director (move death-camera to aim at killer)         message_begin(MSG_SPEC, gmsgDirector)         write_byte(9)                  //???  This number is always 9         write_byte(2)                  //???  This number is always 2         write_short(id)      //Victim         write_short(attacker)            //Attacker         if (headshot) {             write_long(105)     //This long seems to only be 105, when the attacker gets a HS         } else {                            //39, when the attacker doesn't             write_long(39)          //5, when (????) - has nothing to do with DeathMsg :S         }                           //I've also seen a 6, a 139, and a 687 - I don't know what they do //maybe something about the player switching views, or Damage?  I'll have to look into it.         message_end()
That didn't work...so DS suggested I register the message:
Code:
public plugin_init(){     register_message(51,"director_event")     ... } ... public director_event(msg_id,msg_dest,msg_entity) {     new msgarg = get_msg_arg_int(5)     if ( msgarg==39 ||          msgarg==105)     {         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
However, now the plugin doesn't work at all (although it doesn't give any errors at runtime, and is said to be running successfully under amxx list). Before using the above code, I used "read_data(5)" instead of "get_msg_arg_int(5)", and, although that still didn't give me the camera effect I'm looking for, the rest of the plugin still worked (hooking Damage as it's supposed to).
It should be noted that I'm using register_event() to register Damage, if that makes a difference (I can't use register_message(), from my understanding, because I call several message_begin()'s).
Any ideas? :S
BlueRaja is offline
Send a message via AIM to BlueRaja Send a message via MSN to BlueRaja
Reply


Thread Tools
Display Modes

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 13:50.


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