Aller au contenu

Photo

Cuscene Script


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

#1
andysks

andysks
  • Members
  • 1 650 messages
Hi everyone.Can someone give me a hint of how exactly to write a blocking script ?I know how they work once they are ready but no matter how much I try I to write one I get erros on the compile.I'm nowhere near expert on scripting so if there is any help keep  it simple please :).
To be more specific, I want an NPC to cast a fake spell on another NPC.Then the second NPC attacks and kills the first and after that the PC walks and continues the dialogue with the victorious NPC.
If it is needed I will provide the script I am working on tomorrow to see if you can tell me what is wrong.

Andy.

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
Blocking scripts can be very temperamental, so they're very hard to do if you're not yet comfortable with scripting. Someone else in the meantime will probably link to a explanation of how to do a blocking script, but for now, I would advise you to try to use the conversation editor, with a bunch of action scripts attached, to block out your cutscene.

That way, you can break it down into small pieces. First node sets the scene, second node makes the first NPC cast the fake spell, then the third node causes the second NPC to run and attack the first, ending the conversation.

Then the on-death script of the kilt NPC starts another conversation between the PC and the victor.

The standard ga_ scripts should work for most of this, and once you've given it a shot, you can go back, look at how the standard scripts work, and then start writing your own.

#3
Tchos

Tchos
  • Members
  • 5 054 messages
The most reliable way I did it without using a conversation cutscene was to have some kind of regulator with a heartbeat that would check variables on every heartbeat and either wait for the variables to change, take a new action, or refresh a current action, depending on need. Events would change the variables when they completed, and would declare themselves busy or not busy. The final actions would set the conditions I wanted to persist the rest of the time, and then destroy the regulator.

But a conversation cutscene is much easier.

#4
Tchos

Tchos
  • Members
  • 5 054 messages
If you want to see a detailed conversation cutscene with a lot of actions taken in it, open up Batha's conversation and associated scripts from the OC.

#5
andysks

andysks
  • Members
  • 1 650 messages
Lugaid of the Red Stripes : I tried this way already.It got me results but the conversation was aborted after death.I guess now it was the ondeath script missing that you mentioned.

Tchos : I've opened the script and conversation from AJ Heaven when he kills Shandra.I think it is one of the most complicated scenes in the OC with all the jumps around and actions.But I will check Batha as well.

So in conclusion a cutscene can be made without the blocking script, just with the action scripts and delays on the convo ?

Andy.

#6
Tchos

Tchos
  • Members
  • 5 054 messages
Tentatively, I'd say yes, it should be able to be made that way. I haven't done one of those myself. As long as whatever you want to happen in the scene is covered by the actions possible in the conversation scripts.

#7
andysks

andysks
  • Members
  • 1 650 messages
As I see it it looks like that.An action in the conversation works as a Case in the blocking script.A delay on the conversation works as a pause of some kind.And to be honest, the conversation scripts pretty much cover most actions of a cutscene I think.So until I put more time on scripting I go that way.Thanks for the help :).

#8
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
No writing script way = make two custom factions ( to stop the PC getting involved ) give one to each npc then using the cast fake spell and faction reputation generic conversation scripts you can have them fight each other after a spell is thrown ps don't forget to make the victor immortal and the loser a wimp.

#9
andysks

andysks
  • Members
  • 1 650 messages
Thank you all for the help.It all works fine now,as realistic as I can get it.There is only one problem left, the cutscene is aborted when the first NPC casts a spell.I even removed the continuing of the conversation with the victorious NPC so that no OnDeath is needed without any difference.Any ideas ?

#10
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
What's happening is that the 1st NPC is being forced into combat, breaking the conversation. A truly fake spell cast shouldn't do that. You could try setting a plot flag on the 1st NPC, and then turning it off before the real fight begins.

