Skip to content

Parley Script Parameters

LordOfMyatar edited this page May 24, 2026 · 6 revisions

Script parameters

Parameter system for NWScript condition and action scripts.


Table of Contents


Overview

NWN dialog scripts often use parameters stored in ConditionParams (for conditions) or ActionParams (for actions). These key-value pairs control script behavior.

Parley provides:

  • Parameter Browser — pick keys and values visually
  • Parameter caching — remembers used values (MRU order)
  • Script declarations — scripts can declare valid keys and values in comments
  • Dynamic values — pulls quest data from the module journal

Parameter Browser

Open through [...] next to condition or action parameter fields in the Properties Panel.

Features

  • Keys list — available parameter keys
  • Values list — valid values for the selected key
  • MRU order — most recently used values appear first
  • Merged sources — combines script declarations with cached values
  • Double-click — selects and closes in one action

Usage

  1. Select a node with a condition or action script.
  2. Click [...] next to the parameters.
  3. Pick a key from the left list.
  4. Pick a value from the right list.
  5. Click Select or double-click the value.

Parameter caching

Parley remembers values you've used.

How it works

  • Storage~/Parley/parameter_cache.json
  • Per-script — each script keeps its own cache
  • MRU order — most recently used values first
  • Auto-save — values save on use
  • Limits — 10 values per parameter, 1000 scripts max

Cache settings

In the Parameter Browser window:

  • Enable Caching — toggles caching
  • Clear Cache — removes cached values for the current script

Benefits

  • No need to memorize exact parameter values
  • Faster entry for repetitive work
  • Values persist across sessions

Script declarations

Script authors can declare valid parameters in NWScript comments.

KeyList format

Declare valid parameter keys:

/*
----KeyList----
sQuest
iNPCState
bShowOption
----
*/

ValueList format

Declare valid values for a specific key:

/*
----ValueList-sQuest----
q_main_story
q_side_merchant
q_guild_initiation
----
*/

Legacy format

Single ValueList for scripts with one parameter:

/*
----ValueList----
VALUE_A
VALUE_B
VALUE_C
----
*/

Complete example

/*
    Script: gc_quest_check
    Purpose: Check quest state for dialog conditions

    ----KeyList----
    sQuest
    iState
    ----

    ----ValueList-sQuest----
    q_main
    q_merchant
    q_guild
    ----

    ----ValueList-iState----
    0
    1
    2
    10
    100
    ----
*/
int StartingConditional()
{
    string sQuest = GetScriptParam("sQuest");
    int iState = StringToInt(GetScriptParam("iState"));
    // ... implementation
}

Dynamic values

Parameters can pull values from game data dynamically.

FROM_JOURNAL_TAGS

Populates values with quest tags from the journal cache:

/*
----ValueList-sQuest----
FROM_JOURNAL_TAGS
----
*/

Shows all quest tags from the module's journal file.

FROM_JOURNAL_ENTRIES

Populates values with entry IDs, filtered by selected quest:

/*
----ValueList-iState----
FROM_JOURNAL_ENTRIES(sQuest)
----
*/

When the user picks a quest in sQuest, iState updates to show only entry IDs for that quest.

Requirements

Dynamic values require the journal cache to be populated:

  1. Open any dialog from the module.
  2. Parley reads the module's .jrl file.
  3. Quest tags and entries cache to ~/Parley/journal_cache.json.

Cache file format

{
  "Scripts": {
    "gc_quest_check": {
      "Parameters": {
        "sQuest": {
          "Values": ["q_main", "q_merchant"]
        },
        "iState": {
          "Values": ["100", "10", "1"]
        }
      },
      "LastUsed": "2025-12-15T10:30:00Z"
    }
  }
}

See also


Home | Index


Page freshness: 2026-05-24


Parley

Getting Started

User Guide

Features

Help


Manifest


Quartermaster


Relique


Reliquary


Fence

  • Fence - Merchant/Store Editor

Trebuchet


Shared Features


Developers

Parley Internals

Manifest Internals

Quartermaster Internals

Relique Internals

Reliquary Internals

Fence Internals

Marlinspike (Search Engine)

Trebuchet Internals

Radoub.UI


Radoub.Formats

Library

Low-Level Formats

High-Level Parsers


Legacy Bioware Docs

Original BioWare Aurora Engine file format specifications.

Core Formats

Object Blueprints

Module/Area Files

Reference


Page freshness: 2026-05-24

Index

Clone this wiki locally