Home   Help Search Login Register  

Author Topic: Briefing on player killed  (Read 769 times)

0 Members and 1 Guest are viewing this topic.

Kammak

  • Guest
Briefing on player killed
« on: 07 Apr 2004, 03:39:35 »
Any way to have a mission go to the end-game briefing even if the player has been killed (SP only)?

I've tried several things, messing around with onplayerkilled.sqs, events that fire an End# on player killed, etc...but nothing is working so far.

Can it be done?


Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Briefing on player killed
« Reply #1 on: 07 Apr 2004, 04:13:20 »
You've already tried all the things I would suggest. Really this problem is similar to the problem with creating respawns in SP missions. Basically, there is no way to "catch" the game just before the player is killed. Killed eventhandlers and "onplayerkilled.sqs" execute commands AFTER the player is dead, which means you can't make him alive again (for respawns), or play the briefing apparently (in your case).

Only "hit" EHs will execute commands before the player is killed. So you can make an invincible player that way. However, there is no way to test if the player is "going to die" after the EH script is executed, so you can't use that method for respawns or your problem. :(
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Briefing on player killed
« Reply #2 on: 07 Apr 2004, 17:38:35 »
You can use the "hit" event handler with a script that gets the damage level and keeps him alive, but after two or thre times of seting damage to say .333 you then execute the desired script and then set his damage to 1.  Basically you make a script where you take control of his health away form the OFP op sys.  So you would not be makeing a cheated player, rather you just make sure you know  if he has sustained fatal damage by counting how much health you have restored to him.  When the total  reaches 1 you do your end game script etc. and then kill him.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Briefing on player killed
« Reply #3 on: 07 Apr 2004, 19:55:45 »
Couple of problems with that method. OFP's damage system is actually more complicated than it seems. I still haven't quite figured it all out yet. But I do know that it is possible for a unit to be killed and only have like 0.7 damage. The location where a unit is hit seems to influence how much his 'damage' increases. And how much damage different areas of the body have suffered affects when a unit dies. I think that your method may work, but it may have some unintentional quirks in it. Also, the player would never get bloody or have decreased aim, since he would always be at 0 damage. But it really may be the only way to do this thing.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!