Jump to content

Malthis Question Thread


Guest -Malthis-

Recommended Posts

Guest -Malthis-

Hello!

 

As I already stated before, I just want to ask questions that I am really unable to answer.

My question concerns the talks between NPC´s like Mencar´s group oder Lady Galvena and her mage.

I think it shouldn´t be a big deal, but I didn´t find a single hint how this structure works.

Maybe I´m just blind, but I would appreciate any help.

 

Thanks, M

Link to comment
Guest Malthis
Are you asking how your NPC can contribute to this conversation, or are you interested in changing what Lady Galvena and her mage say to each other?

 

Neither, at least for this question.

 

I think I have to explain a little more what I want to do.

I am planning to involve not only the joinable NPC, but several other non-joinable NPC´s for some quests and so on.

The first talk is with one of these NPC´s and I want the joinable NPC to interfere.

I think it´s basically like in Amber for instance, when she gets captured by the slave-hunters, only with the PC involved in the dialogue.

 

M.

Link to comment

Do you know how to create a basic dialogue between a single NPC and the PC? If you do, then you just need to learn how to use EXTERN to another NPC's dialogue file in order to add that NPC to the conversation.

 

However, if you don't yet know how to create a dialogue between a single NPC and the PC, we'd better start from there. :D Once you get the basic structure going it's relatively easy to lean how to do all the variations you can think of.

 

Another thing that affects what you need to do, is if the NPCs you want to involve are all "new" NPC from you mod or if there are also "old" NPC from the original game.

Link to comment
Guest Malthis
Do you know how to create a basic dialogue between a single NPC and the PC? If you do, then you just need to learn how to use EXTERN to another NPC's dialogue file in order to add that NPC to the conversation.

 

However, if you don't yet know how to create a dialogue between a single NPC and the PC, we'd better start from there. :D Once you get the basic structure going it's relatively easy to lean how to do all the variations you can think of.

 

Another thing that affects what you need to do, is if the NPCs you want to involve are all "new" NPC from you mod or if there are also "old" NPC from the original game.

 

Thanks!

I know the basics (at least I think so) but I didn´t know the EXTERN command.

Now it works, well, it kinda works.

Is there any source that explains more detailed what I want to do?

 

Thanks, M.

Link to comment

Hmm... I'm still not sure what exactly you want to do, but I created an example where two non-party NPCs from your mod, the PC and a party-NPC (Viconia) all interact in the same dialogue. I assume that the PC goes to speak to the non-party NPCs, but you could have just as well a script to trigger the dialogue.

 

non-party NPC1:

BEGIN ~MYNPC1~ 

IF ~Global("M#GiveQuest","GLOBAL",0)~ THEN BEGIN QuestBegin
 SAY ~Hey, you look like an adventurer!~
 IF ~~ THEN REPLY ~I'm <CHARNAME>, a great adventurer.~ GOTO QuestA
 IF ~~ THEN REPLY ~I'm <CHARNAME>, a crazy adventurer.~ GOTO QuestB
END

IF ~~ THEN BEGIN QuestA
 SAY ~Great, I'm looking for a great adventurer for a quest!~
 IF ~~ THEN GOTO QuestC
 IF ~InParty("Viconia")
  See("Viconia")
  !StateCheck("Viconia",STATE_SLEEPING)
  !StateCheck("Viconia",STATE_HELPLESS)
  !StateCheck("Viconia",STATE_STUNNED)
  !StateCheck("Viconia",STATE_SILENCED)~ THEN EXTERN VICONIJ ViconiaQuestComment 
END

IF ~~ THEN BEGIN QuestB
 SAY ~Great, I'm looking for a crazy adventurer for a quest!~
 IF ~~ THEN GOTO QuestC
 IF ~InParty("Viconia")
  See("Viconia")
  !StateCheck("Viconia",STATE_SLEEPING)
  !StateCheck("Viconia",STATE_HELPLESS)
  !StateCheck("Viconia",STATE_STUNNED)
  !StateCheck("Viconia",STATE_SILENCED)~ THEN EXTERN VICONIJ ViconiaQuestComment
END

IF ~~ THEN BEGIN QuestC
 SAY ~It's a dangereous quest!~
 IF ~~ THEN EXTERN MYNPC2 QuestD
END

IF ~~ THEN BEGIN QuestE
 SAY ~<CHARNAME>, kill the rats in my cellar and you get a great reward!~
 IF ~~ THEN DO ~SetGlobal("M#GiveQuest","GLOBAL",1)~ EXIT
