Jump to content
Grim Squeaker

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.

Edited by Grim Squeaker

Share this post


Link to post

Thank you, it's one of these little things that are so nice to have a recipy for :)

Share this post


Link to post

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).

Edited by Baronius

Share this post


Link to post

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.

Edited by Grim Squeaker

Share this post


Link to post
It should be SOLVED_JOURNAL @11 in your example not SOLVED_JOURNAL(@11)

Haha! It is a general 'rule' that if you correct someone's spelling, you will probably make a new mistake in your post :)

Share this post


Link to post

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.

Share this post


Link to post

I think you're missing an EXIT or GOTO. I think...

Share this post


Link to post

Yeah, you have a CHAIN there and no actual transition at the end. So you want to make that END into END <FILENAME> # or EXIT or something, coz at the moment it doesn't know where to go.

Share this post


Link to post

When you want to erase a journal entry, do you have to type (paste) all of its text in the command? :p

Edited by Bardess

Share this post


Link to post

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.

Edited by berelinde

Share this post


Link to post

It's the same as any situation where you have strings. You can either have the string in full (which in this case means repeating it a lot) or if you've translated your mod, you just have .tra references.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...