PDA

View Full Version : a cutscene question


Livingdeadjedi
03-09-2003, 12:50 PM
ok heres the script

//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam4", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam4", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam5", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam5", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam6", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam6", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021.mp3" );
wait ( 7000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );


but when it reaches the end point the voice doesnt work and theres no kyle

So how do i place a Kyle model that will dissapear after the script has run and that talks

thanks :D

Livingdeadjedi
03-09-2003, 01:03 PM
also for some reason
even though i got rid of the wait between each camera
it has reverted to stopping on the first one then playing game ???

before it wizzed through them all to the last one , how strange ?

HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELPPPP :confused:

AKPiggott
03-09-2003, 02:01 PM
Basically, you need to place a Kyle NPC and give it the keystring "NPC_Targetname" with "cs1_kyle1" (that's what I am using for this example). Then use this for the voice line:

affect ( "cs1_kyle1", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021.mp3" );
}

Livingdeadjedi
03-09-2003, 02:54 PM
thanks m8
what about that only going to the first camera then stopping thingy ??

all the other cameras have the right target name =[

AKPiggott
03-09-2003, 03:51 PM
Well.. why is there no wait between cameras? I belive that when no wait is present, ICARUS overrides all commands with the first one, that's what I've found in experience.

Livingdeadjedi
03-09-2003, 03:52 PM
ok heres the script as is now


//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 0.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
wait ( 0.000 );

affect ( "kylestart", /*@AFFECT_TYPE*/ FLUSH )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021.mp3" );
}

wait ( 7000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

but no sound, and no kyle in cutscene. even though i checked the cinematic box as well and it has an NPC_targetname of kylestart

dont i need to place a scriptrunner ??

Kyle_KatarnJedi
03-09-2003, 04:29 PM
A Script Runner may help, I think thats what I used in Elite Force, when I made a Cutsecne....

Livingdeadjedi
03-09-2003, 05:33 PM
yep i had a scriptrunner

oh i placed a Kyle NPC and clicked the Cinematic box

but it didnt show up at all

Livingdeadjedi
03-09-2003, 05:48 PM
remember when it comes to scripting i dont know nothing

so that last script i posted above i need to know if thats what i need to use in order for the camera to move between the two locations(which it does) then run the sound ( which it doesnt at all)

Kengo
03-09-2003, 08:54 PM
Like AK said, you need a wait between each pair of origin and angle commands, the wait also needs to be bigger than the higest time period for either of these of it to work properly (so if the ORIGIN command has a time of 5000, and the ANGLE command for the same camera has a time of 0, the the wait command after these two has to be at least 5000. If it was 8000, the camera would wait 3 seconds (3000 miliseconds) before doing the next command.

As for the NPC kyle, you want to have him activated by the same trigger at the target scriptrunner. That way he will only appear in the cutscene, not before (possibly you didnt see him before because hwas killed before you reached that part or something like that). Give him an npc_targetname and then in the script you can use the REMOVE command at the end (using the same targetname) to get rid of him.

Hmmm, not sure what the problem with the sound is....possibly that it is after an affect command for a character not in it (so if you get kyle to appear with the right targetname and all, it should work).

I recommend my tutorials (as I would :)) on basic cutscene stuff here, they don't go far but they deal with the wait stuff in some depth:

http://www.geocities.com/kengomaps/tutorials.html

lassev
03-10-2003, 01:41 AM
And you might also consider putting the sound in a task and after that DOing or DOWAITing it. Although that might not be mandatory, you'll see it may help making at least long cinematics easier to handle.

Livingdeadjedi
03-10-2003, 12:39 PM
thanks guys :D

i will try that tonight

oh and yeah Kengos tutorials rock :)

Livingdeadjedi
03-10-2003, 12:54 PM
hey kengo
i know youve mentioned this
but i think people would really like it if someone made a list out of the commands in behaved. and what they do

i mean what do FLOAT STRING AND VECTOR DO ????
or SIGNAL

is there a book that has all these in or are we all meant to be expert scripters LOL :D

Also what order should things be in

does task go before affect Ect ect

I understand the logic of it but it seems to me get 1 thing out of place JK2 laughs at you :mad: :p

Livingdeadjedi
03-10-2003, 01:41 PM
ok then lets try to figure this out :D

Heres the script now

//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 5000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
wait ( 5000.000 );

affect ( "kylestart", /*@AFFECT_TYPE*/ FLUSH )
{

task ( "kylestart" )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sounds/chars/kyle/03kyk021.mp3" );
do ( "kylestart" );
wait ( 7000.000 );
remove ( "kylestart" );
}

}

