Skip to content
Carmina16 edited this page Apr 1, 2018 · 6 revisions

Dialog variables

%a    Active quest reward
%adj  NPC name adjective (same structure as the prefix)
%adn  ???
%adv  NPC name adverb (same structure as the prefix)
%amn  ???
%an   ???
%at   Active quest dungeon type (Mine, Cavern, Labyrinth,...)
%art  current artifact name
%apr  artifact province name
%arc  ???
%ba   Active quest bonus reward (unused)
%ccs  current MQ city
%ccl  current MQ dungeon
%cn   if outside, current province name; otherwise, the current city name
%cn2  the nearest settlement name (same city type as the current)
%cp   current MQ province
%ct   current city type
%da   Active quest deadline date (short format)
%de   Active quest deadline, in days
%des  NPC description (same structure as the prefix)
%di   direction to dlgPoint
%dit  ???
%doc  ???
%ds   Active quest giver description (see below)
%du   ???
%dnl  first word of %nc value
%ef   ???
%en   ???
%fq   active quest giver's first name (female if not quest giver seed & 3)
%fn   ???
%g    he/she/it depending on dlgGender
%g2   him/her/it depending on dlgGender
%g3   his/her/its depending on dlgGender
%hp   ???
%hc   player's home city
%hod  nearest holiday string: random normalized #169+holidayId
%jok  joke: random normalized #363
%lp   current province
%mi   item name for the active noble quest
%mn   monster name for the active quest
%mpr  province where the artifact map is
%mqt  ???
%mt   monster for the active quest ("Troll" etc.)
%n    ???
%nap  artifact price
%nc   a local name for the active quest
%ncl  ???
%ne   a local name for the active quest
%nh   nearest holiday name
%nhd  nearest holiday date, without the year
%non  empty string
%nr   (same as %ne)
%nt   ???
%o    a rival faction name for the active quest, or "%qf"
%oap  ???
%oc   ???
%omq  quest item for the active quest (depends on the destination)
%opp  ???
%oth  oath: random line from oaths[prov]. prov is the current province or random if imp. city
%pcn  PC full name. Sets dlgGender
%pcf  PC first name. Sets dlgGender
%pre  NPC name prefix (from a special data structure)
%qc   city where the active quest was taken
%qt   description of the active quest type ("deliver something" etc.)
%qf   title+first name for the opponent in the active quest
%qmn  ???
%r    relation type for the active quest ("daughter" etc.)
%ra   PC race
%rcn  random city-state name in the current province
%rf   ruler first name, or "Uriel Septim" if Imp. city
%rpn  random province name
%sn   ???
%st   "war/peace" based on algorithm
%suf  NPC name suffix (same structure as the prefix)
%t    ruler title
%tan  $dlgDungeonName
%tc   target city name for the active quest
%tem  ???
%tg   target faction name for the active quest
%ti   (same as %du)
%tl   target venue name for the active quest, or "%dnl"
%tq   quest giver title for the active quest
%tt   class of the npc for the active quest

Random string is a random &-delimited piece of the dialog string with the given id. Normalized means that all whitespace (including line breaks) is collapsed to single spaces.

TODO: document algorithms and npc/quest variables

War/Peace

loc <- currentCity.quarter
seed1 <- currentCity.seed
seed2 <- (seed1 & 0xFF) + (weather[loc] & 7)
seed <- (seed1 & 0xFFFFFF00) | (seed2 & 0xFF)
srand(seed)
return state[rnd() & 1]

Those strings are stored in szlist @3D63C.

Descriptions

Description strings for NPCs are stored in the following structure:

BYTE x, y;
szlist strings;

The strings array has x + 2y elements. The first x elements are gender-neutral, followed by y male and y female strings.

TEMPLATE.DAT variants

Strings 0 to 4 and 14 in TEMPLATE.DAT have several variants and stored several times.

To get the corresponding letter:

id <- 0
if 6 <= gameHour <= 18 then
   w <- 0
   if <overcast or raining> then w <- 1
   if <snow overcast or snowing> then w <- 2
   if <raining or snowing> then w <- w + 4
   id <- w + getSeason() * 8
   letter <- dayLetters[id]
else
   letter <- nightLetters[getSeason()]
endif

dayLetters is a 32-byte array @4108A nightLetters is a 4-byte array @46211

Clone this wiki locally