Jump to content

Non-traified EraseJournalEntry() in dialogue files


Kulyok

Recommended Posts

Okay, I gotta ask. If your mod is not traified, how do you write EraseJournalEntry in your dialogue file so Weidu would swallow it?

 

I've got this:

 

 

IF ~~ v1.1

SAY ~SAY~

IF ~~ DO ~EraseJournalEntry(~The Final Battle with Bodhi.

 

Bodhi appeared in an ambush shortly before I reached her haven, warning me that she was aware of my pursuit and stealing from me the one person that is dearest to my heart. Before she vanished and unleashed more of her undead creations upon me, Bodhi warned me that if I continue I will lose even more than I thought possible. I cannot give up on the Rhynn Lanthorn... but now the life and immortal soul of the one I love is at stake, as well!~)~ EXIT

END

Doesn't compile at all. Same with AddJournalEntry. Only SOLVED_JOURNAL and UNSOLVED_JOURNAL work. The same EraseJournalEntry compiles in AR0809.bcs just fine:

 

IF

Dead("C6BODHI")

Global("var","GLOBAL",0)

THEN

RESPONSE #100

EraseJournalEntry(~The Final Battle with Bodhi.

 

Bodhi appeared in an ambush shortly before I reached her haven, warning me that she was aware of my pursuit and stealing from me the one person that is dearest to my heart. Before she vanished and unleashed more of her undead creations upon me, Bodhi warned me that if I continue I will lose even more than I thought possible. I cannot give up on the Rhynn Lanthorn... but now the life and immortal soul of the one I love is at stake, as well!~)

SetGlobal("var","GLOBAL",1)

END

 

but for some weird reason it doesn't recognize that it's the same entry as one in Bodhiamb(Hence, it doesn't delete anything).

 

CHAIN BODHIAMB Kidnap

~CHAIN~

END

IF ~~ DO ~ClearAllActions()

StartCutSceneMode()

StartCutScene("cutscene")~ UNSOLVED_JOURNAL ~The Final Battle with Bodhi.

 

Bodhi appeared in an ambush shortly before I reached her haven, warning me that she was aware of my pursuit and stealing from me the one person that is dearest to my heart. Before she vanished and unleashed more of her undead creations upon me, Bodhi warned me that if I continue I will lose even more than I thought possible. I cannot give up on the Rhynn Lanthorn... but now the life and immortal soul of the one I love is at stake, as well!~

EXIT

 

I tried decompiling AR0809.bcs and BODHIAMB.bcs to textually compare entries, but I can't, because for some reason AR0809.bcs eats all the line breaks during decompiling.

 

Anyway, sigh, and I don't know what the problem is. Traifying would work, and I know it, but I'm specifically writing non-traified code for the new modders(it's a tutorial NPC of sorts).

Link to comment

Try

~EraseJournalEntry(%The Final Battle with Bodhi.

 

Bodhi appeared in an ambush shortly before I reached her haven, warning me that she was aware of my pursuit and stealing from me the one person that is dearest to my heart. Before she vanished and unleashed more of her undead creations upon me, Bodhi warned me that if I continue I will lose even more than I thought possible. I cannot give up on the Rhynn Lanthorn... but now the life and immortal soul of the one I love is at stake, as well!%)~

 

~ looks for ~ as a termination, so ~EraseJournalEntry(~ is what it tries to parse.

 

WeiDU accepts % as an equal-but-separate substitute for ~

 

In A_J_E et al, it handles it because it is finding the content between the tildes; in the other cases, it is not able to figure out termination.

Link to comment

Thank you!

 

I've tested it in the game, and

- the mod compiled;

- the code worked:

 

F ~~ v1.1

SAY ~SAY~

IF ~~ DO ~EraseJournalEntry(%The Final Battle with Bodhi.

 

Bodhi appeared in an ambush shortly before I reached her haven, warning me that she was aware of my pursuit and stealing from me the one person that is dearest to my heart. Before she vanished and unleashed more of her undead creations upon me, Bodhi warned me that if I continue I will lose even more than I thought possible. I cannot give up on the Rhynn Lanthorn... but now the life and immortal soul of the one I love is at stake, as well!%)~ EXIT

END

 

 

I'm not sure about why the script didn't work, but since I can get the entry erased in the dialogue file, the script's not that important - I erased it. And, yep, I copy-pasted everything.

 

Thanks again - it's a neat trick, and I'm relieved I can get this annoying thingy to work.

Link to comment

I'm not sure about why the script didn't work, but since I can get the entry erased in the dialogue file, the script's not that important - I erased it. And, yep, I copy-pasted everything.

When WeiDU hits the tilde that starts your journal entry text, it thinks it's actually the closing tilde for the DO action. That's why cmorgan's substitution of a different delimiter works--it lets WeiDU know you're now starting a new thing instead of closing the current.

 

WeiDU will accept ~, ", %, and 5x those (i.e. ~~~~~) as delimiters IIRC.

Link to comment

Just wanted to thank for this thread - i ran into the exactly same problem today when scripting/writing the Bodhi encounter. Since i don't use traified files/structure for the Liella mod, i couldn't figure out why it wouldn't accept my input.

 

Thanks again - this was really helpful. Now the code compiles AND seems to work :).

Link to comment

Bit of a correction - works in Bg2classic but does not in Bg2EE. Is there any example for how to use the BG2EE journal syntax without tra-files?

 

ADD_JOURNAL @1 @2 @3 USING ~mymod/tra/%LANGUAGE%/x.tra~

 

That being the apparent working syntax for tra-files.

Link to comment

Archived

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

×
×
  • Create New...