camera ( /*@CAMERA_COMMANDS*/ DISABLE );

The cameras work perfect but still no kyle NPC
I have targeted the NPC_kyle with a trigger that also points to the scriptrunner
the NPC has an NPC_targetname of kylestart
so what do i need to add and get rid of
One i see what ive done wrong it should be easy
Either that or i need an idiots guide ROFL :p

Leslie Judge
03-10-2003, 03:36 PM
:) Don't put the do, wait and remove into the task. The task is only to play the sound. Do is which executes the task, so can't be the part of it.

Do it like this:

affect ( "kylestart", /*@AFFECT_TYPE*/ FLUSH )
{

task ( "kylestart" )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sounds/chars/kyle/03kyk021.mp3" );
}
do ( "kylestart" );
wait ( 7000.000 );
remove ( "kylestart" );

}


Maybe the remove command has to be outside of the affect.

And there is the "ICARUS Manual.doc" which comes with the editing tools. The commands are explained in it.

Livingdeadjedi
03-10-2003, 04:25 PM
thank you Leslie =] oh clever one :D

ill try that right now

Livingdeadjedi
03-15-2003, 03:54 PM
ok after some help from me pal Mike Gullemelt

I have worked out this script
i took out the anim commands for now

//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 3000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 12000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 120000 );
wait ( 12000.000 );

task ( "kyletalks" )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021.mp3" );
}

dowait ( "kyletalks" );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );
remove ( "cin_kyle" );


i have managed to make kyle speak, and appear and the camera move in my test map.....
BUT on doing the exact same thing on the start of my real map.. this happens...

1. The camera moves from cam 1 to cam 2 at warp speed ????
2 Kyle again is invisible


another thing i never could get to work is klye moving his mouth even when he was visible. i tried a generic mouth anim but that didnt work. Oh why is it so hard ? why is BEhaved not logical, goto be some clever person out there :confused: if not ill get me Bro at Sun Microsytems to help me :p

Kengo
03-15-2003, 05:33 PM
The camera moves as fast as it hs to to get to it's ending poisition in the time you give. So the speed should be totally dictated by the distance and the time. So ya could try upping the time from 12 seconds.

As long as you've got an NPC_Kyle spawned by the trigger you are using for the cutscene, there should be a Kyle in the cutscene :confused:

I've been experimenting with the animation stuff....by which I mean I was about a month ago before I started on the actual map, and I can hardly remember any of it :D
I think this worked:

Near the start of the script:

affect ( "introkyle", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" );
set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_TALKGESTURE11START" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", 500000 );
}

Then whenever you want 'introkyle' to say something:

affect ( "introkyle", /*@AFFECT_TYPE*/ INSERT )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021" );
}

wait ( 7000.000 );

Talkgesture 11 has Kyle with his arms folded across his chest, and whenever a sound file is activated in the script in the way I've done above, Kyle's mouth animation stats automatically. You could I think use any of the other talkgestures here. Also, instead of that massive time for the anim_holdtime you could just have -1 ie forever.

I also wish BehavEd was more logical, and generally easier to use, but trial and error mostly works, eventually :)

Kengo
03-15-2003, 05:42 PM
Originally posted by Livingdeadjedi
hey kengo
i know youve mentioned this
but i think people would really like it if someone made a list out of the commands in behaved. and what they do

i mean what do FLOAT STRING AND VECTOR DO ????
or SIGNAL