END

IF ~Global("M#GiveQuest","GLOBAL",1)~ THEN BEGIN KillTheRats
 SAY ~Please, kill the rats!~
 IF ~~ THEN EXIT
END

 

Non-party NPC2:

BEGIN ~MYNPC2~

IF ~Global("M#GiveQuest","GLOBAL",0)~ THEN BEGIN QuestGoAskNPC1
 SAY ~Speak to my friend if want a quest.~
 IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN QuestD
 SAY ~But there's a great reward!~
 IF ~~ THEN EXTERN MYNPC1 QuestE
END

IF ~Global("M#GiveQuest","GLOBAL",1)~ THEN BEGIN DoTheQuest
 SAY ~You must do the quest!~
 IF ~~ THEN EXIT
END

 

And finally appending Viconia's file (note the END that APPEND needs):

 

APPEND ~VICONIJ~

IF ~~ THEN BEGIN ViconiaQuestComment
 SAY ~I love quests!~
 IF ~~ THEN EXTERN NPC1DGL QuestC
END

END

 

Somebody else might do it differently, but this should work (unless I made a typo or a silly mistake). You could also post your code here and tell what exactly you would like it to do and what seems not to be working at the moment.

Link to comment
Guest Guest

Hello Meira,

 

Ok, I try to describe exactly what I want to do:

 

PC talks to non-joinable NPC 1.

During the dialgue, non-joinable NPC 2 (or more) interferes.

 

I think I am using the same basic-code you generously showed me.

I will reduce some DLG´s for the overview.

 

Alanya2.d (The non-joinable NPC Nr. 2 who starts the conversation with the PC)

BEGIN Alanya2



IF ~~ THEN BEGIN Alanya2Talk5

SAY ~.~

IF ~~ THEN EXTERN A1 A2

END

 

 

 

Alanya3.d (The non-joinable NPC Nr. 3 who interferes)

BEGIN Alanya3

 

 

 

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Alanya3Talk

 

SAY ~.~

 

IF ~~ THEN DO ~SetGlobal("PCAlanya3Talk1","Global",1)~

 

DO ~EscapeAreaMove("ar0509",593,639,6)~ EXIT

 

END

 

 

 

APPEND ~A1~

 

 

 

IF ~~ THEN BEGIN A2

 

SAY ~I love quests!~

 

IF ~~ THEN EXTERN Alanya2 Alanya2Talk6

 

END

 

END

[code]

 

 

I looked at it over and over again, unable to find the mistake.

 

Weidu says ERROR: Cannot resolve external symbolic label [A2] for DLG [A1]

ERROR: postprocessing [Alanya2]: Failure ("cannot resolve label")

 

 

I am really sorry if the mistake is horribly wrong.

And thanks to all who spending their time on my questions.

 

M.

Link to comment
Hello Meira,

 

Ok, I try to describe exactly what I want to do:

 

PC talks to non-joinable NPC 1.

During the dialgue, non-joinable NPC 2 (or more) interferes.

 

I think I am using the same basic-code you generously showed me.

I will reduce some DLG´s for the overview.

 

Alanya2.d (The non-joinable NPC Nr. 2 who starts the conversation with the PC)

BEGIN Alanya2



IF ~~ THEN BEGIN Alanya2Talk5

SAY ~.~

IF ~~ THEN EXTERN A1 A2

END

 

 

 

Alanya3.d (The non-joinable NPC Nr. 3 who interferes)

BEGIN Alanya3



IF ~NumTimesTalkedTo(0)~ THEN BEGIN Alanya3Talk

SAY ~.~

IF ~~ THEN DO ~SetGlobal("PCAlanya3Talk1","Global",1)~

DO ~EscapeAreaMove("ar0509",593,639,6)~ EXIT

END



APPEND ~A1~



IF ~~ THEN BEGIN A2

SAY ~I love quests!~

IF ~~ THEN EXTERN Alanya2 Alanya2Talk6

END

END

 

 

I looked at it over and over again, unable to find the mistake.

 

Weidu says ERROR: Cannot resolve external symbolic label [A2] for DLG [A1]

ERROR: postprocessing [Alanya2]: Failure ("cannot resolve label")

 

 

I am really sorry if the mistake is horribly wrong.

And thanks to all who spending their time on my questions.

 

M.

 

That error means that the dialog file A1 doesn't contain a dialog state called A2. It's a fairly common mistake (at least for me) and usually caused by a typo.

 

