Difference between revisions of "Research:Dialogue and Messages"

From OpenMW Wiki
Jump to navigation Jump to search
(Added Dialogue global variables.)
Line 123: Line 123:
Crime-related global script variables are set every time the player enters dialogue with an NPC:
Crime-related global script variables are set every time the player enters dialogue with an NPC:

Variables ''CrimeGoldDiscount, CrimeGoldTurnIn, PCHasCrimeGold, PCHasGoldDiscount, PCHasTurnIn'': see [[Research:Security and Crime#Thieves Guild reductions]]
if bounty == 0: CrimeGoldDiscount = 0
else: CrimeGoldDiscount = max(1, fCrimeGoldDiscountMult * bounty)
if bounty == 0: CrimeGoldTurnIn = 0
else: CrimeGoldTurnIn = max(1, fCrimeGoldTurnInMult * bounty)
PCHasCrimeGold = 1 if player can afford bounty (before any discount), 0 if not
PCHasGoldDiscount = 1 if player can afford bounty (with thief discount), 0 if not
PCHasTurnIn = 1 if player can afford bounty (with turn-in discount), 0 if not

Revision as of 15:26, 23 July 2014

Text defines

Text defines in Morrowind are special strings within dialogue and message boxes, that are replaced at run time.
For dialogue, they begin with %, and for message boxes, they start with ^.
Any character can follow a sequence, so if "%pcrace" is "Redguard", "%pcraces" is "Redguards".
% (or ^ in messageboxes) followed by any global variable will be replaced with the value of that variable.
All sequences are case insensitive.
Built in defines are evaluated before global variables, so if there is a global variable pcnamea = 50, "^pcnamea" will be the name of the character followed by a, not 50.
Global variables with a % or ^ in them do not behave sensibly (as might be expected).
Global variables with names that are partially contained in other global names (eg. testglobal and testglobala) work correctly (i.e "^testglobala" does not give the value of testglobal followed by a).

List of defines

actionactivate Button for activate
actionback Button for Back
actionforward Button for Forwards
actionjournal Button for open journal
actionreadyitem Button for draw weapon
actionreadymagic Button for ready Magic
actionrestmenu Button for rest
actionslideleft Button for left strafe
actionslideright button for right strafe
actionmenumode Button to open inventory
actionuse Button to use current (magic / weapon)
actioncrouch Button for crouch / sneak
actionrun button to run
actiontogglerun button to toggle running
actionjump button to jump
actionnextweapon button for next weapon
actionprevweapon button for previous weapon
actionnextspell button for next spell
actionprevspell button for previous spell
class speakers class (players in messagebox)
crimegoldturnin amount of gold needed to pay a guard when catched
name speakers name (players in messagebox)
pcclass players class
pccrimelevel players current bounty
pcname players name
pcrace players race (this one is strange, as there is a global (short) variable of the same name, but it gives a string when used)
race speakers race (players in messagebox)
cell The cell the player is currently in

The following only work in dialogue (empty in messageboxes):

faction speakers faction
nextpcrank players next rank in the speakers faction
pcnextrank probably the same as above
pcrank players rank in current faction
rank speakers rank in their faction

Dialogue global variables

Crime-related global script variables are set every time the player enters dialogue with an NPC:

Variables CrimeGoldDiscount, CrimeGoldTurnIn, PCHasCrimeGold, PCHasGoldDiscount, PCHasTurnIn: see Research:Security and Crime#Thieves Guild reductions