Jump to content

Does AddJournalEntry work with hardcoded strings?


Grim Squeaker

Recommended Posts

I know I had a similar problem a while back with hardcoded strings while setting someone's name, and was required to use a .tra workaround. I was wondering if the same was true here?

 

IF ~~ THEN BEGIN RemindAboutDawnmaster#1.2 //From RemindAboutDawnmaster#1.1.1

SAY ~Thank you <CHARNAME>.~

IF ~~ THEN DO ~SetGlobal("G#J.RemindAboutMeeting","GLOBAL",2)

AddJournalEntry(~Jelina has to visit the Temple of Lathander.

 

Jelina has asked that we visit the Temple of Lathander in the Bridge District.  She says that she must ask the permission of a Dawnmaster Avaron before she is allowed to travel with us.~,QUEST)~ EXIT

END

 

It's throwing a parse error on the highlighted word 'Jelina' saying it's a syntax error. I can't see that I've missed any tildes or anything.

 

Any thoughts?

Link to comment

After a little investigation, you can use AddJournalEntry() in a .d but the entry must be surrounded in quotes (") and not tildes (~).

i.e.

 

IF ~~ THEN BEGIN RemindAboutDawnmaster#1.2 //From RemindAboutDawnmaster#1.1.1

SAY ~Thank you <CHARNAME>.~

IF ~~ THEN DO ~SetGlobal("G#J.RemindAboutMeeting","GLOBAL",2)

AddJournalEntry("Jelina has to visit the Temple of Lathander.

 

Jelina has asked that we visit the Temple of Lathander in the Bridge District.  She says that she must ask the permission of a Dawnmaster Avaron before she is allowed to travel with us.",QUEST)~ EXIT

END

Link to comment

Ok, while AddJournalEntry("Blah") compiles it doesn't compile properly. Should only use JOURNAL commands instead.

 

Edit: However EraseJournalEntry("Blah") is compiling to EraseJournalEntry(0) <NO TEXT>. Unless Wes tweaks thing looks like I need a tra.

Link to comment

The original problem here is that you cannot use a string delimiter inside of a string delimited by that delimiter. DO ~Hey Now~ is good, DO ~Hey()*&&^$@Now~ is good, DO ~Hey~Kill("Nalia")~Now~ is invalid. So you'll need to pick another string delimiter for that particular DO (either double-quotes, five consecutive tildes, or %s).

 

Your last problem is because WeiDU will only nab dialog.tlk strings that aren't delimited by double-quotes inside scripts and dialogues (since double-quotes are a legitimate part of the scripting language, I guess it would make things more complex to have to evaluate when and where a double-quoted value was a TLK string and where it was a normal BAF or D element).

 

Try

IF ~~ THEN DO ~~~~~SetGlobal("G#J.RemindAboutMeeting","GLOBAL",2)
AddJournalEntry(~Jelina has to visit the Temple of Lathander.

Jelina has asked that we visit the Temple of Lathander in the Bridge District.  She says that she must ask the permission of a Dawnmaster Avaron before she is allowed to travel with us.~,QUEST)~~~~~

In general, you should be using the dialogue *JOURNAL flags, and TRB translation files, however. Once you get it all set up, it really does make things easier.

Link to comment

Archived

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

×
×
  • Create New...