Problems with scripting. -1 reply

Please wait...

Double W Jedi

The Internet ends at GF

50 XP

23rd March 2008

0 Uploads

117 Posts

0 Threads

#1 10 years ago

In my mod that I am working on, I was able to create an intro scene with npcs, and they did everything I told them to do. Now when I used NPC_target on the npc that I am going to kill, and spawn two more npcs and play the next cutscene the npcs stand there and don't do anything. So I deleated the NPC_target, and told the intro script to make the npcs invisble, and when it plays the next cutscene, i told not make them visisble, but when the cutscene the npcs are still invisible, and the camera's won't change until an npc completes it task. What do i need to do to fix this problem.




Yzmo

Modding a game > Playing it...

50 XP

19th May 2006

0 Uploads

168 Posts

0 Threads

#2 10 years ago

First you need to post the script for us to look at :)




Double W Jedi

The Internet ends at GF

50 XP

23rd March 2008

0 Uploads

117 Posts

0 Threads

#3 10 years ago

Here's the intro.

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 ); affect ( "player", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); } affect ( "emporer", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" ); set ( /*@SET_TYPES*/ "SET_INVINCIBLE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_SOLID", /*@BOOL_TYPES*/ "false" ); set ( /*@SET_TYPES*/ "SET_NO_FORCE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_PLAYER_TEAM", /*@TEAM_NAMES*/ "TEAM_NEUTRAL" ); set ( /*@SET_TYPES*/ "SET_ENEMY_TEAM", /*@TEAM_NAMES*/ "TEAM_NEUTRAL" ); set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_SIT1" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 6000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "luke_cin", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_NONE" ); set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "emporer" ); affect ( "emporer", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 4000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "luke_cin", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 4000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "emporer", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 2000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "luke_cin", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "emporer", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "luke_cin", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 9000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam4", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam4", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 4000.000 ); set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_FORCEPULL" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 1000.000 ); set ( /*@SET_TYPES*/ "SET_WEAPON", /*@WEAPON_NAMES*/ "WP_SABER" ); set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); affect ( "vader_cin", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam5", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam5", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 1000.000 ); set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); remove ( "luke_cin" ); remove ( "vader_cin" ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); } } } } } } } } } affect ( "vader_cin", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_STAND1" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); } affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "true" ); } affect ( "luke_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "true" ); }

And heres the second cutscene.

remove ( "vader" ); camera ( /*@CAMERA_COMMANDS*/ ENABLE ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 2000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam2", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam2", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 3000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam3", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam3", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam4", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam4", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 7000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam5", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam5", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 3000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam6", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam6", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 5000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam5", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam5", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 4000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam6", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam6", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); wait ( 9000.000 ); camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "duel_cam7", ORIGIN)$, 0 ); camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "duel_cam7", ANGLES)$, < 0.000 0.000 0.000 >, 0 ); affect ( "player", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_ORIGIN", $tag( "player_safe_spot", ORIGIN)$ ); set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); } affect ( "luke_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "false" ); set ( /*@SET_TYPES*/ "SET_WATCHTARGET", "vader_cin2" ); set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "vader_cin2" ); set ( /*@SET_TYPES*/ "SET_INVINCIBLE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_SOLID", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_FIRE_WEAPON", /*@BOOL_TYPES*/ "true" ); } affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_INVISIBLE", /*@BOOL_TYPES*/ "false" ); set ( /*@SET_TYPES*/ "SET_WATCHTARGET", "luke_cin2" ); set ( /*@SET_TYPES*/ "SET_LOOK_TARGET", "luke_cin2" ); set ( /*@SET_TYPES*/ "SET_INVINCIBLE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_SOLID", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_FIRE_WEAPON", /*@BOOL_TYPES*/ "true" ); affect ( "luke_cin2", /*@AFFECT_TYPE*/ FLUSH ) { wait ( 3000.000 ); set ( /*@SET_TYPES*/ "SET_FIRE_WEAPON", /*@BOOL_TYPES*/ "false" ); set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_A7_KICK_L_AIR" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { task ( "vader_fall" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "vader_fall" ); } dowait ( "vader_fall" ); wait ( 500.000 ); set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_FLIP_BACK1" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_ANIM_BOTH", /*@ANIM_NAMES*/ "BOTH_KNOCKDOWN2" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); affect ( "emporer", /*@AFFECT_TYPE*/ FLUSH ) { affect ( "luke_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_SABERACTIVE", /*@BOOL_TYPES*/ "false" ); affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_BEHAVIOR_STATE", /*@BSTATE_STRINGS*/ "BS_DEFAULT" ); set ( /*@SET_TYPES*/ "SET_ANIM_HOLDTIME_BOTH", -1 ); affect ( "luke_cin2", /*@AFFECT_TYPE*/ FLUSH ) { affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_WALKING", /*@BOOL_TYPES*/ "true" ); set ( /*@SET_TYPES*/ "SET_RUNNING", /*@BOOL_TYPES*/ "false" ); task ( "vader_go" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "vader_go" ); } dowait ( "vader_go" ); affect ( "vader_cin2", /*@AFFECT_TYPE*/ FLUSH ) { task ( "vader_go2" ) { set ( /*@SET_TYPES*/ "SET_NAVGOAL", "vader_go2" ); } dowait ( "vader_go2" ); wait ( 7000.000 ); remove ( "vader_cin2" ); remove ( "luke_cin2" ); camera ( /*@CAMERA_COMMANDS*/ DISABLE ); } } } } } } } } } } Just copy that into notepad and open it up with bevhad, if you already have the Jedi Academy SDK by raven software.




