svj Posted November 12, 2023 Author Share Posted November 12, 2023 I had look at original game files and they do delete journal entries by specifying string reference number which i for obvious reasons i do not have. How do mods delete journal entries? Should i just add entries to user journal? and let users to delete entries? Quote Link to comment
jmerry Posted November 12, 2023 Share Posted November 12, 2023 25 minutes ago, svj said: ... by specifying string reference number which i for obvious reasons i do not have. So you get it. RESOLVE_STR_REF is a useful command for this; it puts your string in the TLK and returns the number for you to use. Quote Link to comment
Jarno Mikkola Posted November 13, 2023 Share Posted November 13, 2023 On 11/12/2023 at 5:11 PM, svj said: Should i just add entries to user journal? and let users to delete entries? The obvious answer is a: No. If you need to make journal entry, you make sure to delete it when it's no longer valid. Quote Link to comment
svj Posted November 14, 2023 Author Share Posted November 14, 2023 EraseJournalEntry(RESOLVE_STR_REF(Assasination Contract Marcian Argent. I have agreed to kill Marcian Argent for Dwarf Rugos Mithrest Inn. He is supposed to be somewhere in Graveyard District i should be expecting Marcian to be protected by at least two Priests, several Fighters and one Wizard.)) I have grepped my entire unpacked modding/games folder and nobody is using this function. How is this thing supposed to be used? Quote Link to comment
jmerry Posted November 14, 2023 Share Posted November 14, 2023 RESOLVE_STR_REF is a WeiDU command that goes in the tp2 file; look it up in the WeiDU documentation for the syntax. Your sample there absolutely won't work, because EraseJournalEntry is a script action that goes in a completely different place. So, here's a sample that does work: In the .tp2 file: SET journal1 = RESOLVE_STR_REF(@12345) // Assume @12345 is the desired journal entry. // More stuff. Probably unrelated. COMPILE EVALUATE_BUFFER ~mymod/quest.d~ // Compile the dialogue, evaluating variables. In the .D file: /* Stuff, including a response for this action to attach to */ DO AddJournalEntry(%journal1%) /* More stuff */ DO EraseJournalEntry(%journal1%) Or you can just use that same @12345 reference directly in both places instead of the variable; the system is smart enough to handle that properly. That's what the file I looked at did, anyway. Quote Link to comment
jastey Posted November 14, 2023 Share Posted November 14, 2023 For own journal entries, you just take the exact same text you used for adding it to the journal: EraseJournalEntry(~Text of the journal entry~) Or, if you work with tra files (which is recommended in this case, so the text is the exact same: EraseJournalEntry(@12345) The text need to match 100% with what the added journal entry was, or the journal entry will not be removed. The RESOLVE_STR_REF is for original game journal entries. There is also another way to fetch these: the func_fetch_journal_entries.tph fetches them from a dialogue state directly. It is used in the bg1re mod, for example. Quote Link to comment
svj Posted November 15, 2023 Author Share Posted November 15, 2023 (edited) IF ~~ THEN BEGIN Rugos1HaveHead SAY ~Show it to me...Hmm....appearance matches. Here is your gold, Talk to me when you are ready to take another contract, Farewell.~ IF ~~ THEN DO ~GiveGoldForce(12000) SetGlobal("rqcontractKamraarn","GLOBAL",1)~ SOLVED_JOURNAL ~Assassination Contract: Marcian Argent completed.~ EraseJournalEntry(~Assassination Contract Marcian Argent. I have agreed to kill Marcian Argent for Dwarf Rugos in Mithrest Inn. He is supposed to be somewhere in Graveyard District i should be expecting Marcian to be protected by at least two Priests, several Fighters and one Wizard.~) EXIT END This produces parse error you sure this is the right way to do it? Edited November 15, 2023 by svj Quote Link to comment
jmerry Posted November 15, 2023 Share Posted November 15, 2023 The parse error is because you have that EraseJournalEntry floating in the wrong place, rather than in the action block (DO ~~). That's where script actions go. When the system tries to parse this response, it sees an empty condition trigger, an action block, a SOLVED_JOURNAL entry, and then something which isn't a transition flag or a valid end to the response. Parse failed. In other words, to fix it, put the EraseJournalEntry into the action block where it belongs. Quote Link to comment
CamDawg Posted November 15, 2023 Share Posted November 15, 2023 EraseJournalEntry is a scripting action, so it properly needs to be inside the DO, e.g. IF ~~ THEN BEGIN Rugos1HaveHead SAY ~Show it to me...Hmm....appearance matches. Here is your gold, Talk to me when you are ready to take another contract, Farewell.~ IF ~~ THEN DO ~GiveGoldForce(12000) SetGlobal("rqcontractKamraarn","GLOBAL",1) EraseJournalEntry(~Assassination Contract Marcian Argent. I have agreed to kill Marcian Argent for Dwarf Rugos in Mithrest Inn. He is supposed to be somewhere in Graveyard District i should be expecting Marcian to be protected by at least two Priests, several Fighters and one Wizard.~)~ SOLVED_JOURNAL ~Assassination Contract: Marcian Argent completed.~ EXIT END Quote Link to comment
svj Posted November 15, 2023 Author Share Posted November 15, 2023 (edited) IF ~~ THEN BEGIN Rugos1HaveHead SAY ~Show it to me...Hmm....appearance matches. Here is your gold, Talk to me when you are ready to take another contract, Farewell.~ IF ~~ THEN DO ~GiveGoldForce(12000) SetGlobal("rqcontractKamraarn","GLOBAL",1) EraseJournalEntry(~Assassination Contract Marcian Argent. I have agreed to kill Marcian Argent for Dwarf Rugos in Mithrest Inn. He is supposed to be somewhere in Graveyard District i should be expecting Marcian to be protected by at least two Priests, several Fighters and one Wizard.~)~ SOLVED_JOURNAL ~Assassination Contract: Marcian Argent completed.~ EXIT END [action list near line 95, column 28 of revan/d/rqrugos.d] PARSE WARNING at line 97 column 1-26 Near Text: syntax error WARNING: cannot verify action ~GiveGoldForce(12000) SetGlobal("rqcontractKamraarn","GLOBAL",1) EraseJournalEntry(~: Parsing.Parse_error [revan/d/rqrugos.d] PARSE ERROR at line 95 column 1-40 Near Text: Assassination syntax error [revan/d/rqrugos.d] ERROR at line 95 column 1-40 Near Text: Assassination Parsing.Parse_error ERROR: parsing [revan/d/rqrugos.d]: Parsing.Parse_error ERROR: compiling [revan/d/rqrugos.d]! Stopping installation because of error. ERROR Installing [Golden Horse mercenary company (Requires Throne of Bhaal)], rolling back to previous state Will uninstall 29 files for [SETUP_REVAN.TP2] component 0. Uninstalled 29 files for [SETUP_REVAN.TP2] component 0. ERROR: Parsing.Parse_error No workey sir. Edited February 29 by svj corrected misleading mod name Quote Link to comment
jmerry Posted November 16, 2023 Share Posted November 16, 2023 Okay. Now the parse error is something different. Because you used ~ to delimit the beginning of the action block, the system expects ~ to delimit the end of the block. And it finds that tilde, immediately after the left parenthesis. Which makes that an incomplete action that doesn't make sense. That's why both ~ and " are accepted as string delimiters. Use one on the outside, use the other on the inside. If you're using ~ to delimit the action block, you need to use " to delimit the strings inside it. Such as "rqcontractKamraarn", or "GLOBAL", or that whole long journal string. Quote Link to comment
subtledoctor Posted November 16, 2023 Share Posted November 16, 2023 There are four delimiters in Weidu IIRC: ” … “ % … % ~ … ~ ~~~~~ … ~~~~~ And sometimes it is necessary to use all four together. I have not, thankfully, come upon a circumstance in which I needed five. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.