Are the dialogue states Alanya3Talk and A2 both for the same (new) NPC? If they are, you dont use APPEND, you just put them all under the BEGIN Alanya3. You use APPEND if you add to the dialogue files aready in the game, like Viconia's.

Link to comment
Guest Malthis

Hello Meira,

 

Ok, I try to describe exactly what I want to do:

 

PC talks to non-joinable NPC 1.

During the dialgue, non-joinable NPC 2 (or more) interferes.

 

I think I am using the same basic-code you generously showed me.

I will reduce some DLG´s for the overview.

 

Alanya2.d (The non-joinable NPC Nr. 2 who starts the conversation with the PC)

BEGIN Alanya2



IF ~~ THEN BEGIN Alanya2Talk5

SAY ~.~

IF ~~ THEN EXTERN A1 A2

END

 

 

 

Alanya3.d (The non-joinable NPC Nr. 3 who interferes)

BEGIN Alanya3



IF ~NumTimesTalkedTo(0)~ THEN BEGIN Alanya3Talk

SAY ~.~

IF ~~ THEN DO ~SetGlobal("PCAlanya3Talk1","Global",1)~

DO ~EscapeAreaMove("ar0509",593,639,6)~ EXIT

END



APPEND ~A1~



IF ~~ THEN BEGIN A2

SAY ~I love quests!~

IF ~~ THEN EXTERN Alanya2 Alanya2Talk6

END

END

 

 

I looked at it over and over again, unable to find the mistake.

 

Weidu says ERROR: Cannot resolve external symbolic label [A2] for DLG [A1]

ERROR: postprocessing [Alanya2]: Failure ("cannot resolve label")

 

 

I am really sorry if the mistake is horribly wrong.

And thanks to all who spending their time on my questions.

 

M.

 

That error means that the dialog file A1 doesn't contain a dialog state called A2. It's a fairly common mistake (at least for me) and usually caused by a typo.

 

Are the dialogue states Alanya3Talk and A2 both for the same (new) NPC? If they are, you dont use APPEND, you just put them all under the BEGIN Alanya3. You use APPEND if you add to the dialogue files aready in the game, like Viconia's.

 

Yes, the dialog states Alanya3Talk and A2 are both for the same new NPC.

Ok, APPEND is only for dialogue files already in the game, thanks.

But I tested already this...

 

Alanya2.d (The non-joinable NPC Nr. 2 who starts the conversation with the PC)

BEGIN Alanya2



IF ~~ THEN BEGIN Alanya2Talk5

SAY ~.~

IF ~~ THEN EXTERN Alanya3 A2

END

 

 

Alanya3.d (The non-joinable NPC Nr. 3 who interferes)

BEGIN Alanya3



IF ~~ THEN BEGIN A2

SAY ~I love quests!~

IF ~~ THEN EXTERN Alanya2 Alanya2Talk6

END



IF ~NumTimesTalkedTo(0)~ THEN BEGIN Alanya3Talk

SAY ~.~

IF ~~ THEN DO ~SetGlobal("PCAlanya3Talk1","Global",1)~

DO ~EscapeAreaMove("ar0509",593,639,6)~ EXIT

END

 

 

...and Weidu is still telling me basically the same error:

 

ERROR: Cannot resolve external symbolic label [A2] for DLG [Alanya3]

ERROR: postprocessing [Alanya2]: Failure ("cannot resolve label")

 

I think a typos is out of the question.

 

M.

Link to comment
Guest Guest
What does you tp2 file look like?

 

 

 

Here it is, not complete though:

 

 

 

BACKUP ~Alanya/backup~

AUTHOR ~Malthis (X@X.com)~



BEGIN ~Alanya NPC-MOD~



COPY ~Alanya/Creatures/Alanya.cre~   ~override/Alanya.cre~
COPY ~Alanya/Creatures/Alanya2.cre~  ~override/Alanya2.cre~
COPY ~Alanya/Creatures/Alanya3.cre~  ~override/Alanya3.cre~
COPY ~Alanya/Creatures/Alanya4.cre~  ~override/Alanya4.cre~
COPY ~Alanya/Creatures/Alanya5.cre~  ~override/Alanya5.cre~
COPY ~Alanya/Creatures/Alanya6.cre~  ~override/Alanya6.cre~
COPY ~Alanya/Creatures/Alanya7.cre~  ~override/Alanya7.cre~



