Home   Help Search Login Register  

Author Topic: Units killer cutscene  (Read 786 times)

0 Members and 1 Guest are viewing this topic.

Comerade

  • Guest
Units killer cutscene
« on: 19 Nov 2005, 21:56:54 »
I have been making a  shooting range kind of a multiplayer map (  2 guys shoot moving targets on desert island (sniping training)) and I wanted to attach a cutscene to a particular guy. When he is killed the camera aims at killer (me or my friend) who shot him. But i dont know howto do that. I have put   :
_killer =_this select 0
_c= "camera" camcreate [0,0,0]
_ c cameraeffect ["internal", "back"]
_c camsettarget _killer
_c camcommit 0

etc...
 But the cam appears in ocean and does nothing >:(
Help would be apreciated :)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Units killer cutscene
« Reply #1 on: 20 Nov 2005, 11:44:33 »
first thought is that there's a space here -

Code: [Select]
_ c cameraeffect ["internal", "back"]
second thought is how are you defining _this select 0? is this camera script called from an event handler? some more information would help us help you better ;)

Comerade

  • Guest
Re:Units killer cutscene
« Reply #2 on: 20 Nov 2005, 13:06:47 »
Well i snatched that  _killer= _this select  from onplayerkilled.sqs
Because there the cam aims at the guy who killed player (thought it would work with ai but nothing happens).

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Units killer cutscene
« Reply #3 on: 20 Nov 2005, 13:55:21 »
if your script bits are within onplayerkilled.sqs then it should work fine. be aware that variables with an _underscore before them are local, so if you are using _killer in another separate script, flashpoint won't know what it is. however, if you change it to killer without the underscore in both onplayerkilled and your own script, it becomes a global variable and you can use it anywhere.

having said all that, i think onplayerkilled is the very last script called before the game ends (i could be wrong there), so you'd need to write your own onplayerkilled script - or change your existing one.

there's a tutorial on how to do it here.
« Last Edit: 20 Nov 2005, 13:57:20 by bedges »

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Units killer cutscene
« Reply #4 on: 20 Nov 2005, 16:34:31 »
I thought you wanted to trigger something when some guy other than the player is killed.  

I suggest you look at putting a killed Event Handler on the guy that you want to trigger the scene:
http://www.ofpec.com/editors/resource_view.php?id=543

Then I think your code should work except:
1. You need to remove the space as pointed out by bedges

2. You would need to change
_killer =_this select 0
to
_killer =_this select 1

3. And you would need to move the camera!  Just look at the code.  You create the camera at 0,0,0 - which is the bottom left and corner of the map, well out to sea, and the then you point the camera at some unit.  All you will see is sea.  Check out camSetPos and camSetRelPos:
http://www.ofpec.com/editors/comref.php?letter=C#camSetPos
« Last Edit: 20 Nov 2005, 16:40:47 by THobson »

Comerade

  • Guest
Re:Units killer cutscene
« Reply #5 on: 21 Nov 2005, 13:00:34 »
yes i know i forgot to add  _c camsetrelpos to the forum, but thats in the script

Comerade

  • Guest
Re:Units killer cutscene
« Reply #6 on: 22 Nov 2005, 14:16:15 »
Sorry guys i confused you all. I just noticed how bad I am at explaining things :-[. Forget about the cam script in the start of this post. I'll start over.
Here's the plot:
2 players are shooting at one ai in multiplayer game. One player hits and kills the target  (lets call him guy1). Then the camera should aim at guy1. And target the player that killed him (if that's possible).
I hope this post was less confusig :-\

Comerade

  • Guest
Re:Units killer cutscene
« Reply #7 on: 22 Nov 2005, 17:32:51 »
I read the event handler tute. Thanx for help ;D