v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing 23a:Dipscript

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "23a"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 3: Line 3:
 
A '''dipscript''', or "diplomat script", is what controls the behavior of visiting [[diplomat]]s when they meet with your [[noble]]s. Dipscripts were originally used to trigger special events at specific points in the lifetime of one's fortress (such as undead invasions), but much of this was stripped out by the time the first version of Dwarf Fortress was actually released.
 
A '''dipscript''', or "diplomat script", is what controls the behavior of visiting [[diplomat]]s when they meet with your [[noble]]s. Dipscripts were originally used to trigger special events at specific points in the lifetime of one's fortress (such as undead invasions), but much of this was stripped out by the time the first version of Dwarf Fortress was actually released.
  
Only 5 different dipscripts are ever executed during gameplay, and they are defined in records 13-17 of the game's "index" file: ELVES_FIRSTCONTACT, HUMAN_STANDARD, DWARF_LIAISON, HUMAN_TRADE, and ELVES_STANDARD. The dipscript files themselves are compressed and scrambled, requiring [[User:Quietust/wtf23a.php|special tools]] in order to edit them (in later versions, they are only compressed).
+
Only 5 different dipscripts are ever executed during gameplay, and they are defined in records 13-17 of the game's "index" file: ELVES_FIRSTCONTACT, HUMAN_STANDARD, DWARF_LIAISON, HUMAN_TRADE, and ELVES_STANDARD. The dipscript files themselves are compressed and scrambled, making them difficult to edit (in later versions, they are only compressed).
  
==Script Tokens==
+
The following tokens can be specified in a dipscript:
{| {{prettytable}}
+
{|
|- bgcolor="#ddd"
 
 
! Token
 
! Token
 
! Meaning
 
! Meaning
 
|-
 
|-
 
|INITIAL_LOAD
 
|INITIAL_LOAD
|Presumably indicates that the dipscript should be loaded on game startup instead of on-demand. All of the default dipscripts specify this, as the game does not appear to contain logic for dynamic loading.
+
|Purpose unclear - all dipscripts have this as their second line
 
|-
 
|-
 
|DIPSCRIPT:name
 
|DIPSCRIPT:name
Line 33: Line 32:
 
|-
 
|-
 
|TEXTVIEWER:filename:varname
 
|TEXTVIEWER:filename:varname
|Opens a [[text viewer]] using the specified filename (located within data/dipscripts/text). Second parameter is optional - if specified, indicates a LONG script variable which will be set based on the choice selected.
+
|Opens a text viewer using the specified filename (located within data/dipscripts/text). Second parameter is optional - if specified, indicates a LONG script variable which will be set based on the hyperlink selected.
 
|-
 
|-
 
|CONSTRUCTTOPICLIST
 
|CONSTRUCTTOPICLIST
Line 42: Line 41:
 
|-
 
|-
 
|DISCUSS:length
 
|DISCUSS:length
|Inserts a delay into the meeting. Valid lengths are SHORT (500-1000 [[FPS|steps]], about a half a day) and LONG (2-4 days).
+
|Inserts a delay into the meeting. Valid lengths are SHORT and LONG.
 
|-
 
|-
 
|HISTORY_DIPEV:type
 
|HISTORY_DIPEV:type
Line 48: Line 47:
 
|-
 
|-
 
|ACTION:type:subtype
 
|ACTION:type:subtype
|Performs a simple action. Only valid action is DREAM:UNDEAD_ARMY, which causes one of your dwarves to have "[[Thought|a terrifying nightmare about an army of the dead]]".
+
|Performs a simple action. Only valid action is DREAM:UNDEAD_ARMY, which causes one of your dwarves to have a nightmare about an army of the undead.
 
|-
 
|-
 
|DIPEVENT:parm1:parm2:parm3:parm4:parm5
 
|DIPEVENT:parm1:parm2:parm3:parm4:parm5
Line 61: Line 60:
  
 
===Readable variables===
 
===Readable variables===
{| {{prettytable}}
+
{|
|- bgcolor="#ddd"
 
 
! Class
 
! Class
 
! Name
 
! Name
Line 71: Line 69:
 
|UNIT_WIZARD
 
|UNIT_WIZARD
 
|Undefined
 
|Undefined
|Not implemented - presumably, this used to be used for a [[wizard]] visiting your fortress to bring a random healthy dwarf (see below) on a quest to thwart another evil wizard.
+
|Not implemented - presumably, this used to be used for a [[wizard]] visiting your fortress (and threatening an undead invasion).
 
|-
 
|-
 
|GLOBAL
 
|GLOBAL
Line 155: Line 153:
  
 
===Writable variables===
 
===Writable variables===
{| {{prettytable}}
+
{|
|- bgcolor="#ddd"
 
 
! Class
 
! Class
 
! Name
 
! Name
Line 205: Line 202:
 
===Displayable variables===
 
===Displayable variables===
 
Some of the above variables can be displayed in custom screens opened by the TEXTVIEWER command using the syntax [C:VAR:class:name] (to set the text color) and [VAR:format:class:name] to output the value in a particular format. Certain formats are only valid with specific types - trying to use it on the wrong type will likely result in a blank string.
 
Some of the above variables can be displayed in custom screens opened by the TEXTVIEWER command using the syntax [C:VAR:class:name] (to set the text color) and [VAR:format:class:name] to output the value in a particular format. Certain formats are only valid with specific types - trying to use it on the wrong type will likely result in a blank string.
 
+
{|
{| {{prettytable}}
 
|- bgcolor="#ddd"
 
 
! Format
 
! Format
 
! Type
 
! Type

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)