Page 1 of 1

Scripting question

PostPosted: Wed Mar 06, 2019 4:45 pm
by fabgrass
Hi,

as old strong nwn scripter I m eager to see the toolset and it s scripting possibilities;
could you salamander allready publish documentation and / or examples of the script language?
is it C, or python, lua.. or a personal build? compiled or not? is there an equivalent of the heartbeat event of nwn?
is it possible to use / store global or any object attached variables? what are possible var types, and combinations (formulas, etc) ?
and to make conditions / loops / conditional loops

Then a lot of questions; all about a scripting language in fact.
If there is a doc. and if it can be published then thanks!..

Re: Scripting question

PostPosted: Mon Mar 11, 2019 6:12 am
by BlueSalamander
Hiya fabgrass and welcome,

As an example, here's one of the most important script commands:
"Add dialog answer [text] with text colour [colour choice] and set the answer as [Selectable / Non-Selectable / Non-Selectable if the required skill is not available to the party or gold is insufficient / Non-Selectable if party lacks the skill or Skip display if answer was selected before / Skip display if the required skill is not available to the party or gold is insufficient / Skip display if answer was selected before] requiring the party skill [party skill or requirement type] or gold [gold amount] or item(s) [item list] or companion [character name] or variable [variable name] equal/above/below [variable value] or achievement [achievement name] or quest [quest name] and save the skilled character's name into the variable [variable name] and save the selected status of this answer into the variable [variable name]"

When you create your dialogue script, you select that command in the command list displayed in the script editor, then cilck add command or insert command. Then you fill up the fields in the box that appears. Most fields can be left empty.

The standard colours are Blue for Non-Skill answers, Dark Green for Skill answers and Purple for Non-Selectable answers. You can click the {RIDDLE} button to allow the player to type in an answer. You can combine a skill requirement with a gold requirement and an item requirement.

It's the game's own script language. It's uncompiled. There's no heartbeat event; that event seems more appropriate for a game with real-time combat.

Yes, you can use and store variables. There are no script objects. Variables are all saved as strings which contain either text or a number.

If you need a loop, you just use a pair of commands: "Create Label" and "Goto Label".