Storyline, Quests, Ideas, Dialogs -manager
SearchWiki:

Project navigation

Documents

ToDo

Old stuff

PmWiki

Recent Changes Printable View Page History Edit Page

Main.WritingDialogs History

Hide minor edits - Show changes to markup

January 09, 2009, at 01:43 PM by ahuillet --
Changed line 34 from:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also referred to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
to:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also referred to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (e.g. it can also be run automatically via FirstTime).
Changed line 41 from:
The Nr=number is a file unique ID for the node and the value is between 0-99. It's a very bad idea to use the exact string Nr= anywhere else in the dialog file other than to define the start a node.\\
to:
The Nr=number is a file unique ID for the node and the value is between 0-99. It's a very bad idea to use the exact string Nr= anywhere else in the dialog file other than to define a node.\\
Changed lines 45-46 from:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux says but remove it if Tux is not actually saying anything (e.g. in case the NPC starts to talk first).
to:
This field corresponds to what Tux is going to say when the node is run. The _ is a gettext marker for "this should be translated". Use it if the text in the field corresponds to something that Tux is actually saying, if this is a placeholder string do not place a _. (See below for placeholder strings.)
Changed line 48 from:
The field OptionSample is used to indicate what sound file is associated to the text. It is optional, and can take a special value "NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
to:
The field OptionSample is used to indicate what sound file is associated to the text. It is optional, and can take a special value "NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER". This value means that the text in the Text field will not appear on screen and be skipped completely. In this case the Text field ought to contain a little place holder string like for example "THIS WILL NOT EVER BE VISIBLE" so bugs are easier to spot.
Added line 51:
The field NPC can be present anywhere between 1 and +infinite times. It corresponds to one reply given by the NPC : two fields will deliver the two lines one after another (with a delay between them).
Changed lines 54-57 from:
LuaCode?={
to:

The field LuaCode={ (yes, the curly brace has to be right next to the equal sign) contains a piece of Lua code that will be executed whenever this option is run. It can jump to another option, end the dialog, show or hide options, run subdialogs, and basically do anything that API allows.
Changed line 61 from:
The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.
to:
The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.
January 09, 2009, at 12:30 PM by ahuillet --
Changed line 11 from:

Implementing the dialog

to:

Implementing the dialog

Changed line 19 from:
Then the file map/ReturnOfTux.droids needs to be set to have DialogSectionToUse="NameOfCharacter". Do note that the .dialog fileending should not be added here.
to:
Then the file map/ReturnOfTux.droids needs to be set to have DialogSectionToUse="NameOfCharacter". Do note that the .dialog extension should not be added here.
Changed lines 21-24 from:

The format of the .dialog file

Top level

FirstTime LuaCode

At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. It's most common use is to set which dialog options should be shown, show(), but there are no arbitrary limitations so it can be used for much more advanced things as well.
to:

Top level

FirstTime LuaCode

At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. Its intended use is to properly set which dialog options should be shown the first time, since they are all disable by default. Use show() for this. Calling anything else than show() is likely to be a mistake of yours, check out AtStartup below.
Changed line 26 from:

AtStartup LuaCode

to:

AtStartup LuaCode

Changed lines 29-30 from:
There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??
to:
The block AtStartup LuaCode={ } is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can be useful to check whether a quest has been accomplished, or for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. There are no arbitrary limitations so you can do anything you wish.
Changed lines 32-34 from:

Dialog nodes aka options

to:

Nodes

Intro

A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also referred to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
Changed line 36 from:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also refered to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).

Available fields

to:

Available fields

Deleted line 43:
Arthur, can Text="" be left empty yet?

Changed line 45 from:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux sais but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).
to:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux says but remove it if Tux is not actually saying anything (e.g. in case the NPC starts to talk first).
Changed line 47 from:
The 2nd line is optional and currently only used for when the NPC talks first, in which case it needs to be exactly
OptionSample="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
to:
The field OptionSample is used to indicate what sound file is associated to the text. It is optional, and can take a special value "NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
Changed line 56 from:

XXXXXXXX

The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.

to:
The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.
January 09, 2009, at 11:43 AM by Stedevil -- Expending the Dialogtutorial
Changed lines 11-24 from:

