Home   Help Search Login Register  

Author Topic: custom death script  (Read 6434 times)

0 Members and 1 Guest are viewing this topic.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:custom death script
« Reply #15 on: 19 May 2005, 19:20:00 »
Quote
However, simply putting a line in there with the same name as one of the lines in the stringtable in the bin won't change anything in the game,

@voodsia

I think what he meant here was....don't use the same name, rather, choose a new one.

At least thats the way I see it.


Planck
I know a little about a lot, and a lot about a little.

voodzia

  • Guest
Re:custom death script
« Reply #16 on: 19 May 2005, 19:41:50 »
But using a different one makes no sense in my case since I want to replace string "you are dead". Default endDialog script seems to use this text which is assigned to STR_MISSION_KILLED. At least that's how I see it ;)
« Last Edit: 19 May 2005, 19:42:29 by voodzia »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:custom death script
« Reply #17 on: 19 May 2005, 23:18:21 »
Roni - if you're looking for your post I've split it out and put in a new thread, since it's really a new question.    

http://www.ofpec.com/yabbse/index.php?board=6;action=display;threadid=23762

Don't want 456820 to feel his thread has been hijacked, now do we?    ;D
Plenty of reviewed ArmA missions for you to play

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:custom death script
« Reply #18 on: 20 May 2005, 05:40:05 »
One option (which I have managed to successfully implement... so trust me it works ;) ) is to create a resource overlay and cover the 'you are dead' with whatever text you want.

Once I get the last beta version of my mission released, you'll see how it works. If you shoot your lieutenant you'll get:
"You have been Court Martialed"
instead of the 'you are dead'.

The options down the bottom (retry/load/quit/etc.) all remain the same, because my resource only covers the top of the screen...

Anyway, a bit hard to explain without being able to show you. I'll try and get the next version of my mission done... :P

voodzia

  • Guest
Re:custom death script
« Reply #19 on: 20 May 2005, 14:24:30 »
But I don't want to wait that long. And besides I'd like to do it by myself. Can someone tell me where I can find any informations about that mysterious "resource overlay"?

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #20 on: 20 May 2005, 16:48:55 »
Quote
Don't want 456820 to feel his thread has been hijacked, now do we?
Well i actually solved this a while a go and hae now made my own death cam wich is quite good i think perfectly timed wit music. i just left this thread open because of the new question.

Sui sounds good what missions this and its suprising to see that you still have time to make missions aswell as look after the whole ofpec site. but also you say it covers the 'you are dead' with what you want but wouldnt you still be able to see 'you are dead' under your new text?

Also i want to be able to add to my script so it checks if the killer is still and aiming down his sights and if yes it looks thorught his sites so you see what hes seeing and if not just carry's on with the original idea?
Anyone have nay ideas

I thik ive seen it done before but it might of just checked for something else. I think it was The black gap i think Sui made it too also is that actually completed?

Grendel

  • Guest
Re:custom death script
« Reply #21 on: 20 May 2005, 16:59:33 »
Quote
Also i want to be able to add to my script so it checks if the killer is still and aiming down his sights and if yes it looks thorught his sites so you see what hes seeing and if not just carry's on with the original idea?
Anyone have nay ideas

Assuming that you are using a "killed" eventhandler, you can use '_this select 1' to get the killer I think.

You could then use switchcamera "gunner" to look down the sights of the killer.


-Grendel

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #22 on: 20 May 2005, 17:01:19 »
thats not totally what i wanted because im not using an Event Handler im using the default _killed wich gets automatically passed to the onplayerkileed.sqs script.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:custom death script
« Reply #23 on: 20 May 2005, 17:20:43 »
Sui's deathcam script shows you the killer's view exactly as you describe.     It is used in Sui's excellent Facile ground and I also borrowed it (with his permission) for Un-Impossible.
Plenty of reviewed ArmA missions for you to play

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #24 on: 20 May 2005, 17:24:30 »
okay i just need to know how that was done i dont relly want to use his even though its great i would prefer to use my own but could anyone explain how he did it

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:custom death script
« Reply #25 on: 21 May 2005, 05:07:12 »
The onplayerkilled.sqs automatically gets passed a couple of arguements... as Grendel pointed out, (_this select 1) will give you the unit that killed the player.

So in my onplayerkilled.sqs, I used something like this:

