Jump to content

NPC - parsing error


St_Vitruvius

Recommended Posts

I'm trying to create a non-joinable npc to figure out how to do them. I get this error:

 

[elven_pack/d/srrhist.d] PARSE ERROR at line 27 column 13-15
Near Text: SAY
syntax error

 

As this is my first npc, I'm not sure if I got it all right..

 

I'm using this code:

//Elven Tutor:
COPY ~elven_pack/cre/srrhist.cre~							 ~override/srrhist.cre~
 SAY NAME1 ~Rhistel~
 SAY NAME2 ~Rhistel~


COMPILE ~elven_pack/d/srrhist.d~
EXTEND_TOP ~AR0602.bcs~ ~elven_pack/baf/AR0602.baf~
APPEND ~pdialog.2da~
~srrhist srrhistP srrhistJ srrhistD srrhist25P srrhist25J srrhist25D srrhist25~
UNLESS ~srrhist~

APPEND ~interdia.2da~
~srrhist srrhistB srrhistB25~
UNLESS ~srrhist~

 

Can anyone tell me what is wrong and how I fix it?

Link to comment

Can we see the bit of code in the D file itself? That is where the mistake is, not necessarily in the TP2.

 

The mistake will be in srrhist.d in the d subfolder of the mod folder elven_pack, somewhere before line 27.

 

Jastey's faster than me :)

Link to comment

This is the .d:

BEGIN srtutor

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Talk1
  SAY ~Greetings, <CHARNAME>, I am Rhistel Galenedel. I hope you enjoy our fair city?~

  IF ~~ THEN REPLY ~Yes, rarely have I seen such beauty in one place.~ GOTO beauty

  IF ~~ THEN REPLY ~Yes, it is.. nice.. But I grow restless, feeling there is something yet undone.~ GOTO restless
  END

  IF ~~ THEN BEGIN beauty
	 SAY ~I can only agree, but this is not Suldannesselar at its pinnacle. We've just now started rebuilding after the attack of John Irenicus.~
	 IF ~~ THEN REPLY ~Then I shall come back, when the wounds have healed to look upon the beauty of the trees.~ GOTO comeback
	 IF ~~ THEN REPLY ~I don't understand why he could so turn away from all of this.~ GOTO why
  END

	 IF ~~ THEN BEGIN comeback
		SAY ~I will look forward to that day. But before you leave I have a gift to you from our fair Queen Elessime.~
		SAY ~She asked me to train you in a special fighting style known to the elves.~
		SAY ~The style of the Bladesong~
		IF ~~ THEN REPLY ~Bladesong?~ GOTO bladesong
	 END

		IF ~~ THEN BEGIN bladesong
		   SAY ~Yes, it is an art of both magic, martial arts, and song blended into an intricate dance. It is one of our deepest guarded secrets, only taught to elves. Will you learn this?~
			   IF ~~ THEN REPLY ~Yes, I'd be honored.~ GOTO yes
			   IF ~~ THEN REPLY ~No, I do not have the time requirred now. But perhaps later..~ GOTO no
		   END

			  IF ~~ THEN BEGIN yes
				 SAY ~Then we shall begin at once.~ EXIT
			  END

			  IF ~~ THEN BEGIN no
				 SAY ~Then I will await you return, should you change your mind.~ EXIT
			  END

	 IF ~~ THEN BEGIN why
		SAY ~(sigh) One can only guess.. There was a matter which I would like to talk to you about.~
		SAY ~Our fair Queen Elessime has asked me to train you in a special fighting style known to the elves.~
		SAY ~The style of the Bladesong~
		IF ~~ THEN REPLY ~Bladesong?~ GOTO bladesong
	 END

  IF ~~ THEN BEGIN restless
  SAY ~Yes, I can only immagine what horrors you went through in your fight with Jon Irennicus.~
  SAY ~But if you come by me on you next visit, I have something to give you, if you can afford the time to recieve the training.~
  IF ~~ THEN REPLY ~I will do that. But now, you must excuse me. Good bye.~ EXIT
  END

IF ~NumTimesTalkedTo(1)~ THEN BEGIN Talk2
  SAY ~<CHARNAME>! It is good to see you again. I trust that you are in good health? You must excuse me, though, I have to practice my moves~ EXIT

Link to comment

When you want to use a multi-say, you shouldn't use SAY repeatedly in the same state. Instead, you would use =. If you like, you can think of it as sideways ditto marks.

 

Also, you need a END at the end.

 

Try this:

BEGIN srtutor

 

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Talk1

SAY ~Greetings, <CHARNAME>, I am Rhistel Galenedel. I hope you enjoy our fair city?~

 

