Text Appears When... Journal Entry

Hi y’all.

I want an specific text to appear when a the PC have an specific Journal Entry.

¿How can I do it?

Thanks in advance

GetLocalInt(oPC, "NW_JOURNAL_ENTRY" + sQuestTag) 

returns the current journal entry number for the quest with tag sQuestTag.

Could you please put an example?
Im new in scripting, never did it before

When you set up a quest journal entry, it has an entry number in the editor. That line of code will return that number for the requested journal quest tag

So “NW_JOURNAL_ENTRY” it’s the journal’s name or the journal’s tag?

Try replacing sQuestTag with your quest tag between “”

If you haven’t already, read the Toolset Manual to discover how to add a conditional script to a conversation line (and scripting tutorials that cover conditionals).

Your script will look something like this:

int StartingConditional()
  {
    object oPC           = GetPCSpeaker();
    string sQuestTag     = "jt_myquesttag";

    if (GetLocalInt(oPC, "NW_JOURNAL_ENTRY" + sQuestTag) == 5)
      return TRUE;
    
    return FALSE:  
  }

This will only be true if the quest with tag jt_myquesttag has reached journal number 5.

P.S. To understand what is going on here, open a saved game in which the PC has done some quests. In DebugMode, dm_dumplocals on the PC. You will see that the quest progress is recorded as local integers on the PC, named NW_JOURNAL_ENTRY followed by the journal tag.

For reasons unknown, NWScript has an AddJournalQuestEntry function, but no GetJournalQuestEntry function, hence the need to interrogate the local variables.

Once you’ve leared about functions and includes, you can write your own - saves time in the long run:

int GetJournalQuestEntry(object oPC, string sJournal) {return GetLocalInt(oPC, "NW_JOURNAL_ENTRY" + sJournal);}
1 Like

So, for now I have this:

int StartingConditional()
  {
    object oPC           = GetPCSpeaker();
    string sQuestTag     = "TheOffer";

    if (GetLocalInt(oPC, "NW_JOURNAL_ENTRYTheOffer" + sQuestTag) == 1)
      return TRUE;

    return FALSE;
  }

But I doesn’t work, idk what I’m doing wrong.
theoffer

This NW_JOURNAL_ENTRYTheOffer should be NW_JOURNAL_ENTRY… The quest tag is already being declared before and added to the string by + sQuestTag

Something like this?

int StartingConditional()
  {
    object oPC           = GetPCSpeaker();
    string sQuestTag     = "TheOffer";

    if (GetLocalInt(oPC, "NW_JOURNAL_ENTRY..." + sQuestTag) == 1)
      return TRUE;

    return FALSE;
  }

Because it doesn’t work :confused:

1 Like

Without the dots mate

still not working with this code with this code:

int StartingConditional()
  {
    object oPC           = GetPCSpeaker();
    string sQuestTag     = "TheOffer";

    if (GetLocalInt(oPC, "NW_JOURNAL_ENTRY" + sQuestTag) == 1)
      return TRUE;

    return FALSE;
  }

What’s the actual estate of the quest when you get to the npc who has this conversación?

when you don’t talk to the NPC you don’t have any journal entry, once you talk for the first time you get the journal entry on it’s first estate (1)

Try changing the Conditional script to this. I added a debug line to see what value is retrieved.

int StartingConditional()
{
	object oPC 		= GetPCSpeaker();
	string sQuestTag 	= "TheOffer";
	int iQuestState		= GetLocalInt (oPC, "NW_JOURNAL_ENTRY" + sQuestTag);
	
	//DEBUG
	FloatingTextStringOnCreature(IntToString(iQuestState), oPC, FALSE);

	if (iQuestState == 1) return TRUE;
		return FALSE;
}

Nope… Still not working…

I’ve just noticed something.
In the conversation editor the branch that checks for the conditional should be moved one level upward.

branch to show when quest is at level 1 (here you check for the condition)

bla bla bla

branch to show when quest is at level 0 (it shows if all else fails)

bla bla

As far as I can see you have set those in reversed position. Basically it will check if level 1 conditions are met. If not, it will show level 0 option.

Please tell me if that helped.

B.

1 Like

YES IT WORKED, THANK YOU SO MUCH!!!

Is there any way I can award you with rep or something like that in the forum?

the number shows you the current quest state when you talk to the npc (that’s what the DEBUG line does)

If you have set things up right, at the end of the first time you talk to the npc I understand you should set the quest state to 1, so the second time you speak to it, it will speak the other line of dialog and show (1) over your head.

Just keep going on… by the way, veo que tenes el juego en español. Quizas hubiese sido mas facil en nuestro idioma.