Code: [Select]
killer = _this select 1
[player] join grpnull
0 fademusic 1
titletext ["","BLACK OUT", 3]
~4
playmusic "track10"
enableradio false
enableenddialog
titletext ["","BLACK IN", 1]
killer switchcamera "gunner"
killer addeventhandler ["Fired",{killer switchcamera "gunner"}]
#aliveloop
_now = _time
@ (_time > (_now + 10)) or (not (alive killer))
? not (alive killer): goto "kded"
killer switchcamera "external"
_now = _time
@ (_time > (_now + 5)) or (not (alive killer))
? not (alive killer): goto "kded"
? _time > 75: goto "notalive"
goto "aliveloop"
...

Basically, that detects if the killer still lives, and if so switches the camera to a view of their gunsights (killer switchcamera "gunner"). It will then wait 10 seconds, and switch camera to "external" (3rd person view). If they fire their weapon, it will switch back to gunsights, and wait 10 seconds.

There's also code in there that will trigger the rest of the death cutscene if the killer unit is killed (not much point staring at a dead guy the whole time ;) ), but I omitted where it goes for clarity.

As for replacing the 'You are dead' text, it looks something like this:

[img removed]Suicourtmartial.jpg[/img]

With resources, you can set how transparent they are so the 'You are dead' doesn't show through even though it's still beneath the 'You have been Courtmartialled'.
To find out how to work custom resources, I suggest you take a look at a dialog/resouce tutorial.

In a nutshell, what you need to do is create the picture you're going to use (I suggest create a tga and convert it to .paa). Then you'll need to make an entry for it in your description.ext.
You can then call it from a trigger (under the 'effects' section), or from a script using cutrsc or titlersc.

Anyway, have a look through some tutorials and see how you go ;)

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #26 on: 21 May 2005, 09:08:24 »
woh that looks great Sui also thanks for the bit in that script im bound to use that in some way.
Quote
you can set how transparent they are so the 'You are dead' doesn't show through even though it's still beneath
how do you set the transparency of the original text i would like to know cause i need something like this for a mission im working on so it would be very usefull if you could say how or something i just need it to say "You failed your Primary objective" because i dont want it to go to the notebook screen of end#2.

Also yet again thanks for explaining that death cam ill try it out and try and out a bit into mine and say if it works

Edit - Okay ive tried putting the event handlers into my script i think i works but im wondering what a few lined mean and why they are there.

Code: [Select]
_now = _time
@ (_time > (_now + 10)) or (not (alive killer))
? not (alive killer): goto "kded"
killer switchcamera "external"
_now = _time
@ (_time > (_now + 5)) or (not (alive killer))
? not (alive killer): goto "kded"
? _time > 75: goto "notalive"
goto "aliveloop"

i think thats the bit wich checks if its more than 10 seconds but now ive ran into a problem when i add the event handler fired it stays like that until i remove the event handler but i want a bit wic runs in the background of this script wich checks if the killer hasnt fired for around 3 seconds and then removes the event handler. I think i would have to call a new script for this within the script any help please
« Last Edit: 21 May 2005, 09:53:14 by 456820 »

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #27 on: 21 May 2005, 10:12:13 »
oky infact now it wont seem to change to the killers optics at all.
ive included my script with this post also the end lines wont work where it should target the players leader and when the killer is dead target the killers leader or former leaders.
Can someone have alook at this and say why it might not work

voodzia

  • Guest
Re:custom death script
« Reply #28 on: 21 May 2005, 11:31:56 »
I'm not sure but I think your script ain't working because you got it all wrong. I mean - look at onPlayerKilled.sqs by BIS:
Code: [Select]
&2

titleCut["", "BLACK OUT",1]
&3
_animace = ["deathDefault.sqs", "death1.sqs"]

_this exec ( _animace select ( random ( (count _animace) - 0.5 ) ) )

exit
It looks like that you can't have just one script for all your stuff - you'll  need 2 scripts - onPlayerKilled.sqs and e.g myDeath.sqs.
Then your onPlayerKilled.sqs will look something like this:
Code: [Select]
&2

titleCut["", "BLACK OUT",1]
&3

_this exec "myDeath.sqs"

exit

And that second file "myDeath.sqs" is the file where you should put all your camera commands. I hope that will help you somehow ;)

Offline 456820

  • Contributing Member
  • **
Re:custom death script
« Reply #29 on: 21 May 2005, 11:36:44 »
well thats very weird all other onplayerkilled.sqs files im looking at are done very simiallar to mine i just basically used them as templates and they all work