Crazy Assassin

Overlord of Various Things

50 XP

25th August 2008

0 Uploads

428 Posts

0 Threads

#4 10 years ago

Cutscene creation isn't really my field...

First off, try moving all the camera commands outside the affect fields.

Second: The luke_cin affect block is inside the emperor in the first cinematic.

Not super important, but it's still something you should fix.

I'm too tired to work out the second script, so I'll leave it for Nab.




NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#5 10 years ago

Double W Jedi;4828345Just copy that into notepad and open it up with bevhad, if you already have the Jedi Academy SDK by raven software.[/quote] Actually, you can just copy and paste it straight into BehavED. It'll accept pasting as long as the script is formatted correctly, just be prepared for it to gripe twice.

I think the whole problem is that you are nesting affects inside affects. Do not do that, it will cause severe bugs. If memory serves, after the second affect block in, JA goes berserk. Only use affect blocks when you are trying to access variables on an entity, or move/rotate it. Otherwise, just run without them.

Do realize as well that affect blocks actually shift the script onto the entity you specify. So when you remove an entity that is being "affected", whatever script is running on it is instantly terminated. I think that's what's happening.

[quote=Crazy Assassin;4828801]I'm too tired to work out the second script, so I'll leave it for Nab.

U... :fistpunch:




lassev

Degenerate scripter

50 XP

21st June 2004

0 Uploads

847 Posts

0 Threads

#6 10 years ago

There's nothing wrong about super nesting affects like that as such. It's one way of building cinematic scripts, and also the way I used years ago, because it looks the simplest one. The only drawback it has is the inability to make NPCs do things at the same time except for simple residual effects from the previous affect. However, if that's of no consequence for your project, there's no real reason not to use this format. And there's certainly no reason to try to keep as much stuff as possible outside of affects.

But other than that, you should clean those scripts. The second one has redundant affects in any case.

and told the intro script to make the npcs invisble, and when it plays the next cutscene, i told not make them visisble, but when the cutscene the npcs are still invisible, and the camera's won't change until an npc completes it task.

I don't really understand what you are trying to say there, but the end of your first script makes them invisible, and they are made back visible after all those camera commands in your second script. If you WAIT (or DOWAIT) for a task, then obviously the script will stop until the wait is over.

Well, anyway, you'd do yourself a favour if you dropped this cinematic scripting style and adopted a signalling based style. It's much more versatile. Have a look at any of the longer original Raven cinematic scripts for examples.




Crazy Assassin

Overlord of Various Things

50 XP

25th August 2008

0 Uploads

428 Posts

0 Threads

#7 10 years ago
NAB622;4828828U... :fistpunch:

Crazy:1 -- Nab:0

=p

Anyway...

I restructured the script, but I don't know if that alone will debug it. Honestly, I don't do any NPC scripting, as I prefer to make SANE objects move around.

And yes, NPCs are insane. They should all be committed.

Spoiler: Show

//Generated by BehavEd

remove ( "vader" ); rem ( "Don't forget to set the waits that have a count of 0!" ); rem ( "They're at 0 because I'm not sure how long you want them to wait for. If 0, just remove that line." );