IF ~~ THEN REPLY ~Yes, rarely have I seen such beauty in one place.~ GOTO beauty

 

IF ~~ THEN REPLY ~Yes, it is.. nice.. But I grow restless, feeling there is something yet undone.~ GOTO restless

END

 

IF ~~ THEN BEGIN beauty

SAY ~I can only agree, but this is not Suldannesselar at its pinnacle. We've just now started rebuilding after the attack of John Irenicus.~

IF ~~ THEN REPLY ~Then I shall come back, when the wounds have healed to look upon the beauty of the trees.~ GOTO comeback

IF ~~ THEN REPLY ~I don't understand why he could so turn away from all of this.~ GOTO why

END

 

IF ~~ THEN BEGIN comeback

SAY ~I will look forward to that day. But before you leave I have a gift to you from our fair Queen Elessime.~

= ~She asked me to train you in a special fighting style known to the elves.~

= ~The style of the Bladesong~

IF ~~ THEN REPLY ~Bladesong?~ GOTO bladesong

END

 

IF ~~ THEN BEGIN bladesong

SAY ~Yes, it is an art of both magic, martial arts, and song blended into an intricate dance. It is one of our deepest guarded secrets, only taught to elves. Will you learn this?~

IF ~~ THEN REPLY ~Yes, I'd be honored.~ GOTO yes

IF ~~ THEN REPLY ~No, I do not have the time requirred now. But perhaps later..~ GOTO no

END

 

IF ~~ THEN BEGIN yes

SAY ~Then we shall begin at once.~ EXIT

END

 

IF ~~ THEN BEGIN no

SAY ~Then I will await you return, should you change your mind.~ EXIT

END

 

IF ~~ THEN BEGIN why

SAY ~(sigh) One can only guess.. There was a matter which I would like to talk to you about.~

= ~Our fair Queen Elessime has asked me to train you in a special fighting style known to the elves.~

= ~The style of the Bladesong~

IF ~~ THEN REPLY ~Bladesong?~ GOTO bladesong

END

 

IF ~~ THEN BEGIN restless

SAY ~Yes, I can only immagine what horrors you went through in your fight with Jon Irennicus.~

SAY ~But if you come by me on you next visit, I have something to give you, if you can afford the time to recieve the training.~

IF ~~ THEN REPLY ~I will do that. But now, you must excuse me. Good bye.~ EXIT

END

 

IF ~NumTimesTalkedTo(1)~ THEN BEGIN Talk2

SAY ~<CHARNAME>! It is good to see you again. I trust that you are in good health? You must excuse me, though, I have to practice my moves~

IF ~~ THEN EXIT

END

Link to comment

You're going to have to go back and change some of the following, because they will give you No Valid Reply or Links in game:

 

IF ~~ THEN BEGIN yes

SAY ~Then we shall begin at once.~ EXIT

END

 

 

should be

 

IF ~~ THEN BEGIN yes

SAY ~Then we shall begin at once.~

IF ~~ THEN EXIT

END

Link to comment

You missed this one:

IF ~~ THEN BEGIN restless

SAY ~Yes, I can only immagine what horrors you went through in your fight with Jon Irennicus.~

SAY ~But if you come by me on you next visit, I have something to give you, if you can afford the time to recieve the training.~

IF ~~ THEN REPLY ~I will do that. But now, you must excuse me. Good bye.~ EXIT

END

 

should be

IF ~~ THEN BEGIN restless

SAY ~Yes, I can only immagine what horrors you went through in your fight with Jon Irennicus.~

= ~But if you come by me on you next visit, I have something to give you, if you can afford the time to recieve the training.~

IF ~~ THEN REPLY ~I will do that. But now, you must excuse me. Good bye.~ EXIT

END

As berelinde said. :)

Link to comment

Thanks a lot.. I've got to install without any errors.. But the npc doesn't show up.. What could be the problem? The code in the .tp2 is still as above and the .baf for the area file looks like this:

 

//The file putting Rhistel in his propper place - Johnnys Dungeon a.t.m.

IF
 Global("RhistelExists", "AR0602",0)
THEN
 RESPONSE #100
 SetGlobal("RhistelExists", "AR0602",1)
 CreateCreature("Rhistel",[3830.2377],3)
END

Link to comment

This is the code you've got in your tp2

COMPILE ~elven_pack/d/srrhist.d~
EXTEND_TOP ~AR0602.bcs~ ~elven_pack/baf/AR0602.baf~

 

If it were me, I'd have her spawn *anywhere* else. There's too much going on in CI.

 

