Aller au contenu

Photo

Scripting a cutscene


  • Veuillez vous connecter pour répondre
7 réponses à ce sujet

#1
Jereniva

Jereniva
  • Members
  • 123 messages

this is a snippet, it's a script that runs in the Action of a conversation.

if I comment out Aurel's death, the two guys run to their waypoints fine.

but with script below they won't run to their Waypoints.

 

I also tried putting the movements to Waypoints after the death, but same results.

 

What am I doing wrong?

            AssignCommand(oNeylad,ActionMoveToObject(oWP_neylad,TRUE));
            AssignCommand(oHunter,ActionMoveToObject(oWP_hunter,TRUE));
            ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDeath(), oAurel );


#2
kevL

kevL
  • Members
  • 4 057 messages
Try wrapping one or the other, either in a separate function and/or with DelayCommand ...

eg.
DelayCommand(0.0, AssignCommand(oNeylad,ActionMoveToObject(oWP_neylad,TRUE)));
DelayCommand(0.0, AssignCommand(oHunter,ActionMoveToObject(oWP_hunter,TRUE)));
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDeath(), oAurel );
- using DelayCommand() like that takes 'advantage' of what we're talking about in the thread about "order of execution" -- in this case it simply shunts execution till after the death finishes.

- while this might not be the workaround, in this case, I'm sure there is a solution.

#3
Jereniva

Jereniva
  • Members
  • 123 messages

Hi Kev, I'll try wrapping in DelayCommands, I figured this issue was related to the other problem I had.

But it was late and I was tired, so I stopped. Sometimes you get tired and it's better just stop trying!

I did figure out something that was causing me problems. I used one of the "Start conversation" triggers, and where you indicate the owner of the conversation, I used an actor, and some of her actions would naturally kill a conversation, spellcasting for example, and it was making me nuts because I could not figure out why the conversation would stop.

So I put in a waypoint to be the "conversationalist" and bam, it all flows perfectly.

 

I found a good example in the NWN 2 OC, the whole cut scene where you meet Elanee finally, and fight a bladeling, etc. It has lots of actors moving around, speaking, spellcasting, and so on. I'll pick it apart with a rested mind.

 

Sometimes I really think having years of using NWN 1's toolset is more of a disadvantage to mastering NWN 2's. There are many things that weren't possible or done in a completely different way with NWN 1, and I almost need to unlearn 1 to take full advantage of 2.

 

Thank you for the help!



#4
kevL

kevL
  • Members
  • 4 057 messages
y, am curious to hear how it goes

#5
Tchos

Tchos
  • Members
  • 5 052 messages

I can't say for sure, but some of your scripts may be getting interrupted by the AI of the participants -- for instance, their On Perception scripts may make them notice a nearby enemy, putting them into combat, or their On Heartbeat may be making them attempt to reach waypoints or wander around, or other things of that nature.  To avoid this, if this is happening, you can remove their creature event scripts before putting them into this scene you're orchestrating so that they're mindless puppets aside from what you directly command them to do.  Then, if you need them to behave normally later, you can use SetCreatureScriptsToSet (object oCreature, int nScriptSet); to restore the default creature event scripts.  The "No AI" int is 0, and the default AI int is 9, so:

 

For no AI:

SetCreatureScriptsToSet (oNeylad, 0);

 

For default AI:

SetCreatureScriptsToSet (oNeylad, 9);


  • Jereniva aime ceci

#6
Jereniva

Jereniva
  • Members
  • 123 messages

Thank you Tchos.

 

In this script, PC enters the room, hitting the trigger which starts the conversation.

There is no combat, everyone is friendly here. I have not at this point modified any of the standard NPC scripts. I did a change to the default Spawn, where I enable a constant that does bark strings when enemy is perceived. I can not remember what it is specifically, I'll update this post when I get home. 

Also, the one actor casts Resurrection on the dead actor. I assume that doesn't anger the target, but who knows! Maybe he liked being dead... :)

If I set it to disable their AI, should I do it in the trigger that starts the conversation, and reset it in the End or Abort of the conversation?

 

By the way, does End also fire when a conversation is Aborted? I have never used that hook for anything other than "Bad guy is done with his monologue and it's time to fight."



#7
Tchos

Tchos
  • Members
  • 5 052 messages

I don't know what fires when a conversation is aborted, but I don't allow conversations to be aborted, by ticking the "Multiplayer conversation" box in the dialogue properties.

 

I thought perhaps that the death of the one character might interrupt what the other two are doing, since the default On Death script sends a silent signal to nearby members of the same faction, which are called "NW_I_AM_DEAD" and "NW_ATTACK_MY_TARGET", but it's just a guess.


  • Jereniva aime ceci

#8
Jereniva

Jereniva
  • Members
  • 123 messages

Thank you for the info about the "death shouts".  I'll take a look at this.