Jump to content

Journal Entries for Dummies


Recommended Posts

At Domi's request I am reposting my advice on use of Journal entries. This is an issue I encountered before and after some suggestions by Cam and devSin, got sorted out.

 

Adding journal entries is nice and easy. You just slap it after the THEN (or optional DO) in a dialogue and use JOURNAL/SOLVED_JOURNAL/UNSOLVED_JOURNAL ~String~ where String is your journal entry. However, this only works for dialogues. If you want to add journal entries in a script you use AddJournalEntry(~String~,JOURTYPE) where JOURTYPE is either USER/QUEST/QUEST_DONE/INFO and it adds it the correct part. You can use AddJournalEntry() in dialogues but there's no reason to (and there's a trick to it similar to the one discussed below).

 

Erasing journal entries is done the same way in dialogues and scripts: using EraseJournalEntry(). This takes one argument and works as follows. EraseJournalEntry(~String~) will remove that String from QUEST, QUEST_DONE and INFO sections (not user, according to the IESDP as its stored somewhere else). However, when you are doing this in dialogue the obvious syntax would be:

 

DO ~EraseJournalEntry(~String~)~

 

This won't work as WeiDU will parse it like this:

 

DO ~EraseJournalEntry(~String~)~

 

It'll then throw a hissy fit on the first word of the string as it thinks its the end of the DO list. So what you instead do is this:

 

DO ~EraseJournalEntry(%String%)~

 

% is a valid string marker but not the usual one. However, because you are using a different one it can't mismatch the ~ with the % and it will be parsed correctly. If you are doing AddJournalEntry() in dialogues you just use the same trick.

 

Moving journal entries to done can be done two ways (apparently). Now the way the game does it is it erases all the journal entries for a quest and then adds a summary one for the whole quest in the DONE section. So thats fairly simple. Just a series of EraseJournalEntry()s and then add the journal entry to the DONE section. However, there is another action described in the IESDP as follows:

 

235 SetQuestDone(I:STRREF*)

Although untested, this probably does the same thing as EraseJournalEntry(), in that it removes the given STRREF from the QUEST section of the journal. Be careful, that's what SimDing0 says... he's a dodgy fellow.

 

I've never used this so I don't have any advise on it. I just stick to the first method.

Link to comment

Great summary Grim.

 

Just a few remarks:

- You made a typo at the beginning (UNSOLVE_JOURNAL should be UNSOLVED_JOURNAL)

- In case someone isn't familiar with it, all of these functions accept TRA references (@x) as parameters, e.g. SOLVED_JOURNAL @11, AddJournalEntry(@11, QUEST) or EraseJournalEntry(@115).

Link to comment

Fixed the typo. And yes you can use tra references, as can any string but it seems odd to mention it just for journal entries. I know I lot of people do use them only for journal entries but that'll be because they don't know about using %s, and assume you can't hardcode them.

 

Edit: Just noticed you've made a typo as well. It should be SOLVED_JOURNAL @11 in your example not SOLVED_JOURNAL(@11) as SOLVED_JOURNAL isn't a scripting action but a WeiDU action much like DO.

Link to comment

Sorry to bring this up again people but I've been trying to debug a mod and I'm banging my head aganist the wall (again). I've read what was posted here and in Seb's thread over at SHS but I'm still getting a No VALID Links or replies so here goes. Maybe one of the more experienced modders can explain why this doesn't work.

 

This snippet is part of an INTERJECT, == KIDOJ is the last line of the interject and then we'd like to segue into the JOURNAL entry. It compiles properly, we get all the dialog, but then I get the no VALID replies or links and no JOURNAL entry. So what am I doing wrong please? Do I have to put a tilde after the EscapeArea()) and then an END before we do the AddJournalEntry stuff? From the examples it didn't look like it and the code did compile -- it's just when we play we get the NO VALID LINKS

 

== KIDOJ ~We will go at once.~ DO ~ActionOverride("DCleric",EscapeArea())

AddJournalEntry(%Creating blah, blah, blah

 

More blah stuff%,QUEST)~

END

 

Thanks.

Link to comment

I think it depends on which way you're doing it. I was using the

 

AddJournalEntry(%Blah blah blah%,QUEST) way, because I couldn't get my head around the other way, which meant I had to use the EraseJournalEntry(%Blah blah blah%), I think, but my understanding of this is shaky at best.

Link to comment

Archived

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

×
×
  • Create New...