User Tools

Site Tools


script:reference

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
script:reference [2017-03-13 19:24]
skyjake [Doomsday Script reference]
script:reference [2018-12-16 09:22] (current)
skyjake [See also]
Line 8: Line 8:
  
  
-As a scripting language, Doomsday Script serves in many roles, ​including [[scripted_ui|user interface and menu functionality]], ​configuration ​(cf. traditional cvars), high-level game logic (cf. Hexen ACS; XG), and [[ded_2.0|game data definitions]].+As a scripting language, Doomsday Script serves in many roles, ​for instance managing engine ​configuration and controlling ​[[assets:​model#​timelines|3D model asset animation]].
  
 Doomsday Script is not a compiled language and thus is not intended for high-performance or time-critical tasks. Game plugins written in native code should be used for processing-intensive functionality. Doomsday Script is not a compiled language and thus is not intended for high-performance or time-critical tasks. Game plugins written in native code should be used for processing-intensive functionality.
Line 26: Line 26:
 The syntax of the language is heavily influenced by Ruby and Python, with a few notable differences:​ The syntax of the language is heavily influenced by Ruby and Python, with a few notable differences:​
  
-  * The amount of indentation whitespace has no meaning. Compounds are explicitly closed with [[end_keyword_]]+  * The amount of indentation whitespace has no meaning. Compounds are explicitly closed with ''​end''​
-  * A colon (:) always indicates a single-line compound that does not need to be closed: <​code>​def func2(): return '​World'</​code>​ +  * A colon (''​:''​) always indicates a single-line compound that does not need to be closed: <​code>​def func2(): return '​World'</​code>​ 
- +  * Objects are classless and called [[Record]]s. They correspond native ''​de::​Record''​ instances:<​code>​record myrec
-  * "Objects" ​are classless and called [[record]]s. They correspond native ''​de::​Record''​ instances:<​code>​record myrec+
 myrec.newMember = 100</​code>​ myrec.newMember = 100</​code>​
- 
   * There are no non-modifiable tuples, just arrays:<​code>​array = [1, 2, 3, 4]   * There are no non-modifiable tuples, just arrays:<​code>​array = [1, 2, 3, 4]
 array[1] = 100 array[1] = 100
 # array is now [1, 100, 3, 4]</​code>​ # array is now [1, 100, 3, 4]</​code>​
- 
   * There are a couple of special assignment operators. Global assignment ('':​=''​) will assign into variables in parent scopes if no local variable with the given name is found. Weak assignment (''?​=''​) will only assign a value if a variable has not yet been created.   * There are a couple of special assignment operators. Global assignment ('':​=''​) will assign into variables in parent scopes if no local variable with the given name is found. Weak assignment (''?​=''​) will only assign a value if a variable has not yet been created.
  
 +===== Built-ins =====
  
 ==== Built-in types ==== ==== Built-in types ====
Line 85: Line 83:
 ===== Feature walkthrough ===== ===== Feature walkthrough =====
  
-  *  ​[[.walkthrough:basic_expressions]] +[[script:​walkthrough:​start|Doomsday Script feature ​walkthrough]]
-  *  [[.walkthrough:​operator_expressions]] +
-  *  [[.walkthrough:​statements_and_compounds]] +
-  *  [[.walkthrough:​exceptions]] +
-  *  [[.walkthrough:​records]] +
-  *  [[.walkthrough:​functions]] +
-  *  [[.walkthrough:​scopes]] +
-  *  [[.walkthrough:​script_return_value]]+
  
  
Line 114: Line 105:
  
  
-===== See also =====+===== Feature status ​===== 
 + 
 +Doomsday Script is not yet fully utilized (as of [[version:​2.1]]). Upcoming uses include: 
 +  * Backend of the console prompt, console variables and commands. 
 +  * Manipulating level data and game objects.
  
-  *  [[https://​github.com/​skyjake/​Doomsday-Engine/​blob/​master/​doomsday/​tests/​test_script/​kitchen_sink.de|The "​Kitchen Sink" test script]] 
  
 +===== Examples =====
  
 +  *  [[https://​github.com/​skyjake/​Doomsday-Engine/​blob/​master/​doomsday/​tests/​test_script/​kitchen_sink.ds|The "​Kitchen Sink" test script]]
 +  * [[https://​github.com/​skyjake/​Doomsday-Engine/​blob/​master/​doomsday/​apps/​client/​net.dengine.client.pack/​modules/​controllers.ds|Game controller presets script]]
script/reference.1489425888.txt.gz · Last modified: 2017-03-13 19:24 by skyjake