Guest User

living lands mapinfo.lua

a guest
Feb 12th, 2015
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------------------------------
  2. --------------------------------------------------------------------------------
  3. -- mapinfo.lua
  4. --
  5.  
  6. local mapinfo = {
  7. name = "Living Lands",
  8. shortname = "Living Lands",
  9. description = "1v1 map based on DeadLands, designed for Zero-K.",
  10. author = "Original by mestizo and Saktoth, remastered by aeonios.",
  11. version = "v2.0",
  12. --mutator = "official";
  13. --mapfile = "", --// location of smf/sm3 file (optional)
  14. modtype = 3, --// 1=primary, 0=hidden, 3=map
  15. depend = {"Map Helper v1"},
  16. replace = {},
  17.  
  18. --startpic = "", --// deprecated
  19. --StartMusic = "", --// deprecated
  20.  
  21. maphardness = 500,
  22. notDeformable = false,
  23. gravity = 130,
  24. tidalStrength = 0,
  25. maxMetal = 0.9,
  26. extractorRadius = 70.0,
  27. voidWater = true,
  28. autoShowMetal = true,
  29.  
  30.  
  31. smf = {
  32. minheight = 100,
  33. maxheight = 450,
  34. --smtFileName0 = "",
  35. --smtFileName1 = "",
  36. --smtFileName.. = "",
  37. --smtFileNameN = "",
  38. },
  39.  
  40. sound = {
  41. --// Sets the _reverb_ preset (= echo parameters),
  42. --// passfilter (the direct sound) is unchanged.
  43. --//
  44. --// To get a list of all possible presets check:
  45. --// https://github.com/spring/spring/blob/master/rts/System/Sound/EFXPresets.cpp
  46. --//
  47. --// Hint:
  48. --// You can change the preset at runtime via:
  49. --// /tset UseEFX [1|0]
  50. --// /tset snd_eaxpreset preset_name (may change to a real cmd in the future)
  51. --// /tset snd_filter %gainlf %gainhf (may " " " " " " " " )
  52. preset = "default",
  53.  
  54. passfilter = {
  55. --// Note, you likely want to set these
  56. --// tags due to the fact that they are
  57. --// _not_ set by `preset`!
  58. --// So if you want to create a muffled
  59. --// sound you need to use them.
  60. gainlf = 1.0,
  61. gainhf = 1.0,
  62. },
  63.  
  64. reverb = {
  65. --// Normally you just want use the `preset` tag
  66. --// but you can use handtweak a preset if wanted
  67. --// with the following tags.
  68. --// To know their function & ranges check the
  69. --// official OpenAL1.1 SDK document.
  70.  
  71. --density
  72. --diffusion
  73. --gain
  74. --gainhf
  75. --gainlf
  76. --decaytime
  77. --decayhflimit
  78. --decayhfratio
  79. --decaylfratio
  80. --reflectionsgain
  81. --reflectionsdelay
  82. --reflectionspan
  83. --latereverbgain
  84. --latereverbdelay
  85. --latereverbpan
  86. --echotime
  87. --echodepth
  88. --modtime
  89. --moddepth
  90. --airabsorptiongainhf
  91. --hfreference
  92. --lfreference
  93. --roomrollofffactor
  94. },
  95. },
  96.  
  97. resources = {
  98. --grassBladeTex = "",
  99.  
  100. --grassShadingTex = "",
  101. --detailTex = "",
  102. specularTex = "specmap.png",
  103. splatDistrTex = "",
  104. splatDetailTex = "",
  105. --skyReflectModTex = "",
  106. --detailNormalTex = "",
  107. --lightEmissionTex = "",
  108. },
  109.  
  110. splats = {
  111. texScales = { 0.006, 0.009, 0.006, 0.006 },
  112. texMults = { 0.3, 0.4, 0.2, 1 },
  113. },
  114.  
  115. atmosphere = {
  116. minWind = 5.0,
  117. maxWind = 25.0,
  118.  
  119. fogStart = 0.1,
  120. fogEnd = 4.0,
  121. fogColor = { 2.0, 2.0, 1.7 },
  122.  
  123. sunColor = { 1.0, 1.0, 0.8 },
  124. skyColor = { 0.0, 0.3, 0.5 },
  125. skyDir = { -0.5, 0.8, -0.5 },
  126. skyBox = "altored1.dds",
  127.  
  128. cloudDensity = 0.0,
  129. cloudColor = { 0.8, 0.8, 0.8 },
  130. },
  131.  
  132. grass = {
  133. bladeWaveScale = 1.0,
  134. bladeWidth = 0.15,
  135. bladeHeight = 2.0,
  136. bladeAngle = 1.57,
  137. bladeColor = {0.79, 0.81, 0.57}, --// does nothing when `grassBladeTex` is set
  138. },
  139.  
  140. lighting = {
  141. --// dynsun
  142. sunStartAngle = 0.0,
  143. sunOrbitTime = 300.0,
  144. sunDir = { -0.8, 0.8, 0.0 },
  145.  
  146. --// unit & ground lighting
  147. groundAmbientColor = { 0.3, 0.3, 0.3 },
  148. groundDiffuseColor = { 2.0, 2.0, 2.0 },
  149. groundSpecularColor = {2.0, 2.0, 2.0},
  150. groundShadowDensity = 0.9,
  151. unitAmbientColor = { 1., 0.9, 0.6 },
  152. unitDiffuseColor = { 2.0, 2.0, 1.2 },
  153. unitSpecularColor = {0.7, 0.7, 0.7},
  154. unitShadowDensity = 0.4,
  155.  
  156. specularExponent = 100.0,
  157. },
  158.  
  159. water = {
  160. damage = 0.0,
  161.  
  162. repeatX = 0.0,
  163. repeatY = 0.0,
  164.  
  165. absorb = { 0.01, 0.02, 0.03 },
  166. baseColor = { 0.1, 0.1, 0.2 },
  167. minColor = { 0.1, 0.2, 0.5 },
  168.  
  169. ambientFactor = 0.0,
  170. diffuseFactor = 3.7,
  171. specularFactor = 0,
  172. specularPower = 20,
  173.  
  174. --//planeColor = { 0.0, 0.4, 0.8 },
  175.  
  176. surfaceColor = { 0.1, 0.3, 0.4 },
  177. surfaceAlpha = 0.2,
  178. diffuseColor = { 0.06, 0.09, 0.12, },
  179. specularColor = { 0.8, 0.7, 0.9 },
  180.  
  181. fresnelMin = 0.0,
  182. fresnelMax = 0.0,
  183. fresnelPower = 0.0,
  184.  
  185. reflectionDistortion = 0.15,
  186.  
  187. blurBase = 8.0,
  188. blurExponent = 2.0,
  189.  
  190. perlinStartFreq = 20,
  191. perlinLacunarity = 3.1,
  192. perlinAmplitude = 0.9,
  193. windSpeed = 1.0, --// does nothing yet
  194.  
  195. shoreWaves = true,
  196. forceRendering = false,
  197.  
  198. --// undefined == load them from resources.lua!
  199. --texture = "",
  200. --foamTexture = "",
  201. --normalTexture = "",
  202. --caustics = {
  203. -- "",
  204. -- "",
  205. --},
  206. },
  207.  
  208. teams = {
  209. [0] = {startPos = {x = 197, z = 3908}},
  210. [1] = {startPos = {x = 3875, z = 197}},
  211.  
  212. },
  213.  
  214. terrainTypes = {
  215. [0] = {
  216. name = "Default",
  217. hardness = 1.0,
  218. receiveTracks = true,
  219. moveSpeeds = {
  220. tank = 1.0,
  221. kbot = 1.0,
  222. hover = 1.0,
  223. ship = 1.0,
  224. },
  225. },
  226. },
  227.  
  228. custom = {
  229. precipitation = {
  230. density = 30000,
  231. size = 1.5,
  232. speed = 50,
  233. windscale = 1.2,
  234. texture = 'LuaGaia/effects/snowflake.png',
  235. },
  236. },
  237. }
  238.  
  239. --------------------------------------------------------------------------------
  240. --------------------------------------------------------------------------------
  241. -- Helper
  242.  
  243. local function lowerkeys(ta)
  244. local fix = {}
  245. for i,v in pairs(ta) do
  246. if (type(i) == "string") then
  247. if (i ~= i:lower()) then
  248. fix[#fix+1] = i
  249. end
  250. end
  251. if (type(v) == "table") then
  252. lowerkeys(v)
  253. end
  254. end
  255.  
  256. for i=1,#fix do
  257. local idx = fix[i]
  258. ta[idx:lower()] = ta[idx]
  259. ta[idx] = nil
  260. end
  261. end
  262.  
  263. lowerkeys(mapinfo)
  264.  
  265. --------------------------------------------------------------------------------
  266. --------------------------------------------------------------------------------
  267. -- Map Options
  268.  
  269. if (Spring) then
  270. local function tmerge(t1, t2)
  271. for i,v in pairs(t2) do
  272. if (type(v) == "table") then
  273. t1[i] = t1[i] or {}
  274. tmerge(t1[i], v)
  275. else
  276. t1[i] = v
  277. end
  278. end
  279. end
  280.  
  281. -- make code safe in unitsync
  282. if (not Spring.GetMapOptions) then
  283. Spring.GetMapOptions = function() return {} end
  284. end
  285. function tobool(val)
  286. local t = type(val)
  287. if (t == 'nil') then
  288. return false
  289. elseif (t == 'boolean') then
  290. return val
  291. elseif (t == 'number') then
  292. return (val ~= 0)
  293. elseif (t == 'string') then
  294. return ((val ~= '0') and (val ~= 'false'))
  295. end
  296. return false
  297. end
  298.  
  299. getfenv()["mapinfo"] = mapinfo
  300. local files = VFS.DirList("mapconfig/mapinfo/", "*.lua")
  301. table.sort(files)
  302. for i=1,#files do
  303. local newcfg = VFS.Include(files[i])
  304. if newcfg then
  305. lowerkeys(newcfg)
  306. tmerge(mapinfo, newcfg)
  307. end
  308. end
  309. getfenv()["mapinfo"] = nil
  310. end
  311.  
  312. --------------------------------------------------------------------------------
  313. --------------------------------------------------------------------------------
  314.  
  315. return mapinfo
  316.  
  317. --------------------------------------------------------------------------------
  318. --------------------------------------------------------------------------------
RAW Paste Data