Jump to content


Photo

Unending cutscene


  • Please log in to reply
34 replies to this topic

#21 jcompton

jcompton
  • Modder
  • 492 posts

Posted 31 August 2007 - 01:19 PM

Even Weighted, the talk for the following morning doesn't run afterwards. It doesn't even show up next in the talks, when I use Cntrl-I. I really don't know what else to try!


This looks like it's getting overcomplicated by too much example code and too many conditions.

Break down your problem as simply as possible.

When you want a dialogue in the morning, all of three things have to happen.

- You set a variable in a dreamscript
- You have a player script watch for that variable being true
- You have that player script initiate dialogue (and change the variable so it only happens once.)

Boil down the problem to those three steps and show the code you are using to try to accomplish that feat.

Edited by jcompton, 31 August 2007 - 01:19 PM.


#22 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 31 August 2007 - 01:32 PM

I think I made a much more complicated set than I thought I was doing. The variable wouldn't I think, be in the dream file, as the morning after banter fires after *another* banter and rest:

Basically, what is meant to happen is
a) Dream script
b) Cutscene
c) Follow-up banter
d) PC decides whether or not to rest again
e) IF the PC decides to rest, then there is a morning after banter.

A-D are now (at last, and thanks to much help!) running as they should. What's not working is E.

The last trick I tried was putting the triggers for the morning after into a separate script. The relevant bits (I think):

//PC choosing whether to rest:

END
++ ~Well, everyone is awake now, so we might as well leave.~ DO ~SetGlobal("TM#DrunkenRevelry","GLOBAL",5)~ EXIT //Apply fatigue to the 3
++ ~Back to bed, everyone. We'll need to be rested for tomorrow's work.~ DO ~SetGlobal("TM#DrunkenRevelry","GLOBAL",6) RestParty()~ EXIT
++ ~Shut up! We all need our sleep~ DO ~SetGlobal("TM#DrunkenRevelry","GLOBAL",6) RestParty()~ EXIT

//The Script:

IF
GLOBAL("TM#DrunkenRevelry","GLOBAL",6)
THEN
RESPONSE #100
SetGlobal("TM#DrunkenRevelry","GLOBAL",7)
ActionOverride("Larz",Interact("Korgan"))
END

//The banter-that-is-supposed-to-follow

CHAIN IF
WEIGHT -1
~
GLOBAL("TM#DrunkenRevelry","GLOBAL,",7)~
THEN BTM#LAR TM#MorningAfter
~Oooh, my head!~
== BKORGAN ~Can't handle th' mornin' after?~
END

//After which various NPC's may comment.

I read somewhere else about sticking morning-after stuff in the .cre's override script. That I do not know how to do, *at this point, anyway. The script is just a script, named tm#driam.

*In fact, I am completely ignorant about .cre override scripts in general: I do not know what they are, how they are made, or why they are needed. Any explanations or pointers toward appropriate tutorials will be greatly appreciated.

Edited by Bookwyrme, 31 August 2007 - 02:04 PM.

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#23 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 31 August 2007 - 06:33 PM

I checked with CLUAConsole and the GLOBALs are advancing as they should: When the PC chooses rest, it sets to 6 as it should.

But the morning after does not fire...

What would I put in the J file if I went that route? Just the scripting for the morning after, or would I put the whole morning after banter there & switch it from B to J?

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#24 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 31 August 2007 - 07:51 PM

Aha.

read somewhere else about sticking morning-after stuff in the .cre's override script. That I do not know how to do, *at this point, anyway. The script is just a script, named tm#driam.


This:
//The Script:

IF
GLOBAL("TM#DrunkenRevelry","GLOBAL",6)
THEN
RESPONSE #100
SetGlobal("TM#DrunkenRevelry","GLOBAL",7)
ActionOverride("Larz",Interact("Korgan"))
END
needs to be applied to *someone*'s script, or it won't work in game. Are you putting this in a .baf file and then putting in your .tp2

EXTEND_BOTTOM ~Whatever you have named Larz's Script~ ~mymod/baf/tm#driam~

?

Because if you don't add that little block so *some* script, it won't be seen by the game, won't run, and therefore won't trigger the dialogue...

