I'll assume you have some very basic TorqueScript knowledge and know how to do it in the console.
Creating a cutscene:
If you enter director mode, you'll create a cutscene object. (set to client.director_scene)
Otherwise, the relevant function is Cutscene_New(%sceneLabel, %viewer), which returns the cutscene's object.
The scene label is the name of the cutscene you're working with. There should only be one cutscene under one label at any time.
Supplying Cutscene_New with a GameConnection object as its second parameter will add that client as a viewer.
example of using Cutscene_New, remember that you can also do the same thing using the /directorMode command as stated in my previous post:
$h = Cutscene_New("glory of nelly: the music video", localClientConnection);
Adding events:
The only way to add or modify events currently is through TorqueScript, but it's relatively simple.
To add an event, simply use Cutscene::NewEvent(%this, %sid, %type), which returns the event object created (or zero).
%sid is a special identifier for that particular event. If not supplied, it will give it a numerical ID. This is useful, for example, if you have an event that creates an object (e.g. an Actor event) and want to access that object in a later event. You would set the object of the later event to look at a spawned object of the event with the specified SID.
%type is the bit that tells the code how to handle this event. It must be set to an existing event type, such as Camera, PathCamera, etc.
Continuing the example from the previous section, you would do this to add a Camera event:
$event = $h.NewEvent("walrus", "Camera");
Modifying an event:
Again, the only way to do this currently is through some simple TorqueScript.
The relevant function for most events will be CutsceneEvent::setParameter(%this, %name, %value), returns true.
Some events may have specific methods to call instead if they require more complex data, such as PathCamera events to add nodes.
By setting a parameter on an event, you're supplying it with the information it needs to run. This will vary between types, so I'll specify later on, but for now, this is an example of usage:
$event.setParameter("Transform", "0 0 25 0 0 0 0");
Other information on events:
I believe it's necessary to mark the event as ready before the cutscene recognises it and executes it.
To do this, simply do $event.setEventReady(true or false);
To change the timing of an event, use CutsceneEvent::setTimed(%this, %type, %time, %val), returns true or false.
The two types of timing are Relative and Definite. For most purposes, you'll probably use Definite.
Relative timing means that the event will always execute a defined amount of time after another defined event.
Definite timing means that you are specifying exactly when the event is going to execute in the timeline.
The time is given in milliseconds.
Value is used to specify an event for the Relative timing type. This can be an event object or an SID.
$event.setTimed("Definite", 2000); //Event executes after two seconds.
$event.setTimed("Relative", 5000, "walrus"); //Event executes five seconds after the "walrus" event.
To remove timing from an event, use $event.UnTime();
TO END A CUTSCENE, ADD AN EVENT OF THE END TYPE AND SET ITS TIME TO WHEN YOU WANT THE CUTSCENE TO BE OVER
Type-Specific Parameters:
Camera Type:
Mode : Camera control mode. Correct values are "Orbit", "Return", and "Simple".
Orbit mode will orbit a specified point or object.
Return mode will return control of viewers to the specified object, or themselves. Control to a specified object only works with one viewer.
Simple mode will set the camera to a fixed position and angle.
Target : The value that will tell the camera who, what, or where to be. This will vary depending on the type of target.
TargetType : Specifies the type of the target we're using.
In orbit mode, relevant types are "Point", "Object", and "SID".
Point type requires a Vector3f value for the position to be orbited and a positive float Dist parameter.
Object type requires a valid object, a Transform Mat, a positive float MinDist, a positive float MaxDist, and a positive float Dist parameter.
SID Type requires the same as object, but instead, the target is the SID of an event that spawns stuff. SID also needs an Identifier for the object.
In return mode, relevant types are "Player", "Object", and "SID".
Player type only requires that there be viewers in the cutscene.
Object type requires a valid object and that there be only one viewer in the cutscene.
SID type requires the SID of an event that spawns stuff and that there only be one viewer in the cutscene. SID also needs an Identifier for the object.
In simple mode, target type is irrelevant. The target is simply a Transform value.
Script Type:
File : File to be executed.
End Type:
No parameters.
PathCamera Type:
The PathCamera type has no parameters, but you need to use a few functions to set it up.
$event.PCAddNode(node position, node transform, node type, node path type) adds a node to the PathCamera, returns the new number of nodes
Node position is the time into the cutscene that the node should be reached.
Node transform is the Transform value where you want the camera to be at that node.
Node type can be "Normal", "Position Only", or "Kink". Defaults to "Normal". This has to do with PathCamera functionality, and I don't remember the specifics.
Node path type can be "Linear" or "Spline". Defaults to "Linear". Another thing with PathCamera functionality that idk man :(
$event.PCRemoveNode(index) removes the node at the given index