Home   Help Search Login Register  

Author Topic: Show me who killed me!  (Read 2080 times)

0 Members and 1 Guest are viewing this topic.

JPSelter

  • Guest
Show me who killed me!
« on: 06 Sep 2005, 10:05:45 »
Right now my coop-mission is like this: I get killed, I lay on the ground for 10 seconds, then I respawn. During these 10 seconds I would like to know who exactly killed me. So I need a camera ride like in singleplayer mode. I guess I need a camera script. I understood the basics of it but not how the script is triggered and what ID the enemy unit that shot me has got.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Show me who killed me!
« Reply #1 on: 06 Sep 2005, 10:31:28 »
Go to the COMREF in the Editors Depot. Read about addEventHandler "killed" and a script named onPlayerDeath.sqs (or is it onPlayerKilled???)

These are the tools you need to trigger your camera script. The "killed" eventHandler is local, so it requires some publicVariables to work in MP. Might be a good idea to check out that command as well. Then hit the camera tutorials.

EDIT:
The reurned values from the "killed" eventHandler are:
_this select 0 = victim
_this select 1 = killer
« Last Edit: 06 Sep 2005, 11:33:03 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

JPSelter

  • Guest
Re:Show me who killed me!
« Reply #2 on: 06 Sep 2005, 11:06:02 »
I still need to know how I can figure out who killed me. There must be a global variable somewhere...

EDIT: OK, I found an example in the COMREF, thx :)
« Last Edit: 06 Sep 2005, 11:10:37 by JPSelter »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Show me who killed me!
« Reply #3 on: 07 Sep 2005, 19:39:46 »
Go to the COMREF in the Editors Depot. Read about addEventHandler "killed" and a script named onPlayerDeath.sqs (or is it onPlayerKilled???)

These are the tools you need to trigger your camera script. The "killed" eventHandler is local, so it requires some publicVariables to work in MP. Might be a good idea to check out that command as well. Then hit the camera tutorials.

EDIT:
The reurned values from the "killed" eventHandler are:
_this select 0 = victim
_this select 1 = killer


what this means is

place the following code in the following files

INIT.SQS
Quote
player addEventHandler ["killed", {_this exec "deadplayer.sqs"}]

deadplayer.sqs
Quote
_player = _this select 0
_killer = _this select 1
@alive _player
hint format ["I was killed by %1",name _killer]



The above script (Killed eventhandler script), is local to your pc only

Now thats answered your question, but i doubt it's solved your problem :-)
« Last Edit: 07 Sep 2005, 19:46:29 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

JPSelter

  • Guest
Re:Show me who killed me!
« Reply #4 on: 08 Sep 2005, 10:18:42 »
I hope to figure out how the camera animation works. But this should work, as I have a) my own name, b) the killerÂ's name and c) a local animation. WouldnÂ't make sense when all players see my personal death animation :D

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Show me who killed me!
« Reply #5 on: 09 Sep 2005, 01:23:23 »
WouldnÂ't make sense when all players see my personal death animation :D

Local scripts can be very useful MP tools sometimes  :)
OFPEC | Intel Depot
RETARDED Ooops... Retired!

JPSelter

  • Guest
Re:Show me who killed me!
« Reply #6 on: 15 Sep 2005, 15:43:10 »
I have to alter my camera script because one of my fellows doesnÂ't want to see who killed him ;) So I want to change the last camera position from the _killer to my respawn point. My respawn-point dynamically changes its position according to our progress on the island. I have a marker named "respawn_west", so I tried this:

Code: [Select]
; move the camera
_cam camsettarget respawn_west
_cam camsetrelpos [0,-2,2]
_cam camcommit 5
@camcommitted _cam

But itÂ's not working. He stays on my _player and doesnÂ't seem to find my respawn point. How can this be?