cutscenes examined...

Forum Archive - from http://theuniversal.net
Locked
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

cutscenes examined...

Post by morbydvisns »

So, weve been given a new toy with standard issue documentation (so far) ;).
Here is what has been discovered so far, disecting the example:

Code: Select all


section(1)
{
   playerpos = Vector();
   playerpos.SetToLocalPlayerPosition();
playerpos is just a variable named. Used for refrence later in the script. Anything will do here. if you want to set a target coord for camera to be placed or view target do variable = Vector(x,y,z) (specic world coords, touched on below:)

if your planet is in a scale of 258, then 256,256,1 will get you pretty much the top left corner of the map (NE), and 1,1,1 will get you pretty much the bottom right corner (SW). Landscape scale plays a factor on this. I started with a 200 scale and was expecting they were tile by tile coords, but this is not the case. You will have to figure some fancy mathmatical formula by your landscape scale to figure where to point the camera position (for now, anyway?)

playerpos.SetToLocalPlayerPosition() makes playerpos variable the coords to the players position (that the script is running for)

Ive not located a function to call a specific building #'s coords. If its not in the functions, it should be.

Code: Select all

   modelpos = playerpos;
   modelpos.Add( (1,0,0) );
This sets the variable on where to place the model (the house, as defined later int he script. again.. this variable (modelpos) can be anything you want it to be.

Code: Select all

   campos = playerpos
   campos.Add( (0,2,1) );
This is the variable that tells where the camera will be at (or start at, per this script, using the blend mode defined later)

moving it north 2 and up 1 in the air. (again, how far is dependant on your landscape scale settings)

Code: Select all

   camposEnd = campos;
   camposEnd.Add( (1,1.5,0.9) );
Defines the variable to tell where the camera will end at, used in the blend later.

Code: Select all

   AmbientLight( #808088 );
   DirectionalLight( (0.2,0.4,-0.7), (0.8,0.75,0.6) );
light stuff.. spent all the night figuring out the placement scale, will fiddle with these later

Code: Select all

   Model( "Data/Models/Bldgs/StdHouse02.atm", "Data/Models/Bldgs/StdHouse02.bmp", modelpos, (0.0,0.0,0.8) );
apparently Model tells it to put the atm and bmp at the modelpos variable coords, defined above. havnt messed with this yet, not quite sure what the last coords are for.. possibly 'last minute' adjustments on the model placement?

Code: Select all

   cam = Camera( campos, modelpos );
tells the script to put a camera out.. what that syntax defines is:

cam = Camera( *camera placement point*,*where the camera is looking at*);

Code: Select all

   cam.BlendTo( 10.0, camposEnd, playerpos);
this is for animated camera movement... the 10.0 is seconds for the animation to last... it will start at the cam= point, and, the camera will move to the coords set in the camposEnd variable, also the view target will move from the modelpos to the playerpos variable coords.

Code: Select all

   caption = Caption( 0.5, 0.65, "This is an example of a cutscene", 1 );   
   caption.FadeIn( 1, 2 );
   caption.FadeOut( 5, 6 );
}
caption= (Caption part i havnt messed with short of changing the text

fade in it will start fading in at 1 second until the 2 second mark, then it will be full opacity, then it will fade out from second 5 to second 6 then disappear.
=-=-=-=-=-=-=-

hope this helps make sense enough to do play around with until further details are released and more clarification offered. If anything else is discovered, plz add to this post.
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

ive got a couple implimented in Ariya.. a short little intro one and one on a trigger. They work pretty smooth, going to be a fun toy =)
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

Sections are the only way ive found to have sequential blends and cameras.. unless i just dont know the right way the code wants it done otherwise.

Code: Select all

Section(1)
{

}
Section(2)
{

}
variables defined in a script carry thru to the rest of the script, so you dont have to set all the variables in each section.
For example, if you set a variable in section one for a vector coord, you can call it again in section 2.. but not the other way around.

would be nice if esc would stop playback. If you play another scene during play, it will stop the current and play the new one. I made a quic little half second one that zooms back to the player if they type &stop.
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

this is definitely the best way of writing docs :)

Re: Model function:
not quite sure what the last coords are for.. possibly 'last minute' adjustments on the model placement?

Last vector parameter is the rotation of the model about each axis. (Z is the vertical axis, so in the sample its just rotating the building so the front of it faces the camera).

Sections are the primary way of forming sequential sets of things, though its also the intention to expand some functions so they are not so necessary.
would be nice if esc would stop playback.
Aye, on the list. Having a function 'SetSkippable(true or false)' would be the thing i think, as sometimes you might specifically want a cutscene users can't escape out of.
Glad its workin for you so far. Plenty more to come on that (The framework is all in place to allow more stuff to be added easily).
Ive not located a function to call a specific building #'s coords. If its not in the functions, it should be.
Aye, indeed.. it should be :)
Last edited by Mit on Sun Feb 22, 2009 10:57 pm, edited 1 time in total.
User avatar
zaroba
World Owner
World Owner
Posts: 7257
Joined: Fri Oct 10, 2003 11:06 pm
Location: Hereford, PA
Contact:

Post by zaroba »

earlier, i saw somebody on ariya (don't remember who) say something along the lines of "it would be nice if models etc finished downloading before the cutscene started"

i'm guessing that if somebody joins a world for the first time and a cutscene is activated, it will play threw despite the player possibly not having the models and textures available on there client yet.
User avatar
flametard
Posts: 1245
Joined: Sun Apr 01, 2007 2:05 am
Location: Join NR! faction name: 'NR new recruits' password: 'Truth'
Contact:

Post by flametard »

i didnt see the cutscene on ariya either. perhaps stick a sleep code in front to delay the cutscene till the buildings load?
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

yea imma put the thing on the lil druid guy as his first trigger event for new ppl. that should fix alot of that.
dazjorz
Posts: 105
Joined: Sun Jan 25, 2004 4:38 pm
Location: Netherlands
Contact:

Post by dazjorz »

zaroba wrote:earlier, i saw somebody on ariya (don't remember who) say something along the lines of "it would be nice if models etc finished downloading before the cutscene started"
That was me :P
User avatar
morbydvisns
Posts: 1889
Joined: Sun Jan 30, 2005 12:51 am

Post by morbydvisns »

i just noticed that *buildetails gives world coords for the building at the end.
a *showpos or something like that would help too (returns coords you are standing at (or *showpos %player%)
markxxx420
Posts: 67
Joined: Tue Jul 11, 2006 1:49 am

Post by markxxx420 »

can you use a non integer for the vector coordinates? Like, (4.5,6,5).
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

yup
Locked