is there a book that has all these in or are we all meant to be expert scripters LOL :D

Also what order should things be in

does task go before affect Ect ect


I have no idea what float string and vector do, I hear rumours of the end of the Universe, but I dunno :D

Like Leslie says, the ICARUS manual helps, although it's a bit...unhelpful at times! Also there are example scrips somewhere I think, either with the game or more probabaly one of the editing tools downloads.

Some more stuff on the kinda order and patterns you have to use in scripts would be a good idea, I will do some more tutorials when next map is finished.

Livingdeadjedi
03-15-2003, 07:21 PM
Ta kengo
yeah its odd that Kyle NPC shows up in my small test map but not in my larger map ???

anyway heres some hints from Mr Mike Gullemelt =]]

1) If you place an NPC_Kyle in the map, you need to give him an "NPC_targetname" if you want to be able to affect him later. Let's call him "cin_kyle" for now. One thing to keep in mind that when you place an NPC in a map, you're really placing an NPC spawner, not an NPC itself. If that NPC spawner has a targetname (*not* NPC_targetname), the spawner will not spawn the NPC until used. When the NPC is spawned, that NPC's targetname (for "use" commands, etc.) and script_targetname (only for "affect" commands) will be whatever its spawner's NPC_targetname is.
2) Note that, if you use an NPC spawner in a script, you cannot also affect the NPC it spawns in the same script. This may seem odd, but this happens because the script is pre-parsed when it's run and it looks at every affect in the script and tries to find the NPC it's going to eventually affect. So the upshot of this is that you can only affect NPCs that are spawned *before* the script is run.
3) An affect does not alter the course or affect the flow of the script that calls that affect. All an affect does is shove some commands onto whoever you're affecting and forget about them. So your camera disable command will execute as soon as you affect kyle, not after he says his line or anything. If you want to wait until after Kyle says his line, put the camera disable command in his affect, after the sound completes (alternately, you could put a signal in his script after he finishes his line, then put a waitsignal in the main script after the affect but before the camera disable command).
4) The way you're waiting for the sound to complete may work, but it won't finish as soon as the line is done. Use a "dowait" instead of a "do". That will make him wait only as long as the line is.
5) Don't name the task and the NPC the same thing. It probably won't cause any bugs, but it's just not a good idea as it can make reading your script kind of confusing.
6) You can make the remove command remove "self" instead of having to type the name of the NPC.
7) One last thing. I don't know what entity is running this script, I imagine it's a target_scriptrunner? One other way you could do this script (and simplify it a bit), would be to set this as the NPC_Kyle's spawnscript. That way, all you have to do is use his spawner at the right time, he'll spawn, do the camera stuff, say his line, disable the camera, then remove himself. If you do this, be sure to put his remove command *after* the camera disable. An entity can't run any more commands after they've been removed. Also, you'd want to take out the affect if you do it this way. This is because Kyle's *already* the one running the script, so you don't have to affect him to get him to execute those commands. In fact, affecting yourself in a script can possibly break the script. The other good side effect of this is that the flow will work like you originally intended - he'll do the camera stuff, wait, say his line, wait, *then* disable the camera and remove himself.

Kengo
03-15-2003, 07:38 PM
Wow, handy stuff indeed, thanks for passing that info around :D Knowing the conventions within BehavEd is the thing I, and I would guess many others, find hardest about using it, and this lists a bunch of them :)

lassev
03-16-2003, 08:00 AM
Note that, if you use an NPC spawner in a script, you cannot also affect the NPC it spawns in the same script.

I truly noticed this the hard way. Man, I fought this for days. The obvious solution, no matter how many NPCs you have to spawn (trust me, I spawned a lot in a serial manner), is to use the spawner in the end of the previous script and continue the cinematic fluently (with camera commands and everything) in the spawnscript of the just spawned dude. I chained one cinematic of mine this way. And you can run the whole cinematic through somebody's spawnscript, with affecting other NPCs.

