Jump to content


Journal Entries for Dummies


11 replies to this topic

#1 Grim Squeaker

    Utter Bastard

  • Gibberling Poobah
  • 3296 posts
  • Gender:Male
  • Location:Hovering around London

Posted 17 August 2005 - 07:43 AM

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:

Quote

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, 25 August 2005 - 12:08 PM.

"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."

#2 Domi

    Where is now your Troy, O Cassandra?

  • Gibberlings
  • 12287 posts
  • Location:Canada

Posted 17 August 2005 - 07:50 AM

Thank you, it's one of these little things that are so nice to have a recipy for :)
Faster. Faster. Faster would be better. -Mal Reynolds, Serenity
I understand that folks prefer code that works. -CamDawg, G3

#3 Baronius

    Robed Bandit

  • Members
  • 447 posts
  • Location:Hungary

Posted 25 August 2005 - 11:51 AM

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, 25 August 2005 - 02:08 PM.


#4 Grim Squeaker

    Utter Bastard

  • Gibberling Poobah
  • 3296 posts
  • Gender:Male
  • Location:Hovering around London

Posted 25 August 2005 - 12:09 PM

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, 25 August 2005 - 01:07 PM.

"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."

#5 Baronius

    Robed Bandit

  • Members
  • 447 posts
  • Location:Hungary

Posted 25 August 2005 - 02:09 PM

Quote

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

#6 Diana

  • Members
  • 123 posts
  • Location:New York City, USA

Posted 30 March 2006 - 05:08 PM

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.

#7 icelus

    Do you have a flag?

  • Modders
  • 1929 posts
  • Gender:Male
  • Location:Houston, Texas

Posted 30 March 2006 - 05:19 PM

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

#8 Grim Squeaker

    Utter Bastard

  • Gibberling Poobah
  • 3296 posts
  • Gender:Male
  • Location:Hovering around London

Posted 31 March 2006 - 01:14 AM

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.
"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."

#9 Diana

  • Members
  • 123 posts
  • Location:New York City, USA

Posted 31 March 2006 - 02:12 AM

Thanks guys - tried your suggestions and it worked perfectly!

#10 Bardess

    C is the deadliest weapon of all

  • Members
  • 143 posts
  • Gender:Female
  • Location:Serbia, Europe

Posted 15 February 2007 - 03:23 AM

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, 15 February 2007 - 05:56 AM.


#11 berelinde

    The Typo Queen

  • Gibberlings
  • 8591 posts
  • Location:New Jersey, USA

Posted 15 February 2007 - 03:33 AM

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, 15 February 2007 - 03:34 AM.

Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#12 Grim Squeaker

    Utter Bastard

  • Gibberling Poobah
  • 3296 posts
  • Gender:Male
  • Location:Hovering around London

Posted 15 February 2007 - 04:05 AM

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.
"Leave me be, I don't want to argue.
I just get confused and I come all undone.
If I agree, well it's just to appease you,
'Cause I don't remember what we're fighting for."




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users