COMPILE ~Alanya/Dialogs/Alanya.d~
COMPILE ~Alanya/Dialogs/AlanyaB.d~
COMPILE ~Alanya/Dialogs/Alanya2.d~
COMPILE ~Alanya/Dialogs/Alanya3.d~
COMPILE ~Alanya/Scripts/Alanya.baf~
COMPILE ~Alanya/Scripts/Alanya3.baf~
COMPILE ~Alanya/Scripts/Back2.baf~
COMPILE ~Alanya/Scripts/Start.baf~



EXTEND_TOP ~AR0704.bcs~ ~Alanya/Scripts/AR0704.baf~
EXTEND_TOP ~AR0509.bcs~ ~Alanya/Scripts/AR0509.baf~



APPEND ~pdialog.2da~

~Alanya Alanya2 Alanya3~

UNLESS ~Alanya~



APPEND ~interdia.2da~

~Alanya AlanyaB~

UNLESS ~Alanya~

Link to comment
Guest Malthis

Hello again!

 

Thanks to Meira I were able to solve the problem. Thanks, again!

I spent most of the time on writing and scripting, but now I am back with a new request.

This time, it concerns the Strings.

 

I want to add some new Map Notes, using AddMapNote(P:Position*,I:StringRef*).

But I can´t figure out how to add new Strings to refer to.

 

Thanks to all who are willing to help!

 

M.

Link to comment

When I need to add strings in scripts I code them straight to a tra-file (as opposite to the actual dialogs which I traify when they were finished). That means that you replace the I:StringRef* with @1, @2, @3 etc.

 

Then you put the actual text in your dialogs.tra, like this:

 

@1 = ~Wizards laboratory.~
@2 = ~Cave entrance.~
@3 = ~Treasure!~

 

In your tp2 you now need to change the compile bit:

 

COMPILE ~Alanya/Scripts~

To this:

COMPILE ~Alanya/Scripts~ USING ~Alanya/tra/dialogs.tra~

 

Alanya/tra/dialogs.tra is the path to wherever you like to put the tra-file into, but above is the usual practise. You have to change it again a bit when you start adding translations to other languages than English, but were not there yet. :D

 

Note that if you want to have a mac version made of your mod, it would be convenient if file and folder names were written all in lowercase. It's easier to change now, instead of when you have 200 .wav files. :D

 

In case you don't already have it, you might also want to have personal prefix, so that when you distribute your mod you wont have same filenames as another modder. The community prefix list can be found in the Blackwyrm Lair.

 

I hope that helped.

Link to comment
Guest Malthis

Hello, it´s Malthis again.

 

 

I´m making quiet good progress.

When I continue like that, I am pretty confident I will win a price for one of the most excessive mods released :D

The only downside could be that the mod will be released in German, my native language.

Even if I would have the patience and time to translate every single line into English, I think nobody would be satisfied.

I hope there are people who are able to make a suitable translation, so far more would have fun with the mod.

But that is in the (hopefully near) future.

 

Ok, but I´m also back with some problems.

The first one concerns the new map notes.

I followed your instructions Meira, but I doesn´t work.

Basically Weidu tells me that it can not find a translation for @1.

In my opinion the only mistake could be find in the part of my extended script,

 

IF

True()
THEN
RESPONSE #100
AddMapNote([3499.999],@1)

END

 

but I couldn´t find it.

 

 

 

The second one concerns the talks from the NPC the the PC.

 

BEGIN A#Al8B



CHAIN

IF

~InParty("A#Al8")
InParty(Player1)
See(Player1)
!ActuallyInCombat()
!StateCheck(Player1,STATE_HELPLESS)
!StateCheck(Player1,STATE_STUNNED)
!StateCheck(Player1,STATE_SLEEPING)
!StateCheck(Player1,STATE_SILENCED)
Global(“Al8PCTalkâ€Â,â€ÂGLOBALâ€Â,2)~

THEN

A#Al8B A#Al8PC1

~.~

DO ~(“Al8PCTalkâ€Â,â€ÂGLOBALâ€Â,3)~

END

IF ~~ THEN REPLY ~.~ GOTO Al8PC1.1

IF ~~ THEN REPLY ~.~ GOTO Al8PC1.2



CHAIN

IF ~~ THEN A#Al8B Al8PC1.1

~.~

EXIT



CHAIN

IF ~~ THEN A#Al8B Al8PC1.2

~.~

EXIT

 

Weidu shows me multiple errors on this one.

It can´t verify neither the trigger nor the action and shows me other errors too.

 

Well, that´s it for the first.

I hope someone can find my mistakes.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...