C_INFO Daedalus class
Acknowledgment
Heavily inspired by the amazing documentation site Gothic library.
The C_INFO
class is used to define dialogues in the game.
Class definition
Class definition as it is defined in Scripts/Content/_intern/Classes.d
script file.
C_Info Daedalus class
Class members
Variable | Type | Description |
---|---|---|
npc | int | npc instance to have the dialogue |
nr | int | dialogue order number |
important | int | npc addresses player automatically |
condition | func | condition function whether the dialogue is shown or not |
information | func | function called on dialogue selection - contains the dialogue lines and other logic |
description | string | text shown in the dialogue box |
trade | int | is it a trade dialogue |
permanent | int | does the dialogue stay after being played once |
Class member overview
Description of the class member variables.
npc
Sets what NPC will have this dialogue instance. Set an NPC instance.
nr
The nr
member variables determines the order of shown dialogues. Dialogues are ordered in the ascending order - instances with higher nr
are below instances with lower nr
.
Note
This is why the end dialogues usually have nr = 999;
this is the highest number out of any dialogues therefore will always show up at the bottom. (999 is not the highest number the nr
can store, it is just considered the highest number, as there will hardly be 998 dialogue instances for a single character)
important
The important
member variable determines whether the NPC will automatically address the player or not.
important = TRUE
- the NPC will address the playerimportant = FALSE
- the player has to talk to the NPC
When important
is set to TRUE
, the description is not needed since the dialogue is never shown in the dialogue box.
Info
If there are multiple important dialogues that satisfy their condition function, they will be played in the order specified by nr
.
Tip
important
variable is of the type integer, and it is initialized by the engine to the value of 0
. If you do not want your dialogue to be important, you can omit the important
member variable since it will be initialized to 0
by the engine.
condition
Condition function with signature func int f()
. If the function returns TRUE
the dialogue is displayed, if it returns FALSE
it is not displayed. The function name does not have to follow a particular naming convention, but a naming convention is used throughout all the Gothic scripts: {DialogueName}_Condition
.
Tip
It is unnecessary to return FALSE
from dialogue conditions, but in other cases it can very rarely cause subtle bugs. It is thus good practice to always return some value, even if that is FALSE
.
information
The information
function contains the function name (without double quotes ""
as func
is a type in Daedalus) that is called when the dialogue option is selected. It contains the lines NPCs will say, items that will be transferred, quests related logic and much more. The function name does not have to follow a particular naming convention, but a naming convention is used throughout all the Gothic scripts: {DialogueName}_Info
.
description
Specify a string that will be shown in the dialogue window.
trade
If trade
is set to TRUE
the trading interface will be launched after the content information
function is finished.
Trivia
Trade manager has been added to ZenGin not that long before the release of Gothic 1 (as discussed and discovered on Phoenix the Game Discord server with the acquisition of Gothic version 0.94k
). In version 0.94 the trade manager worked quite differently and used a special (nowadays unused) Daedalus class C_ItemReact
.
permanent
Dialogues with permanent = TRUE
do not disappear after the dialogue is played. This is used for dialogues where you ask for directions or flavor dialogues for unnamed NPCs.
Bug
Frequently used external function Npc_KnowsInfo
which returns true if the dialogue instance has been played has had a bug in the implementation for a long time. This bug made it impossible to use this function with dialogue instances with permanent = TRUE
as it would always return FALSE
. This has been fixed in Union 1.0m
.
LeGo
LeGo implements a lot of useful functions for dialogues. It makes it possible to create Trialogues and change NPCs behaviour by Dialoggestures. Moreover, any Daedalus function can be added to NPCs AI queue via the AI_Function package.
zParserExtender
zParserExtender implements some Quality of Life features for dialogues. More information can be found in Dialogue constants article.
AF Script Packet
Enhanced Info Manager (implemented using Ikarus and LeGo) adds tons of customizations and additional features to dialogues. More information can be found in the AFSP Enhanced Information Manager article.