User Tools

Site Tools


script:module:defs

Differences

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

Link to this comparison view

Next revision
Previous revision
script:module:defs [2015-11-15 20:29]
127.0.0.1 external edit
script:module:defs [2019-11-17 17:56] (current)
skyjake [Constants]
Line 1: Line 1:
-The <​code>​Defs</​code>​ module provides access to the definitions read from [[ded]] files.+====== ​Defs (Module) ======
  
  
 +The ''​Defs''​ module provides access to the definitions read from [[:DED]] files.
 +
 +<​code>​
 $ dir(Defs) $ dir(Defs)
-⇒ [ SDN_ACTIVE, SDN_ATTACK, SDN_DEATH, SDN_PAIN, SDN_SEE, SN_CRASH, SN_DEATH, SN_MELEE, SN_MISSILE, SN_PAIN, SN_RAISE, SN_SEE, SN_SPAWN, SN_XDEATH, decorations,​ episodes, finales, flags, mapInfos, materials, models, musics, skies, states, things ]+⇒ [ SDN_ACTIVE, SDN_ATTACK, SDN_DEATH, SDN_PAIN, SDN_SEE, SN_CRASH, ​  ​SN_DEATH, SN_MELEE, SN_MISSILE, SN_PAIN, SN_RAISE, SN_SEE, SN_SPAWN, SN_XDEATH, decorations,​ episodes, finales, flags, mapInfos, materials, models, musics, skies, states, things ] 
 +</​code>​
  
  
- +===== Lookups =====
-====== Lookups ​======+
  
  
Line 13: Line 16:
  
  
-$ dir(Defs.things) +  ​$ dir(Defs.things) 
-⇒ [ idLookup, nameLookup, order ]+  ⇒ [ idLookup, nameLookup, order ]
  
  
-For example, ​<​code>​idLookup</​code> ​is a dictionary that maps IDs to definition records. +For example, ​''​idLookup'' ​is a dictionary that maps IDs to definition records.
  
 +<​code>​
 $ Defs.things.idLookup['​possessed'​] $ Defs.things.idLookup['​possessed'​]
 ⇒ __order__: ​  1 ⇒ __order__: ​  1
Line 38: Line 41:
   speed: ​      8   speed: ​      8
   states: ​     [ POSS_STND, POSS_RUN1, POSS_PAIN, NULL, POSS_ATK1, , POSS_DIE1, POSS_XDIE1, POSS_RAISE1 ]   states: ​     [ POSS_STND, POSS_RUN1, POSS_PAIN, NULL, POSS_ATK1, , POSS_DIE1, POSS_XDIE1, POSS_RAISE1 ]
 +</​code>​
  
  
- +===== Order =====
-====== Order ======+
  
  
-The <​code>​order</​code> ​variable contains a regular array where the definitions are stored in the order they were read from the [[ded]] files. The order is meaningful because generally later definitions override earlier ones. The indices in this list are also available in the definition records as <code>​__order__</​code>.+The ''​order'' ​variable contains a regular array where the definitions are stored in the order they were read from the [[:DED]] files. The order is meaningful because generally later definitions override earlier ones. The indices in this list are also available in the definition records as ''​<nowiki>​__order__</​nowiki>''​.
  
  
-$ len(Defs.things.order) +  ​$ len(Defs.things.order) 
-⇒ 140 +  ⇒ 140 
-$ Defs.things.order[1].id +  $ Defs.things.order[1].id 
-⇒ POSSESSED+  ⇒ POSSESSED
  
  
  
-====== Constants ​======+===== Constants =====
  
  
-The <​code>​Defs.SN_*</​code> ​constants are used as indices in the <​code>​states</​code> ​array of thing definitions.+The ''​Defs.SN_*'' ​constants are used as indices in the ''​states'' ​array of [[ded:thing|Thing ​definitions]].
  
-The <​code>​Defs.SDN_*</​code> ​constants are used as indices in the <​code>​sounds</​code> ​array of thing definitions.+The ''​Defs.SDN_*'' ​constants are used as indices in the ''​sounds'' ​array of [[ded:thing|Thing ​definitions]].
  
  
  
  
script/module/defs.1447612150.txt.gz · Last modified: 2019-11-17 17:52 (external edit)