If you know the area where this conversation is going to take place, you can paint down an "i-point", a misc placeable. Give the i-point it's own tag, and then have the PC start the conversation with the i-point instead of with one of the NPCs. You can either have a trigger that starts the conversation, or have a short conversation on the NPCs that starts the second conversation with the i-point.

In the main conversation, you'll have to write in the speaker and listener tags to refer to the NPCs, or just use static cameras to make sure the player sees what you want them to see.

#11
andysks

andysks
  • Members
  • 1 650 messages
I actually had all this.This is how it goes.The PC enters and trigger a speak trigger.The NPC1 says something to an i-point.Then he starts talking to the PC.After a while the NPC2 is created out of sight, and then walks in the scene.After some talk both with the PC and NPC1 she fights him.NPC1 casts a fake spell first but before that scene is aborted :/.Static cameras are in place and everything works as intended.Only the cancelation is a bummer.
Thanks.

#12
andysks

andysks
  • Members
  • 1 650 messages
I just read wrong.You said the PC talk with the i-point not the NPC.Let me try that one...I guess if NPC1 doesn't move at all and the i-point is close to him the PC can have a conversation completely with the i-point...that wont break it because the NPC1 that enters battle was never the owner of the conversation...right ?

#13
Tchos

Tchos
  • Members
  • 5 054 messages
One part is right. The owner of the conversation has to be alive and not in battle for the conversation to continue, so the ipoint should handle the conversation, essentially "throwing its voice" to all of the other characters. The ipoint does not have to be nearby, or even in the same area. You assign who is speaking and who is listening in the conversation's node tab.

I'm not a fan of those speak triggers at all, due to the unintentional and unnecessary effects they have on me as a player in modules that I've played that used them, and rather wish the expansions had replaced them with a better script.

Modifié par Tchos, 05 juin 2013 - 06:56 .


#14
andysks

andysks
  • Members
  • 1 650 messages
So in the end if on the first line the NPC1 doesnt talk to the ipoint ( which he actually doesn't...he is just looking up some shelves) but the ipoint is the speaker and NPC1 the listener, it automatically becomes a conversation owned by the ipoint.

#15
Tchos

Tchos
  • Members
  • 5 054 messages
There are a few ways to make it owned by the ipoint. The owner of the conversation is the object that is firing the conversation (object being anything from the PC to the NPCs to the ipoint, etc.) Script-wise you can do it with a line like this:

AssignCommand(oMyIpoint, ActionStartConversation(oPC, "conversation_name"));

That commands the ipoint to start a conversation of the name "conversation_name" with the PC. The ipoint will own the conversation.

Another way of doing it is to spawn an "ipoint speaker", which is supposed to be a foolproof way of starting a conversation that won't fail even if it's spawned while someone's in combat, or dead, etc. But I haven't tried that yet, so I can't tell you how to do it.

Modifié par Tchos, 05 juin 2013 - 09:19 .


#16
andysks

andysks
  • Members
  • 1 650 messages
I think from the answers that gathered it is clear that there are plenty of ways to make something work in a cutscene.I think I can take it from here.Thanks for all the help, is really nice that the forum is alive after years of this game being out.

#17
Tchos

Tchos
  • Members
  • 5 054 messages
Just to be sure you got the most important part of my last message, because I'd hate to see anything confused here, I wasn't just pointing out other ways of doing it, but stressing what is considered the owner of the conversation. What you list as the speaker and listener in the conversation node tab (which is what you were asking in your previous message) has no effect on who the owner is. The owner is the one that fires off the conversation, regardless of who speaks first in it.

#18
andysks

andysks
  • Members
  • 1 650 messages
Ah so you mean, on the speak trigger the NPC tag is actually the tag of the ipoint ?

#19
Tchos

Tchos
  • Members
  • 5 054 messages
That's right.

#20
andysks

andysks
  • Members
  • 1 650 messages
So it's all tested now and everything works fine.When I set an ipoint as a convo owner it always goes smoother if there are things going on during the convo.Thank a lot again.