Cinematic System

From HEWIKI
(Redirected from Technical:Cinematic System)
Jump to: navigation, search

Cinematic System Documentation

A cinematic is defined as an event that takes control of the camera, moving it along a pre-defined path to show off an area, or specific events in an area, in the style of a movie.

Requirements to use the Cinematic System:

Starting a Cinematic

A cinematic is started by making a call to the function below when your server script determines it should be shown.

Server Script Cinematica implements the following function:

Public function ShowTime(serverControlScript as String,
                         clientControlScript as String,
                         cinematicPath as String,
                         banner as String,
                         thePlayers as list of ID)
serverControlScript is the server script that monitors the progress of each person viewing the cinematic. It is notified when each player begins and ends the cinematic.
clientControlScript is the client script that handles any client side setup needed before playing the cinematic, as well as tracking the path of the camera, allowing events and functions to be run at specific events within the cinematic.
cinematicPath is the path that the cinematic camera will follow.
banner is the name of the GUI element to create as the final graphic to be displayed at the end of the cinematic.
thePlayers is the list of accounts that will be recieving this cinematic.

Example call to cinematic system

Cinematica:ShowTime(myServerScript, myClientScript, theCinematicPath, myBanner, thePlayers)

Creating your server side cinematic control script

To create a server side script for use with a cinematic, you can either create a new script from the CinematicServerScriptTemplate (when templates are implemented) or add these shared functions to a script.

shared function PlayerOkForCinematic(playerID as ID) as Boolean
  //--------------------------------------------------------
  // Given a playerID, this function must determine if it is
  // ok for this player to see the cinematic that the script
  // will be showing. Return true if ok, false if not ok.
  //--------------------------------------------------------
  return true
.

shared function CinematicStatusForCharacter(char as NodeRef of Class character_class,
                                            status as String)
  //-------------------------------------------------------------------------
  // This functions tracks when each player starts and ends the cinematic
  // status = "SHOWSTARTED" is reported when the cinematic begins for the character
  // status = "SHOWENDED" is reported when the cinematic has completed for the character
  //-------------------------------------------------------------------------
.


Creating your client side Cinematic Control Script

To create a client side script for use with a cinematic, you can either create a new script from the CinematicClientScriptTemplate (when templates are implemented) or add these shared functions to a script.

shared function PreCinematicSetup() as Boolean
  //----------------------------------------------------------------------------------------
  // Return false if you want the cinematic to begin immediately
  // Return true if you want to delay cinematic start till some async operation is complete,
  // for instance loading of necessary resources.
  // If true, the cinematic script will have to call function StartTheShow() when it is donewaiting for stuff
  //----------------------------------------------------------------------------------------
  return false
.

shared function ShowHasStarted()
  //----------------------------------------------------------------------------
  // Called when the cinematic begins
  // Anything that must start at the same time as the beginning of the cinematic
  // would go in this function in the cinematic client script
  //----------------------------------------------------------------------------
.

shared function ShowHasEnded()
  //----------------------------------------------------------------------------
  // Called when the cinematic ends
  // Anything that must end at the same time as the end of the cinematic
  // would go in this function in the cinematic client script
  //----------------------------------------------------------------------------
.

shared function CinematicWayPoint(path as NodeRef of Class HBPath, wp as ID)
  //------------------------------------------------------------------------------
  // Called when the camera reaches a way point
  // Anything that must happen when a particular way point
  // has been reached can be added to this function in the cinematic client script
  //------------------------------------------------------------------------------
.

shared function CinematicBannerSetup(fadeInTime references Float,
                                     fadeOutTime references Float,
                                     displayTime references Float)
  //------------------------------------------------------------
  // Return true to override the default fadeInTime, fadeOutTime
  // and displayTime with values of your choice
  // 1 = 1 second
  // 0.5 = half a second etc...
  //------------------------------------------------------------
.

shared function BannerIsBeingDisplayed()
  //-------------------------------------------------------------------
  // Called when the banner begins to fade in
  // You can add other custom stuff here,
  // the banner will be named MainBanner
  //-------------------------------------------------------------------
.

shared function PlayCinematicMusic()
  //-----------------------------------------------------------
  // Called at the beginning of cinematic, you may specify a
  // musical piece here that will play for the duration of the
  // cinematic
  //-----------------------------------------------------------
.

shared function PlayEndCinematicMusic()
  //---------------------------------------------------------
  // Called at end of cinematic, you may specify a
  // musical piece here, usually some fanfare or short finale
  //---------------------------------------------------------
.

You can make a call to the music system (currently CombatMusic) to change the currently playing music to an appropriate piece for your cinematic.

Creating the End Banner

A banner is displayed when the movie reaches its final waypoint. This banner can be any GUI control, but usually is one of a few select banners built for to be displayed at the end of a quest. When you call Cinematica:ShowTime() the banner variable should be the name of the GUI prototype to build.

You can use the CinematicBannerSetup() shared function in your client control script to override the default fadein, displayTime and fadeout values.

Notes:

Letterbox mode begins immediately when the call to start the cinematic is made. All on screen gui controls are hidden at this time as well.
Letterbox mode ends when the end banner is displayed.
When the banner finishes fading out, all on screen gui controls are unhidden.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox