You are here

Journal Entry length? ANSWERED

7 posts / 0 new
Last post
Mannast
Mannast's picture
Journal Entry length? ANSWERED

How long can a journal entry string become?  I use Custom Tokens on certain journal entries and am worried they may get too long eventually.

Portable Hole System, Scry and Teleport System, Throwing Objects, Prodding Traps, Portable Placeables and a Vanilla Basemodule, among other things

  • up
    50%
  • down
    50%
Proleric
Proleric's picture

Bioware's GFF standard for strings says

"The suggested maximum allowed length is 1024 characters, which is a limit defined primarily to conserve network bandwidth in the case of strings that need to be passed from server to game client."

...but that might not be a hard limit in this case.

Bear in mind that the string stored in the journal will only contain the unexpanded custom tokens, so it will be relatively short.

In practice, expanded journal entries can be very long - see the real example I give in the Custom Token tutorial on the Lexicon.

The online Lexicon seems to be unavailable tonight - if that persists, there is a slighly out of date version here:

https://neverwintervault.org/project/nwn1/script/nwn-lexicon-169

NWN and DAO adventures at http://proleric.com/

  • up
    100%
  • down
    0%
Mannast
Mannast's picture

I think it was reading your tutorial that got me to work on this script.  What my script does:  It is given a string of information and a journal stage: looks for a stored campaign string for that journal entry, takes whatever was stored, adds it to the new string and stores the new string in the database.  It also removes the journal entry and rebakes it with the new string.  It creates a building entry with old information and whatever was newly added to it - basically a Journal you can read the old entries in.  I guess I just need to create some kind of repeating system and see how long the entry can get.  If 1024 is hard coded, well... we shall see. 

  • up
    50%
  • down
    50%
Mannast
Mannast's picture

Here is the script in question - I use Persistent Quests and Journals, so that is the include file:
#include "pqj_inc"
void JournalText(object oPC, string sG, string sJournalTag = "", int nToken = 0, int nAdvance = 0, int nFront = 0)
{//Lets make the Custom Token "123456"
string sText;
object oMod = GetModule();
string sDatabase = GetLocalString(oMod, "IPIDatabase");
if(sJournalTag=="") sJournalTag = "Gossip";//defaults to "Gossip" Journal Entry
if(nToken==0) nToken = 123456;//Defaults to <CUSTOM123456>, which is used in the "Gossip" Journal
string sOldText = GetCampaignString(sDatabase, sJournalTag, oPC);
if(sOldText == "") sText = sG;
else
{
if(nFront==1) sText = sG+" "+sOldText;
else sText = sOldText+" "+sG;//we take the string given and add it to what has been stored already
}
if(nAdvance==0) RemovePersistentJournalQuestEntry(sJournalTag, oPC, TRUE, FALSE);//we clear what was already stored
SetCustomToken(nToken, sText);//The journal will use this token to bake the entry
AddPersistentJournalQuestEntry(sJournalTag,1,oPC,TRUE,FALSE,FALSE);//and we add the entry with the new text
SetCampaignString(sDatabase,sJournalTag,sText,oPC);
}

  • up
    50%
  • down
    50%
meaglyn
meaglyn's picture

I'm sure the 1024 is not hard coded. I've lots of GFF strings that are longer than that.   The description of the spellbook with all the components is 7k, for example.  I'm not sure that's the longest one.  The GFF spec does not actually specify a size limit.   In practice you may hit something eventually but it may be just a matter of memory usage rather than an actual set maximum. 

  • up
    100%
  • down
    0%
QuenGalad

Just to chime in with a side note, the lexicon has been unavailable constantly for the last month as of writing this post. (11.08.2017)

  • up
    50%
  • down
    50%
meaglyn
meaglyn's picture

Stuff on the web is great until it isn't.  You should always have the offline copy around.  It's not that out of date. Most of the stuff has not changed in however many years...

  • up
    100%
  • down
    0%