or did I misunderstand what you were saying?

Edited by cmorgan, 31 August 2007 - 07:51 PM.


#25 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 31 August 2007 - 08:19 PM

No, you didn't misunderstand. Originally, that bit was part of the banter file (and did not fire), then I moved it to a script.

Thing is, though, none of the Trio has a script, as such, at least, I do not think they do, not past the basic j & p scripts. I've read about giving a .cre an override script, but I don't know how one goes about doing so, or where it is placed, or even fully what it is used for. Any pointers or tutorial links would be welcome, as I've a feeling it's something I'll need again.

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#26 jcompton

jcompton
  • Modder
  • 492 posts

Posted 31 August 2007 - 08:37 PM

- Whose script is it in?

- To assign a script to somebody, you basically just edit their CRE file (in NI or DLTCEP or whatever) and put the name of the script in the appropriate slot. Not much to it.

#27 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 31 August 2007 - 09:12 PM

No ones, at the time. Several things now become clear :)

Except... *sigh* Larz now has a morning after talk... with Nara, about her studies. And that particular banter is *nowhere near* the night's banter, is not related to it in any way, has no Weight assigned, and does not share the variables, and I remain confused!

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#28 jcompton

jcompton
  • Modder
  • 492 posts

Posted 31 August 2007 - 09:53 PM

Except... *sigh* Larz now has a morning after talk... with Nara, about her studies. And that particular banter is *nowhere near* the night's banter, is not related to it in any way, has no Weight assigned, and does not share the variables, and I remain confused!


By which you mean, "When you are fervently wishing that Larz would start his morning-after talk with Korgan, he is instead starting one with Nara"?

Show us, as of this moment, what the opening lines of those two talks (the Korgan, and the Nara) look like. If they are in two different .d files, say that as well. Specifically, if they are in two different .d files, also show us the portion of the TP2 which compiles the two.

#29 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 01 September 2007 - 07:15 AM

By which I mean that, instead of complaining about his headache, he is asking Nara about her studies. The two banters are in different files:

The TP2 portions (I've left Morul in on the off chance he's relevant):
COMPILE ~magetrio/dialogue/blarz.d~
COMPILE ~magetrio/dialogue/larz.d~

COMPILE ~magetrio/dialogue/bmorul.d~
COMPILE ~magetrio/dialogue/morul.d~

COMPILE ~magetrio/dialogue/bnara.d~
COMPILE ~magetrio/dialogue/nara.d~

APPEND ~interdia.2da~
~Larz BTM#Lar BTM#La25~
UNLESS ~Larz~

APPEND ~pdialog.2da~
~Larz TM#LarP TM#LarJ TM#LarD TM#La25P TM#La25J TM#La25D TM#La25~
UNLESS ~Larz~

APPEND ~interdia.2da~
~Morul BTM#Mor BTM#Mo25~
UNLESS ~Morul~

APPEND ~pdialog.2da~
~Morul TM#MorP TM#MorJ TM#MorD TM#Mo25P TM#Mo25J TM#Mo25D TM#Mo25~
UNLESS ~Morul~

APPEND ~interdia.2da~
~Nara BTM#Nar BTM#Na25~
UNLESS ~Nara~

APPEND ~pdialog.2da~
~Nara TM#NarP TM#NarJ TM#NarD TM#Na25P TM#Na25J TM#Na25D TM#Na25~
UNLESS ~Nara~

/////
Opening lines:

CHAIN IF
WEIGHT #-1
~
GLOBAL("TM#DrunkenRevelry","GLOBAL,",6)~
THEN BTM#LAR TM#MorningAfter
~Oooh, my head!~


CHAIN IF
~
CombatCounter(0)
!See([ENEMY])
!StateCheck("Nara",CD_STATE_NOTVALID)
!StateCheck("Larz",CD_STATE_NOTVALID)
InMyArea("Nara")
InParty("Nara")
GLOBAL("TM#IDScroll","GLOBAL",0)~ THEN BTM#LAR TM#LarzNaraScroll
~Nara, you have been studying that scroll for hours. What spell is it?~

