Loading

Paste #phpmgml8t

  1. input nml:
  2.  
  3. spriteset(stationset1, "src/gfx/cc_grid.png") { tmpl_groundsprites(1, 1) }
  4.  
  5. spritegroup spritegroup1 { // alternatively: reference spriteset directly in spritelayout, and generate a spritegroup automatically using the same spriteset for all cases
  6.   little: [ ];
  7.   lots:   [ stationset1 ];
  8. }
  9.  
  10. spriteset(stationset2, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 1) }
  11. spriteset(stationset3, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 2) }
  12. spriteset(stationset4, "src/gfx/cc_build.png") { tmpl_buildingsprites(1, 3) }
  13.  
  14. spritegroup spritegroup2 {
  15.   little: [ stationset2 ];
  16.   lots:   [ stationset3, stationset4 ];
  17. }
  18.  
  19. spritelayout stationlayout2 {
  20.  ground {
  21.   sprite: spritegroup1(0, 0) // the second offset must be a compile-time constant, and is added to the first for Y direction. in this case use sprite 0 for both orientations
  22.  }
  23.  building {
  24.   sprite: spritegroup2(0, 1) // use sprite 0 for X and 0+1 for Y
  25.  }
  26. }
  27.  
  28. switch (FEAT_STATION, SELF, switch3, [ ... ] {
  29.   ...
  30.   stationlayout2;
  31. }
  32.  
  33. item(FEAT_STATION, station4) {
  34.   property {
  35.     ... nothing about layouts here ...
  36.   }
  37.   graphics {
  38.     switch3;
  39.   }
  40. }
  41.  
  42.  
  43. output grf:
  44.  
  45. action0:
  46.   layout0: stationlayout2 using var10=0 for ground, var10=1 for building1
  47.   layout1: stationlayout2 using var10=0 for ground, var10=1 for building1 and an additional 1 offset in the building for the Y orientation
  48.  
  49. action3
  50. ->  varactions according to switch3
  51.     -> varaction(var0C)
  52.          14: return layout0
  53.          default:
  54.            -> varaction(var10)
  55.               0: return stationgroup1
  56.               1: return stationgroup2

Version history

Revision # Author Created at
pfzxi8oiw Anonymous 07 Jan 2015, 22:50:45 UTC Diff
pzjtzla8o Anonymous 07 Jan 2015, 22:05:01 UTC Diff

Comments