Jump to content

Compiling error when trying to add dialog.d


Rana

Recommended Posts

After having looked over several "how to create an npc" guide as well as comparing side by side with mods I currently have that add NPCs to the game, I am at a loss. WeiDU refuses to accept my .d file for some reason.

 

This is the script I am using in my .tp2 setup:

 

COMPILE ~Bladesinger/rw#dfvr.d~

~Bladesinger/rw#dfvr.baf~

 

This is the error I get:

 

Bladesinger/rw#dfvr.d LEXER ERROR at line 3 column 1-95

Near Text: #

invalid character #

 

 

Bladesinger/rw#dfvr.d LEXER ERROR at line 3 column 1-95

Near Text: #

Parsing.Parse_error

ERROR: parsing Bladesinger/rw#dfvr.d: Parsing.Parse_error

ERROR: compiling Bladesinger/RW#DFVR!

Stopped installation because of error.

 

I'm unsure what could be the cause of this issue. As mentioned above, I've literally spent hours comparing to other .tp2 setups that add npcs and I cannot see what I am doing wrong by contrast.

 

Could the problem possibly lay in the .baf or the .d file itself? Any ideas would be very welcome.

 

Edit: In case it means anything, there is no additional j or p .d's because this is dialogue for a summoned creature who does not join the party.

Link to comment
Chances are it is something simple - but we need you to post the contents of your .d

 

(at least lines 0 to 20, preferably more)

 

so we can see what is missing/weidu doesn't like.

 

So you're suggesting the problem could be in the .d? This is all it is right now; mostly just a test dialogue.

BEGIN rw#dfvr

IF ~GLOBAL("DIVINEFAVOR01","GLOBAL",0)~ ##F1
SAY ~Greetings Bladesinger!  Before you stands Tethrin Veralde, The Shining One, The Master of 

Blades.  Your deeds have proven worth of my favor and I wish to offer you a boon.~
++ ~I am humbled, my lord. You honor your humble servant with your mere presence.  A boon from The 

Shining One I shall not refuse.~ + ##F1.1
END

IF ~~ ##F1.1
SAY ~I shall bestow upon you a divine spell of your chosing.  Normally such power is reserved for 

priests of the Seldarine, but you have proven yourself more than worthy of such a blessing.  Ask and 

you shall receive.~
++ ~Grant unto me Defensive Harmony, so that I might better protect myself and my allies in battle.~ 

DO ~ SETGLOBAL("DIVINEFAVOR01","GLOBAL",1)~ + ##F1.2
END

IF ~~ ##F1.2
SAY ~On this day, so shall it be.~
IF ~~ EXIT
END

Link to comment

Yep.

 

To follow up Wisp, for your statenumbers, try something like

 

BEGIN ~rw#dfvr~

IF ~GLOBAL("DIVINEFAVOR01","GLOBAL",0)~ veralde_join_1 // was ##F1

 

and you should register for a prefix at BlackWyrmlair (the part that is still able to be accessed without pay includes the registerable list - if it goes behind the paywall, PPG, SHS, G3, CoM, and every modder out there will rebuild it at another free community instantly and nominate someone to administer it, so it is pretty safe to rely on).

 

As Wisp said, then use that prefix for your variables/everything you can in your mod. That way you don't accidenally use a vanilla game global or local, or someone else's - in these days of BWP installs this is a seriously critical thing!!

 

For example, my registered prefix is c-

 

so I would make your dialog the following, if I was coding it:

 

BEGIN c-dfvr

IF ~GLOBAL("c-divinefavor01","GLOBAL",0)~ c-f1
SAY ~Greetings Bladesinger! Before you stands Tethrin Veralde, The Shining One, The Master of

Blades. Your deeds have proven worth of my favor and I wish to offer you a boon.~
++ ~I am humbled, my lord. You honor your humble servant with your mere presence. A boon from The Shining One I shall not refuse.~ + c-f1.1
END

IF ~~ c-f1.1
SAY ~I shall bestow upon you a divine spell of your chosing. Normally such power is reserved for priests of the Seldarine, but you have proven yourself more than worthy of such a blessing. Ask and you shall receive.~
++ ~Grant unto me Defensive Harmony, so that I might better protect myself and my allies in battle.~ DO ~ SETGLOBAL("c-divinefavor01","GLOBAL",1)~ + c-f1.2

etc.

 

That would avoid having to quote your statelabels.

Link to comment

So if I understand correctly, the problem was not in the COMPILE script, but in the way the .d file was written?

 

Wow, I guess that was it, then. I had no idea WeiDU was so sensitive when it came to the use of specific symbols. ???

