Jump to content

Script breaks all of the sudden


Go to solution Solved by Lazarus,

Recommended Posts

Posted
//Generated by BehavEd

rem ( "Cinematic 001 - SP1 Cove" );
rem ( "- 1 ship lands" );
rem ( "-2 Fornan walks, talking to himself" );
rem ( "---" );

affect ( "fake_player_cin1", /*@AFFECT_TYPE*/ FLUSH )
{
	set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "true" );
}


affect ( "xwing", /*@AFFECT_TYPE*/ FLUSH )
{
	move ( $tag( "xwing_begin", ORIGIN)$, < 0.000 0.000 0.000 >, 100.000 );
	wait ( 250.000 );
	move ( $tag( "xwing_end", ORIGIN)$, < 0.000 0.000 0.000 >, 5000.000 );
	rotate ( < 0.000 340.000 0.000 >, 5000.000 );
}

rem ( "---" );
rem ( "Set up camera move down with the ship" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam01", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam01", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 40.000, 0 );
use ( "cin001_speaker01" );
wait ( 1000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam02", ORIGIN)$, 3000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam02", ANGLES)$, < 0.000 0.000 0.000 >, 3000 );
wait ( 4000.000 );
use ( "cin001_speaker01" );
sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/sp/sp1_cove/vehicles/xwing/land.wav" );
camera ( /*@CAMERA_COMMANDS*/ FADE, < 0.000 0.000 0.000 >, 0.000, < 0.000 0.000 0.000 >, 1.000, 1000 );
wait ( 1000.000 );

affect ( "fake_player_cin1", /*@AFFECT_TYPE*/ FLUSH )
{
	set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "false" );
	set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" );
	set ( /*@SET_TYPES*/ "SET_NAVGOAL", "cin001_end" );
	wait ( 8000.000 );
	remove ( "fake_player_cin1" );
}

camera ( /*@CAMERA_COMMANDS*/ FADE, < 0.000 0.000 0.000 >, 1.000, < 0.000 0.000 0.000 >, 0.000, 1000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam03", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam03", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 1000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam04", ORIGIN)$, 4000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam04", ANGLES)$, < 0.000 0.000 0.000 >, 4000 );
wait ( 5000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

So whenever the ship lands

in this part

use ( "cin001_speaker01" );
sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/sp/sp1_cove/vehicles/xwing/land.wav" );
camera ( /*@CAMERA_COMMANDS*/ FADE, < 0.000 0.000 0.000 >, 0.000, < 0.000 0.000 0.000 >, 1.000, 1000 );
wait ( 1000.000 );

It shuts down the camera (cam disable), and i cant seem to figure out why? I see all actions happening with the fake player, but the camera's suddenly dont work anymore.

https://youtu.be/H6g2j0uroyI

Posted

Scripts do work the way, as you wrote one here, but for certain reasons – they treat some things differently than we expect. I had a similar issue at one point, and my guess is that you have to rewrite your script as a "hierarchy".

I usually start with cameras in a cinematic script, thus "Camera Enable" and its other commands go first, then the actions of the X-Wing. However the Wait 1000 command after Cam01 and X-wing should be inside placed X-Wing lines, and all what comes next – including Cam02, Fade, as well as Fake Player (and his commands) are best placed inside X-wing perhaps as well. I'm not sure if it works fine, but you might give it a try. 

I would recommend making your Fake Player invisible via a separate script (via spawnscript command in the N options of your NPC). There is already such a script provided by the developers, I think, and it's scripts/common/invisiblenonsolid.ibi. I actually made such a script of my own for the very same reason.

You could also experiment with the last Wait 5000 command, by adding more time and see if anything changes here.

  • Solution
Posted

~~Its being trigger at start, so when player spawns it should run this script, which works fine. It's just that i have the feeling it cant switch to cam03, thus borking out, yet the ref tag is there. 

The weird thing is, is that this did work a couple of days ago... i am starting to wonder if i corrupted an entity or something. (okay i replaced some ref tags, but that didnt seem to work, also renamed them all to make sure i was working with right ones and didnt label them wrong, by adding the sc1 for scene 1 in front of it - image was taken before the rename, also modified this in the script)

image.png.d8632daf1381f02331f5ed40e30a83a8.png

rewrote part of the script to see if that worked. No effect

//Generated by BehavEd

rem ( "Cinematic 001 - SP1 Cove" );
rem ( "- 1 ship lands" );
rem ( "-2 Fornan walks, talking to himself" );
rem ( "---" );

affect ( "fake_player_cin1", /*@AFFECT_TYPE*/ FLUSH )
{
	set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "true" );
	wait ( 6000.000 );
	set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "false" );
	set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" );
	set ( /*@SET_TYPES*/ "SET_NAVGOAL", "cin001_end" );
	wait ( 8000.000 );
	remove ( "fake_player_cin1" );
}


affect ( "xwing", /*@AFFECT_TYPE*/ FLUSH )
{
	use ( "cin001_speaker01" );
	move ( $tag( "xwing_begin", ORIGIN)$, < 0.000 0.000 0.000 >, 100.000 );
	wait ( 250.000 );
	move ( $tag( "xwing_end", ORIGIN)$, < 0.000 0.000 0.000 >, 5000.000 );
	rotate ( < 0.000 340.000 0.000 >, 5000.000 );
	wait ( 5000.000 );
	use ( "cin001_speaker01" );
	sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/sp/sp1_cove/vehicles/xwing/land.wav" );
}

rem ( "---" );
rem ( "Set up camera move down with the ship" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "sc1_cam01", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "sc1_cam01", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 40.000, 0 );
wait ( 1000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "sc1_cam02", ORIGIN)$, 3000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "sc1_cam02", ANGLES)$, < 0.000 0.000 0.000 >, 3000 );
wait ( 5000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "sc1_cam03", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "sc1_cam03", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
wait ( 1000.000 );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "sc1_cam04", ORIGIN)$, 4000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "sc1_cam04", ANGLES)$, < 0.000 0.000 0.000 >, 4000 );
wait ( 5000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

 

edit - I figured it out. It was a borked entity. . I run 2 script at launch, so i have 2 target_scriptrunners. One where I set up the skills, and one that runs the cutscene. I used the spawnscript one to duplicate for a new script runner. Appearantly something went wrong there and it got the name of the new script that indeed stops the camera after 5 seconds. Renamed the script again, and it worked as it should be.

Learn from me, always use new entities 😛 NetRadiant and copying entities appearantly need some carefull examination.

Posted

Hmm, at this point I'd suggest to add in PRINT commands and see where (and when) exactly the script breaks, checking in the console with developer 1 and g_ICARUSdebug 1, though I'm not sure how helpful it would be. I have the feeling that at least for the earlier version of the script it's just a matter of WAIT commands.

Posted
36 minutes ago, Ramikad said:

Hmm, at this point I'd suggest to add in PRINT commands and see where (and when) exactly the script breaks, checking in the console with developer 1 and g_ICARUSdebug 1, though I'm not sure how helpful it would be. I have the feeling that at least for the earlier version of the script it's just a matter of WAIT commands.

It was another script that interfeared.. see post above. i just updated it.

NumberWan likes this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...