The way you're waiting for the sound to complete may work, but it won't finish as soon as the line is done. Use a "dowait" instead of a "do". That will make him wait only as long as the line is

DOWAIT is by far the most convenient way as long as you don't get ambitious. However, soon enough you'll find it's restricting your aims, and you'll use the plain DO and it's counterpart the plain WAIT more and more, just because it gives you the possibility to do other things in the same time, like waving hands during talking, or start walking. However, you'll find Affect(INSERT) most convinient in the same time...

Livingdeadjedi
03-18-2003, 03:21 PM
Ok heres some more info i got from freindly Mr Mike =]]


wait ( 20000.000 );

*********************
Affecting Kyle here is correct, assuming cin_kyle is the right name. If you want to turn off his saber, use SET_SABERACTIVE and set it to false.
*********************

affect ( "cin_kyle", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_SABER" );
set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_TALKGESTURE21" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", 3000 );
}

*********************
What you're doing here is playing the voice file on the scriptrunner, not on Kyle. It may properly wait until the sound is done, but the Kyle NPC has no idea this sound is playing and thus won't lip-sync to it. Take all of these remaining commands and put them into the affect above.
*********************
task ( "kyletalks" )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021" );
}

dowait ( "kyletalks" );
wait ( 7000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

*********************
This remove is going to look for an NPC named "kyleself". If you're trying to remove yourself (whoever is running the script), just use:
remove ( "self" );
Otherwise, if you're trying to remove someone else (like, say, "cin_kyle"), do this:
remove ( "cin_kyle" );
If you move this into the affect above (which you'll need to do if you move those other commands inside the affect), use the remove ( "self" ) version...
*********************

remove ( "kyleself" );


Michael Chang Gummelt

I already had remove SELF but i was experimenting and need to know if it would work

:D
hope ya find this usefull. My intention is to create cutscenes like AK Piggot :eek:

Livingdeadjedi
03-18-2003, 03:24 PM
oops missed a bit :p

heres the full quote

Okay, you say this script is being run by a scriptrunner. Let's look at it (my comments are marked by ***'s):

//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_SABER" );
set ( /*@SET_TYPES*/ "SET_MUSIC_STATE", /*@MUSIC_STATES*/ "DM_ACTION" );

************************
This won't work. You can only wait for CHAN_VOICE sounds to complete, no other channels work. Also, music is stereo and should be played through the music system ( use a target_play_music or whatever they're called).
************************

task ( "musicstart" )
{
sound ( /*@CHANNELS*/ CHAN_AUTO, "music/bespin_streets/bespina_etr00.mp3" );
}

dowait ( "musicstart" );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 2000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 20000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 20000 );
wait ( 20000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 20000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 20000 );
wait ( 20000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam4", ORIGIN)$, 20000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam4", ANGLES)$, < 0.000 0.000 0.000 >, 20000 );
wait ( 20000.000 );

*********************
Affecting Kyle here is correct, assuming cin_kyle is the right name. If you want to turn off his saber, use SET_SABERACTIVE and set it to false.
*********************

affect ( "cin_kyle", /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_SABER" );
set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_TALKGESTURE21" );
set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", 3000 );
}

*********************
What you're doing here is playing the voice file on the scriptrunner, not on Kyle. It may properly wait until the sound is done, but the Kyle NPC has no idea this sound is playing and thus won't lip-sync to it. Take all of these remaining commands and put them into the affect above.
*********************
task ( "kyletalks" )
{
sound ( /*@CHANNELS*/ CHAN_VOICE, "sound/chars/kyle/03kyk021" );
}

dowait ( "kyletalks" );
wait ( 7000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

*********************
This remove is going to look for an NPC named "kyleself". If you're trying to remove yourself (whoever is running the script), just use:
remove ( "self" );
Otherwise, if you're trying to remove someone else (like, say, "cin_kyle"), do this:
remove ( "cin_kyle" );
If you move this into the affect above (which you'll need to do if you move those other commands inside the affect), use the remove ( "self" ) version...
*********************

remove ( "kyleself" );