Top level

FirstTime LuaCode

At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. Its intended use is to properly set which dialog options should be shown the first time, since they are all disable by default. Use show() for this. Calling anything else than show() is likely to be a mistake of yours, check out AtStartup below.
to:

Implementing the dialog

The name of the file should be
NameOfCharacter.dialog
or, in case of a subdialog,
subdlg_NameOfCharacter_OptionalPart.dialog
and placed in the dialogs/ folder.

Then the file map/ReturnOfTux.droids needs to be set to have DialogSectionToUse="NameOfCharacter". Do note that the .dialog fileending should not be added here.

The format of the .dialog file

Top level

FirstTime LuaCode

At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. It's most common use is to set which dialog options should be shown, show(), but there are no arbitrary limitations so it can be used for much more advanced things as well.
Changed line 26 from:

AtStartup LuaCode

to:

AtStartup LuaCode

Changed lines 29-31 from:
The block AtStartup LuaCode={ } is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can be useful to check whether a quest has been accomplished, or for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. There are no arbitrary limitations so you can do anything you wish.
to:
There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??

Dialog nodes aka options

Changed line 33 from:

Nodes

Intro

A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also referred to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
to:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also refered to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
Changed line 35 from:

Available fields

to:

Available fields

Added lines 43-44:
Arthur, can Text="" be left empty yet?

Changed line 46 from:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux says but remove it if Tux is not actually saying anything (e.g. in case the NPC starts to talk first).
to:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux sais but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).
Changed lines 48-49 from:
The field OptionSample is used to indicate what sound file is associated to the text. It is optional, and can take a special value "NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
to:
The 2nd line is optional and currently only used for when the NPC talks first, in which case it needs to be exactly
OptionSample="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
Deleted line 62:

Implementing the dialog

ReturnOfTux?.droids
DialogSectionToUse?="Skippy"
January 09, 2009, at 11:01 AM by ahuillet -- first part of "going after stedevil for clarification"
Changed lines 13-14 from:
At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. It's most common use is to set which dialog options should be shown, show(), but there are no arbitrary limitations so it can be used for much more advanced things as well.
to:
At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. Its intended use is to properly set which dialog options should be shown the first time, since they are all disable by default. Use show() for this. Calling anything else than show() is likely to be a mistake of yours, check out AtStartup below.
Changed lines 19-20 from:
There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??
to:
The block AtStartup LuaCode={ } is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can be useful to check whether a quest has been accomplished, or for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. There are no arbitrary limitations so you can do anything you wish.
Changed line 22 from:

Dialog nodes aka options

to:

Nodes

Changed line 24 from:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also refered to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
to:
A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also referred to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
Deleted line 33:
Arthur, can Text="" be left empty yet?

Changed line 35 from:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux sais but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).
to:
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux says but remove it if Tux is not actually saying anything (e.g. in case the NPC starts to talk first).
Changed line 37 from:
The 2nd line is optional and currently only used for when the NPC talks first, in which case it needs to be exactly
OptionSample="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
to:
The field OptionSample is used to indicate what sound file is associated to the text. It is optional, and can take a special value "NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
January 09, 2009, at 10:39 AM by 127.0.0.1 --
Changed line 1 from:
This page explains how to write a dialog for a character you have added in game.
to:
This page explains how to write a dialog for a character you have added to the game.
Changed lines 50-55 from:
The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.
to:
The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.

Implementing the dialog

ReturnOfTux?.droids
DialogSectionToUse?="Skippy"
January 09, 2009, at 04:37 AM by 127.0.0.1 --
Changed line 20 from:

Dialog nodes aka Options

to:

Dialog nodes aka options

Changed lines 27-30 from:
The first line is Nr=0 Text=_"Some text for Tux to say" The Nr=number is a unique ID for the file and the value is between 0-99. It's a very bad idea to use the exact string Nr= anywhere else in the dialog file then to define a node.
to:
The first line is
Nr=0 Text=_"Some text for Tux to say"
The Nr=number is a file unique ID for the node and the value is between 0-99. It's a very bad idea to use the exact string Nr= anywhere else in the dialog file other than to define the start a node.
The number order of the nodes in the dialog file is irrelevant, though it's recommended to use sequential number order since makes it makes it easier to find what is where by the next person helping out.
Changed line 32 from:
Arthur, can Text= be left empty yet? Text_= xxxxxf
to:
Arthur, can Text="" be left empty yet?
Changed lines 34-38 from:
The _ is a marker for "this should be translated", so remember to have it there so the if its a dialog but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).
to:
Text_=""
The _ is a gettext marker for "this should be translated", so remember to have it there for things Tux sais but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).