task ( "camera_start" ) { camera ( ENABLE ); camera ( MOVE, tag( "duel_cam", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam", ANGLES), < 0 0 0 >, 0 ); wait ( 2000 ); camera ( MOVE, tag( "duel_cam2", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam2", ANGLES), < 0 0 0 >, 0 ); wait ( 3000 ); camera ( MOVE, tag( "duel_cam3", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam3", ANGLES), < 0 0 0 >, 0 ); wait ( 5000 ); camera ( MOVE, tag( "duel_cam4", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam4", ANGLES), < 0 0 0 >, 0 ); wait ( 7000 ); camera ( MOVE, tag( "duel_cam5", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam5", ANGLES), < 0 0 0 >, 0 ); wait ( 3000 ); camera ( MOVE, tag( "duel_cam6", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam6", ANGLES), < 0 0 0 >, 0 ); wait ( 5000 ); camera ( MOVE, tag( "duel_cam5", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam5", ANGLES), < 0 0 0 >, 0 ); wait ( 4000 ); camera ( MOVE, tag( "duel_cam6", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam6", ANGLES), < 0 0 0 >, 0 ); wait ( 9000 ); camera ( MOVE, tag( "duel_cam7", ORIGIN), 0 ); camera ( PAN, tag( "duel_cam7", ANGLES), < 0 0 0 >, 0 ); }

task ( "set_state" ) {

affect ( "player", FLUSH ) { set ( "SET_ORIGIN", tag( "player_safe_spot", ORIGIN) ); set ( "SET_SABERACTIVE", "true" ); }

affect ( "luke_cin2", FLUSH ) { set ( "SET_INVISIBLE", "false" ); set ( "SET_WATCHTARGET", "vader_cin2" ); set ( "SET_LOOK_TARGET", "vader_cin2" ); set ( "SET_INVINCIBLE", "true" ); set ( "SET_SOLID", "true" ); set ( "SET_SABERACTIVE", "true" ); set ( "SET_FIRE_WEAPON", "true" ); }

affect ( "vader_cin2", FLUSH ) { set ( "SET_INVISIBLE", "false" ); set ( "SET_WATCHTARGET", "luke_cin2" ); set ( "SET_LOOK_TARGET", "luke_cin2" ); set ( "SET_INVINCIBLE", "true" ); set ( "SET_SOLID", "true" ); set ( "SET_SABERACTIVE", "true" ); set ( "SET_FIRE_WEAPON", "true" ); } }

task ( "dothat" ) {

affect ( "luke_cin2", FLUSH ) { wait ( 3000 ); set ( "SET_FIRE_WEAPON", "false" ); set ( "SET_ANIM_BOTH", "BOTH_A7_KICK_L_AIR" ); set ( "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 0 ); set ( "SET_SABERACTIVE", "false" ); }

affect ( "vader_cin2", FLUSH ) {

task ( "vader_fall" ) { set ( "SET_NAVGOAL", "vader_fall" ); }

dowait ( "vader_fall" ); wait ( 500 ); set ( "SET_ANIM_BOTH", "BOTH_FLIP_BACK1" ); set ( "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 0 ); set ( "SET_ANIM_BOTH", "BOTH_KNOCKDOWN2" ); set ( "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 0 ); set ( "SET_BEHAVIOR_STATE", "BS_DEFAULT" ); set ( "SET_ANIM_HOLDTIME_BOTH", -1 ); wait ( 0 ); set ( "SET_WALKING", "true" ); set ( "SET_RUNNING", "false" );

task ( "vader_go" ) { set ( "SET_NAVGOAL", "vader_go" ); }

dowait ( "vader_go" ); wait ( 0 );

task ( "vader_go2" ) { set ( "SET_NAVGOAL", "vader_go2" ); }

dowait ( "vader_go2" ); wait ( 7000 ); remove ( "vader_cin2" ); remove ( "luke_cin2" ); } }

dowait ( "camera_start" ); dowait ( "set_state" ); dowait ( "dothat" ); camera ( DISABLE );

There you go. Have fun. =p




NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#8 10 years ago
lassev;4828914There's nothing wrong about super nesting affects like that as such.

o.0 The glitches must be MP specific, because the last time I did that, the game completely dropped the script. And it also randomly rearranges your script under certain circumstances.




Crazy Assassin

Overlord of Various Things

50 XP

25th August 2008

0 Uploads

428 Posts

0 Threads

#9 10 years ago

Probably, considering half the Icarus functions don't work in MP anyway.