Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

How to add Journal entries

Page: 1 of 1
 Darth333
01-24-2005, 6:48 PM
#1
You'll need to edit two files:
A) The *.dlg file(s) to which you want to attach the journal entries or use a script if you want the journal entry to be added from an event other than a dialogue (example death of a creature)

B)the journal file located in BIFs>_newbif>journalFile>global.jrl

editing the global.jrl file

* you can edit this file with a GFF editor * ( we recommend tk102's K-GFF (http://www.starwarsknights.com/tools.php) - see instructions in the second post below (http://www.lucasforums.com/showthread.php?p=2133929#post2133929))

When you open it, you will see a list below "Categories".

Here is an explanation of each field you'll find:

Comment: what you type here does not have any effect on the game. Type whatever comments you want to rememebr what you are doing or leave it blank.

EntryList: this field contains the description for the quest itself. It is divided as follows:

-> End: Set it to 0 as long as the quest is active so that it appears in the game's "Active Quests". When the quest is completed, set it to 1 to remove it from the Active Quests and put it in the Completed Quests.

-> ID: This field field refers to the advancement of the plot (10, 20, 25, 35, 40, etc.). Each number corresponds to a journal entry. Refrence the number in your .dlg QuestEntry field to change the Journal Text.(you can use whatever numbers you want i.e. you could use 1, 2, 3, 4, etc.)

-> Text: This is the text you want for a particular stage in the quest.It will apeear in your journal in game.

->XP_Percentage: this is a multiplicator for the amount of XP you type in the PlotXPPercentage field of your .dlg file.

Name: this is the name of the quest that will appear in your in game journal.

- in the STRREF box, type -1 to enter custom text (it means that you do not refer to any entry in the .tlk file).
- in the Language ID box, type 0 for English, 1 for French, 2 for German, 3 for Italian, 4 for Spanish 5 for Polish.

PlanetID: This is when the quest is related to a specific planet only. Put one of the following numbers:


Kotor 1:
PLANET_ENDAR_SPIRE = 0;
PLANET_TARIS = 1;
PLANET_EBON_HAWK = 2;
PLANET_DANTOOINE = 3;
PLANET_TATOOINE = 4;
PLANET_KASHYYYK = 5;
PLANET_MANAAN = 6;
PLANET_KORRIBAN = 7;
PLANET_LEVIATHAN = 8;
PLANET_UNKNOWN_WORLD = 9;
PLANET_STAR_FORGE = 10;
PLANET_LIVE_01 = 11; (Yavin Station)

Kotor 2:
int PLANET_DANTOOINE = 0;
int PLANET_DXUN = 1;
int PLANET_EBON_HAWK = 2;
int PLANET_KORRIBAN = 3;
int PLANET_M4_78 = 4;
int PLANET_MALACHOR_V = 5;
int PLANET_NAR_SHADDAA = 6;
int PLANET_ONDERON = 7;
int PLANET_PERAGUS = 8;
int PLANET_TELOS = 9;
int PLANET_HARBINGER = 10;
int PLANET_LIVE_01 = 11;//The 'live' planets are just space fillers
int PLANET_LIVE_02 = 12;
int PLANET_LIVE_03 = 13;
int PLANET_LIVE_04 = 14;
int PLANET_LIVE_05 = 15;
int PLANET_LIVE_06 = 16;

If the quest is not linked to a specific planet, then type -1

PlotIndex: not too sure what the numbers refer to here. I made journal entries in one of my mods but did not used this field :confused: (if someone figures out, pls PM me so I can add it to this tutorial)
Priority: The priority of the quest in the in game Journal (order in which it will appear).

0 = Highest
1 = High
2 = Medium
3 = Low
4 = Lowest


Tag = the refrence text to be referred to in your .dlg file Quest field or in your scripts.
There should not be more than one Journal Category with the same Tag. The tag is an Identifier for the Quest. Per example kor35_findingdustil for the Dustil Quest.


editing the DLG file

In the DLG file, in the Reply list, there is a filed called "Quest": in this field you type the reference to the quest, in other words, what you wrote in the Tag field in global.jrl (in the above example, it was "kor35_findingdustil"). Then, in QuestEntry you mark the value that refers to the plot advancement (10, 20, 25, 30 ,40, etc. - what you typed in the ID field in the jrl file ) to keep track of it.


Adding a journal entry using a script

You can also add a journal entry by using a script instead of attaching it to a .dlg file. This method can be practical when you want, per example, add a journal entry when a certain npc dies or when you get a certain item from a container (Using the OnDeath event or or the OnOpen event).

The syntax is as follows:
AddJournalQuestEntry (string szPlotID, int nState);
and an example would be:

void main()
{
AddJournalQuestEntry("my_quest",40);
}

Giving XP points for the plot

If you want to give xp to your party, then attach a script similar to this one in the script field of the dlg file:


void main()
{
GivePlotXP("kor35_findingdustil",35);
}

(note: the 35 value gives 350 XP)

or type the amount of xp you want in the PlotXPPercentage field of the .dlg filed. Scripts are quite useful if you want the XP to be given to you upon defeating a specific npc in battle, per example.



Keeping track of your plot with Globals
Now, if you want the game to remember plot adavancement, you will have to set Globals. Here is a sample script:

{
SetGlobalNumber("MY_PLOT", 7);
}


and edit globalcat.2da by adding a line for your plot.
 tk102
05-15-2006, 1:36 PM
#2
Local strings in K-GFF don't work for the descriptions of a quest. I don't understand why...

K-GFF makes editing the journal pretty easy, IMO. After opening the global.jrl file in K-GFF, turn on TLK file dereferencing(Tools: Use TLK file for StringRefs or Ctrl-T) so you can see everything that's already there. To make a new journal entry, I suggest copying an existing Struct from the Categories list and pasting it back into the Categories List. Then in EntryList, Text fields, change the StringRef from ##### to -1.

Now here's the trick. Right click on the Text field in the Treeview and select Add String. This will create a local string that you can edit.

http://img.photobucket.com/albums/v170/tk102/c21ae923.jpg)

http://img.photobucket.com/albums/v170/tk102/054635e4.jpg)

http://img.photobucket.com/albums/v170/tk102/f18b2054.jpg)
(don't worry about the Type field when editing a local string... it means nothing. )
Page: 1 of 1