Couple things wrong with it.

 

You're spawning a creature. You should use EXTEND_BOTTOM, not extend top. If you extend the top, you're going to have to add Continue() to every script block, or you're going to have troubles. Likely *big* troubles. Especially somewhere like AR0602.

 

You're better off extending the bottom. In that case, don't use Continue(), or you risk spawning more than one of your cre.

 

If it were me, I'd call the area file something else. like STAR0602.baf (if your prefix is ST). Also, you're probably better off not assuming that AR0602 is already in your override.

 

So that line might look like

COPY ~AR0602.BCS~ ~override~

EXTEND_BOTTOM ~AR0602.BCS~ ~MyMod/BAF/STAR0602.BAF~

 

 

Hope that helped.

Link to comment
Also, you're probably better off not assuming that AR0602 is already in your override.

 

So that line might look like

COPY ~AR0602.BCS~ ~override~

 

This bit you don't need to worry about (and you'd want COPY_EXISTING in any case).

 

You're better off extending the bottom. In that case, don't use Continue(), or you risk spawning more than one of your cre.

 

This on the other hand is the best advice ever, listen to berelinde :) Only use EXTEND_TOP in situations where EXTEND won't work - if you EXTEND_TOP in ar0602.bcs you will almost certainly break your game.

Link to comment

Well, that condition is fine for the NPC dialogue - but something has to trigger the talk - and he needs to know where to find his dialogue, and he needs to have stuff in his dialogue file to say. There could be three things wrong here.

 

IF the contents you have posted above are what you have exactly, you have begun a dialogue file, but not really put anything in it. To begin a dialogue file,

BEGIN ~srtutor~

does it fine, but that is just the cmmand to WeiDU to set up a dialogue file called srtutor.dlg. You would need two more steps:

 

in the D, it is safest to split the actions of dialogue creation and addition, so

/* tell WeiDU to create the dialogue, only needed once in your whole mod, at the start */
BEGIN ~srtutor~  
/* tell WeiDu that you want to add dialogue to srtutuor.dlg */
APPEND ~srtutor~

/* all your IF THEN SAY REPLY, but no CHAINS go here in the middle of a big APPEND block */

END /* end the appending to the dialogue*/

//if you need to add CHAINs, then put them outside the APPEND block

CHAIN IF WEIGHT#-1 ~conditions/triggers~ THEN BEGIN ~srtutor~ MyNextTalk
~This means that my dialogue has been created.~
== ~cmorgan~ IF ~InParty("cmorgan")~ THEN ~Yes, srtutuor, and that your additional dialogue gets tacked on afterwards.~
== ~srtutuor~ IF ~InParty("cmorgan")~  THEN ~But how do I make sure I am assigned to the right dialogue file?~
== ~cmorgan~ IF ~InParty("cmorgan")~ THEN ~Oh, no problem - either add it into the tp2, or fire up DLTCEP or NI, and make sure that the dialogue filed says "srtutor".~
== ~srtutor~ IF ~InParty("cmorgan")~ THEN ~cool! I will have to go check.~
END
++ ~OK, so everything is ok now~ EXIT
++ ~Nope, still don't understand~ GOTO TellUsMoreAboutTheProblem

 

So to review, 1. check that you have BEGIN to create the dlg, that you APPEND or CHAIN into that dialogue, and that the .cre has the name you used under BEGIN assigned as thier dialogue file :) .

 

(I am assuming you expect him to stand there until clicked on/talked to. If I have misread the problem, and you expect him to seek the party out, then please let us know... it requires some additional steps).

Link to comment

Don't think you need the APPEND ~strutor~ part, if you're going to start with CHAIN. That will do that automatically. If you are planning on starting with a regular IF ~~ THEN BEGIN, though, you should probably use it.

 

If you would like your npc to walk up to the PC and start talking, you could either give him the walk-up-to-the-PC-and-start-talking default script, INITDLG.bcs, or you could call for it in your character's override bcs.

 

To use INITDLG.bcs, just select that as the appropriate default script when you change it in NI.

 

I put this in the messenger's override script to get him to walk up to Player1 and start talking:

 

IF
 OR(3)
 Global("B!GavinMessenger1","GLOBAL",1)
 Global("B!GavinMessenger2","GLOBAL",1)
 Global("B!GavinMessenger3","GLOBAL",1)

THEN
 RESPONSE #100
MoveToObject(Player1)
Dialog(Player1)
END

Don't remember why I'm using Dialog(Player1) instead of StartDailogueNoSet(Player1), but I'm sure there was a reason for it.

Link to comment

Archived

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

×
×
  • Create New...