Author Topic: "Cut Scene Helper" events  (Read 1148 times)

It doesn't matter to me whether someone makes this or finds an add-on/group of add-ons that accomplishes this purpose.

I want:
  • An event that will show players a view from a set brick (Are complex view angles other than north, south, east, and west possible?)
  • The ability to jump from one view to another (and if possible, an option/checkbox that would enable/disable smooth transitions from one view to the next)
  • Players must not be able to manually exit the cut scene manually
  • There should be an event that ends the cut scene, so that after showing the player the scene for the exact length desired, it can cut back to gameplay

I know that event_camera_control does most of these, but blockland isn't installed on this computer so I can't remember how.

There's pathcams, but it's super buggy and glitchy.

I believe Otto was working on these sorts of thins. I have no idea what happened to them because as he was working on them was when I got banned and decided it was break time.


maybe this could help?
http://forum.blockland.us/index.php?topic=236669.0
This is a camera that follows the player. I want the game to take control away from the player to show them something.
I know that event_camera_control does most of these, but blockland isn't installed on this computer so I can't remember how.
Checking it out.
I believe Otto was working on these sorts of thins. I have no idea what happened to them because as he was working on them was when I got banned and decided it was break time.
He released a developer/beta version of it, and I PMed him to ask how it works and what it can currently do.

Slayer does this if you want something to play at the beginning of a round.

There's pathcams, but it's super buggy and glitchy.
They work fantastic, really. Just gotta figure out the quirks.

edit:
By the way, this is my reply to his PM for anyone else interested:
Hey. I still intend to get Cutscene Control to a more complete state at some point, but I'll tell you what's possible in a cutscene currently:

Creating a path camera event (camera view that moves on a defined path)
Creating a camera event to orbit a defined object (as in a minigame spectator mode)
Creating a camera event to orbit a defined point
Creating a camera event that simply sets the viewers' camera to a certain transform
Creating an event that executes a TorqueScript file

Director mode is not complete, but you can enter it by doing /directorMode [sceneLabel].

In director mode, there are some control commands:
/directorExit - exits director mode
/directorSetLabel [sceneLabel] - rename the current scene

You control the timeline by using the brick controls. Supershift will have some different effects.

shift left/right - moderate scrub
shift forward/back - quickly scroll between visible portions of the cutscene
shift up/down - fine scrub
supershift left/right - faster scroll between visible portions
supershift forward/back - fast scrub
supershift down - reset scrub to 0
supershift up - reset zoom to 1x
rotation - zoom in/out

Those controls may not be exactly right, but you should be able to figure out from there.

If what's here is enough, I can fill you in on the details of getting the cutscene working.
« Last Edit: August 12, 2014, 04:34:58 PM by otto-san »

They work fantastic, really. Just gotta figure out the quirks.

edit:
By the way, this is my reply to his PM for anyone else interested:
Would you mind fleshing out how to create the cutscene and get it working here on the topic?

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