The 2nd line is optional and currently only used for when the NPC talks first, in which case it needs to be exactly
OptionSample="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
Deleted line 40:
OptionSample?="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER"
Added line 47:

January 09, 2009, at 04:11 AM by 127.0.0.1 --
Changed lines 18-22 from:
There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??
to:
There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been turned off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??

Dialog nodes aka Options

Intro

A node is where things happen in the dialogs. It generally consists of an option that will be selectable by Tux at some point in the dialog, which is why it is also refered to as an option. But since it's not strictly necessary for Tux to select it, the term option is not 100% correct (eg it can also be run automatically via FirstTime).
Deleted line 23:

Dialog nodes

Defining a node

Added lines 25-39:
A node follows the following structure:

The first line is Nr=0 Text=_"Some text for Tux to say" The Nr=number is a unique ID for the file and the value is between 0-99. It's a very bad idea to use the exact string Nr= anywhere else in the dialog file then to define a node.

Arthur, can Text= be left empty yet? Text_= xxxxxf

The _ is a marker for "this should be translated", so remember to have it there so the if its a dialog but remove it if Tux is not actually saying anything (eg in case the NPC starts to talk first).

OptionSample?="NO_SAMPLE_HERE_AND_DONT_WAIT_EITHER" NPC=_"You are Tux, aren't you..." NPC=_"The hero..." LuaCode?={
January 09, 2009, at 03:37 AM by 127.0.0.1 --
Changed lines 12-13 from:

Initialization LuaCode?

At the general level, dialogs can take a block "Initialization LuaCode?={". This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. XXXXXXX
to:

FirstTime LuaCode

At the general level, dialogs can take a block FirstTime LuaCode={ }. This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. It's most common use is to set which dialog options should be shown, show(), but there are no arbitrary limitations so it can be used for much more advanced things as well.
Changed lines 15-18 from:

AtStartup? LuaCode?

There also is the block "AtStartup? LuaCode?={" that XXXXXXXXXX
to:

AtStartup LuaCode

Arthur, should we not rename it to EveryTime?? / SH

There also is the block AtStartup LuaCode={ }. This is very similar to FirstTime, except that it will be executed every time the player talks to the NPC. This can eg be useful for options you always want to be turned back on when starting to talk to an NPC even after it has been off during a previous dialog. But again, there is no arbitrary limit for how advanced things you can do with it. xxx can be used in subdia??
January 08, 2009, at 10:12 PM by ahuillet -- the beginning...
Changed lines 1-26 from:
Describe WritingDialogs here.
to:
This page explains how to write a dialog for a character you have added in game.

Introduction

Dialogs in freedroidRPG reside in dialogs/*.dialog. A dialog works by letting the user select dialog options (or "nodes"). Each node represents one thing the player can tell the NPC, and can contain replies from the NPC, as well as a piece of Lua script to interact with the game engine.

Any non-recognized string in a .dialog file represents a comment and is ignored. "recognized" strings are the ones that specify the beginning of the file, the Lua scripts for initialization/startup, or dialog options.

Top level

Initialization LuaCode?

At the general level, dialogs can take a block "Initialization LuaCode?={". This is a block of code that will be executed the first time the player talks to the NPC (and only the first time). It cannot be used in subdialogs. XXXXXXX

AtStartup? LuaCode?

There also is the block "AtStartup? LuaCode?={" that XXXXXXXXXX

Dialog nodes

Defining a node

Available fields

Lua API

XXXXXXXX

The up-to-date list of functions available from LuaCode? blocks can be found in lua.c. Look for "luaL_register", this is where the Lua functions are listed.
Edit Page - Page History - Printable View - Recent Changes - WikiHelp - SearchWiki
Page last modified on January 09, 2009, at 01:43 PM