Link to comment
WeiDU doesn't like leading #s. You need to quote your state labels. You should also prefix your variables.

 

Still on this task, but have a different issue now, involving a script.

 

To get the npc to cast the spell upon the summoner and then disappear, I need to write a script that will tell it to do so. This is the script I am using and placing in the creature's .baf, but upon placing this in I am getting parsing errors again (specifically a syntax error at line 15 colum 16-16), this time relating to the .baf

 

IF
GLOBAL("RWDIVINEFAVOR01","GLOBAL",1)
THEN
RESPONSE #100
	(LastTalkedToBy,1)
	ApplySpell(Myself,POOF_GONE)
	ActionOverride(LastTalkedToBy,ForceSpellRES("rwd4406",Myself))

END

 

Again, I am unsure as to what is causing this. I'm also unsure if the script is written correctly, as it's hard to test when I can't load it. ??? Any help would be appreciated!

Link to comment
Again, I am unsure as to what is causing this. I'm also unsure if the script is written correctly, as it's hard to test when I can't load it. ??? Any help would be appreciated!

"(LastTalkedToBy,1)" is not correct syntax. What are you trying to do? (I.e. what is it supposed to be?)

 

You should probably also have casting POOF_GONE as the last action, otherwise you'll probably find that the ActionOverride isn't executed.

Link to comment
Again, I am unsure as to what is causing this. I'm also unsure if the script is written correctly, as it's hard to test when I can't load it. ??? Any help would be appreciated!

"(LastTalkedToBy,1)" is not correct syntax. What are you trying to do? (I.e. what is it supposed to be?)

 

You should probably also have casting POOF_GONE as the last action, otherwise you'll probably find that the ActionOverride isn't executed.

 

Here's the purpose.

 

* The creature is summoned by use of a spell by the summoner (currently working, no issues here)

* After a short dialogue, the summoner is presented with a list of spell options to chose from (in this case I've only written one so far)

* After choosing the spell he wants to learn, the creature casts a spell (in this case rw#d4406) on the summoner.

* The spell being cast on the summoner has a Learn Spell effect, with the resource being rw#4406 (the spell I want the summoner to learn)

* The creature then disappears from the playing field.

 

Basically think Wish, but every choice will have a unique global variable which will tie to a unique Learn spell effect by the creature on the summoner, allowing the summoner to permanently learn the spell in question. There is no associated .2da file in this spell, as there is no table or random variable involved -- you are being spoken to by your patron deity, not a malevolent djinni, and he's here to bless you, not trick you.

 

To make the interface a little cleaner, what I'd really like to do is give the caster the option to first select what spell level he wants to learn from, then view a list of spells, with the option to go back to spell level menu at the end if he doesn't like any of the spells he is presented with.

 

Edit: I restructured the script as you suggested, removing the LastTalkedToBy,1 and setting POOF_GONE to the final action and I got the script to install and work properly! Now upon casting the ability, the creature is summoned, the dialogue takes place and the caster learns the spell. Now I just have to work on the dialogue tree and assign all the other possibilities!

 

Double Edit: Seems to be a minor issue of the effect playing twice on the summoner, causing them to learn the spell twice. They get the learning experience twice, and the visual effect/sound associated with the learning effect plays twice, though the spell only appears in the spellbook a single time. A minor issue that I'm not sure of the cause, but I thought I would mention it.

Link to comment
Double Edit: Seems to be a minor issue of the effect playing twice on the summoner, causing them to learn the spell twice. They get the learning experience twice, and the visual effect/sound associated with the learning effect plays twice, though the spell only appears in the spellbook a single time. A minor issue that I'm not sure of the cause, but I thought I would mention it.

It's possible that the script block is executing a second time before the poofing kicks in and the creature disappears. You might want to add an action to change the value of RWDIVINEFAVOR01 to a different value to ensure the block can only trigger once.

Link to comment
Double Edit: Seems to be a minor issue of the effect playing twice on the summoner, causing them to learn the spell twice. They get the learning experience twice, and the visual effect/sound associated with the learning effect plays twice, though the spell only appears in the spellbook a single time. A minor issue that I'm not sure of the cause, but I thought I would mention it.

It's possible that the script block is executing a second time before the poofing kicks in and the creature disappears. You might want to add an action to change the value of RWDIVINEFAVOR01 to a different value to ensure the block can only trigger once.

 

I found out that what was causing this issue was something I had written into the BCS file that I thought I needed to force the spell. cmorgan showed me a way to write the spellcasting line into the dialogue structure so I could remove the line in question from the bcs folder.

Link to comment

Archived

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

×
×
  • Create New...