OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Plane on 24 Jul 2004, 09:29:53

Title: switch off dead camera
Post by: Plane on 24 Jul 2004, 09:29:53
Is there a way to stop camera from switching to the enemy who kill you when you are dead? ???

Just like the Red Hammer compaign :joystick:
Title: Re:switch off dead camera
Post by: ponq on 24 Jul 2004, 11:39:59
Yes.
You could either check with an eventhandler "Killed" or with a "not alive p1" check.

Then execute your own death cam, or what you wanna do.
Title: Re:switch off dead camera
Post by: macguba on 24 Jul 2004, 12:14:32
Yes.

When you are killed a script called onPlayerKilled.sqs executes automatically.    If you place a script of this name in your mission folder the game will execute your one rather than the default one.  

It is advisable to use the default one (I can't remember where it is but its fairly easy to find ... I think its in a .pbo called scripts.pbo somewhere) as a template for your own one because there are certain things (like variables being set) that must happen during the script for the game to work properly.
Title: Re:switch off dead camera
Post by: Artak on 24 Jul 2004, 15:28:08
/me dashes in

Would be a great idea for somebody to put all of these build in and automaticly executed scripts in a reference.
There was a thread about something where an exit.sqs (or something like that) came up and I realised I had never heard of it.

So, the bananas are on me for who ever makes a reference of all these automated scripts in OFP.  ;D
Title: Re:switch off dead camera
Post by: macguba on 24 Jul 2004, 15:30:52
Yes Artak, we all know about your banana fetish.   ::)

There is a list of them in the comref as I recall.

Edit:  voila!


Event based scripts

Description:
There are some scripts in the game which are launched when some event occured.

Some of them have names given by mission designer (scripted waypoint, particle scripts (since 1.50), user action scripts).

Names of others are given by the program.

init.sqs - launched when mission is started (before briefing screen)
- no arguments

initIntro.sqs - launched when intro is started (since 1.50)
- no arguments

exit.sqs - launched when mission is finished (before debriefing screen, since 1.50)
- argument: end # - number of game end

onFlare.sqs - launched when illuminating shell is lit(since 1.45)
- arguments: [[r, g, b], gunner] - r, g, b is light color

comment »

General Barron  September 27, 2003, 23:21  
There is also:

onplayerkilled.sqs - launched when the player is killed. This script replaces the default death sequence. Make sure you place the command "enableEndDialog" somewhere in your script, as this will then cause the dialog that allows you to load, retry, or quit to appear.
-arguments: [who died, who killed them] - second argument can be null in some cases (death from falling or camcreated artillery, for example).
 
 
Title: Re:switch off dead camera
Post by: Artak on 24 Jul 2004, 15:42:35
Great stuff. Thanks Mac!  :D

/me stuffs a banana in macguba's pants and mails one to General Barron
Title: Re:switch off dead camera
Post by: Zombie on 25 Jul 2004, 12:36:40
don't forget camera.sqs as an embedded script, wonderfully useful for making cutscenes