I do not know who Larz would decide to chat with if Nara were not present. Doing something other than coding seemed like a good idea, at that point ;)

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#30 Kulyok

Kulyok
  • Modder
  • 2450 posts

Posted 01 September 2007 - 08:58 AM

What will happen if you remove the WEIGHT and will simply position the drunken banter on top of your Larz banter file, as I proposed earlier?

#31 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 01 September 2007 - 09:00 AM

Thing is, it has been at the top of the banter file from the very beginning.

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#32 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 02 September 2007 - 01:11 PM

Ok, I played around with it some more today. Larz sometimes gets the message he's supposed to talk with *someone* in the morning, but not to whom. If Nara's in the party, he has the banter with her; if she's not, and Morul is, he'll banter with Morul. If neither is in the party, nothing happens. The three banters are in different Mage Trio banter files--the one that is supposed to fire is in Larz's, the Nara banter in Nara's, and the Morul banter in Morul's. All three are started by Larz.

I also coded a much shorter test banter between Jaheira and Larz and that did work, after I fixed a missed variable. I had made the same mistake in the DR banter, but fixing it still did not get the morning after banter to fire. I am not sure, at this point, what else to try.

For what it's worth, the test script runs:


//in Larz's d script
IF
CombatCounter(0)
!See([ENEMY])
!StateCheck("Larz",CD_STATE_NOTVALID)
!StateCheck("Jaheira",CD_STATE_NOTVALID)
InMyArea("Jaheira")
InParty("Jaheira")
GLOBAL("TM#TestRest","GLOBAL",0)
THEN
Response #100
SetGlobal("TM#TestRest","GLOBAL",1)
Interact("Jaheira")
END

//In the banter file

CHAIN
IF
WEIGHT #-1
~
GLOBAL("TM#TestRest","GLOBAL",1)~ THEN BTM#LAR TM#TestChat
~Hi. I am trying to see if it is possible to do an evening and morning chat.~
==BJAHEIR ~Truly? Well, let us sleep and we will see if it is a success.~
DO ~SetGlobal("TM#TestRest","GLOBAL",2) RestParty()~
EXIT

CHAIN
IF
WEIGHT #-1
~
GLOBAL("TM#TestRest","GLOBAL",3)~
THEN BTM#Lar TM#TestChatAM
~Did it work?~
DO ~SetGlobal("TM#TestRest","GLOBAL",4)~
== BJAHEIR ~It is too early to say.~
EXIT

//In Larz's override script:
IF
CombatCounter(0)
!See([ENEMY])
!StateCheck("Larz",CD_STATE_NOTVALID)
!StateCheck("Jaheira",CD_STATE_NOTVALID)
InMyArea("Jaheira")
InParty("Jaheira")
GLOBAL("TM#TestRest","GLOBAL",2)
THEN
Response #100
SetGlobal("TM#TestRest","GLOBAL",3)
ActionOverride("Larz",Interact("Jaheira"))
END

Edited by Bookwyrme, 02 September 2007 - 01:33 PM.

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#33 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 02 September 2007 - 02:25 PM

It works, it works, it WORKS!!!!! :)

Somewhere in there, on top of all my other errors, I'd committed a typo in one of the variables.

I don't know precisely where, because I just went and redid all of the ones past the point where it stopped working. The happy result is the morning after talk fires!

And, the NPC's in the party who were supposed to comment, commented on cue.

Thank you again, all of you, for your many patient explanations, suggestions, and examples.

(Did I mention that it now WORKS?)

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),

 


 

 


#34 Rabain

Rabain

    God

  • Member
  • 653 posts

Posted 02 September 2007 - 02:28 PM

Edit: I guess its working now!

Good stuff!

Edited by Rabain, 02 September 2007 - 02:29 PM.

A knight without armour in a savage land...

#35 Bookwyrme

Bookwyrme
  • Modder
  • 5804 posts

Posted 02 September 2007 - 02:30 PM

*Points up to previous, happy post. (I think we typed at the same time)

It works :)

Mods: <a data-cke-saved-href="http://www.shsforums...-auroras-shoes/">Aurora's Shoes (released),