-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmapinfo.lua
237 lines (208 loc) · 5.82 KB
/
mapinfo.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- mapinfo.lua
--
local mapinfo = {
name = "Random Plateaus",
shortname = "rplat",
description = "A sometimes craggy, sometimes plateauy random map, now with igloos (10x10)",
author = "GoogleFrog",
version = "v1.1",
modtype = 3, --// 1=primary, 0=hidden, 3=map
maphardness = 140,
notDeformable = false,
gravity = 130,
tidalStrength = 18,
maxMetal = 1.20,
extractorRadius = 110,
voidWater = false,
autoShowMetal = true,
smf = {
minheight = -105,
maxheight = 280,
smtFileName0 = "RandomBaseMap10.smt",
minimapTex = "minimap.png",
},
sound = {
preset = "default",
passfilter = {
gainlf = 1.0,
gainhf = 1.0,
},
reverb = {
},
},
resources = {
splatDetailTex = "Rock.png",
splatDetailNormalDiffuseAlpha = 1,
splatDetailNormalTex = {
"grass.tga", -- Grass
"rock.tga", -- Rocky grass
"sand.tga", -- shallowSand
"volcano.tga", -- Depth Sand
alpha = true,
},
},
splats = {
TexScales = { 0.00471, 0.00097, 0.0013, 0.0027 },
TexMults = { 0.5, 0.31, 0.5, 0.65 },
},
atmosphere = {
minWind = 5.0,
maxWind = 25.0,
fogStart = 0,
fogEnd = 500,
fogColor = {0.7, 0.7, 0.8},
sunColor = {1.0, 1.0, 1.0},
skyColor = {0.1, 0.15, 0.7},
skyDir = {0.0, 0.0, -1.0},
skyBox = "",
cloudDensity = 0.5,
cloudColor = {1.0, 1.0, 1.0},
},
grass = {
bladeWaveScale = 1.0,
bladeWidth = 0.32,
bladeHeight = 4.0,
bladeAngle = 1.57,
bladeColor = {0.59, 0.81, 0.57}, --// does nothing when `grassBladeTex` is set
},
lighting = {
--// dynsun
sunStartAngle = 0.0,
sunOrbitTime = 1440.0,
sunDir = {0.35, 1.0, 0.3, 1e9},
--// unit & ground lighting
["groundDiffuseColor"]= {0.35, 0.42, 0.41, 1},
["groundAmbientColor"]= {0.42, 0.45, 0.365, 1},
["groundSpecularColor"]= {0.1, 0.1, 0.1, 1},
groundShadowDensity = 0.4,
unitAmbientColor = {0.55, 0.55, 0.45},
unitDiffuseColor = {0.85, 0.85, 0.85},
unitSpecularColor = {0.85, 0.85, 0.85},
unitShadowDensity = 0.4,
specularExponent = 3.0,
},
water = {
damage = 0,
["surfaceColor"]= {0.55778897, 0.73869348, 0.57788944, 1},
["fresnelMin"]= 0.07,
["blurExponent"]= 0.51999998,
["reflectionDistortion"]= 0,
["specularColor"]= {0.37185928, 0.42211056, 0.55778897, 1},
["fresnelPower"]= 2.63999987,
["specularPower"]= 10.3999996,
["perlinStartFreq"]= 9.59999943,
["absorb"]= {0, 0, 0, 0.59798998},
["fresnelMax"]= 0.34999999,
["diffuseColor"]= {0.77386934, 0.68844223, 0.65326631, 1},
["perlinAmplitude"]= 1.43999994,
["perlinLacunarity"]= 2.3599999,
["specularFactor"]= 0.25999999,
["minColor"]= {0.36683416, 0.30653265, 0.53266335, 1},
["planeColor"]= {0.40201005, 0.40703517, 0.6231156, 1},
["surfaceAlpha"]= 0.16,
["blurBase"]= 0,
["diffuseFactor"]= 0.42999998,
["repeatX"]= 7.79999971,
["ambientFactor"]= 0.74000001,
["repeatY"]= 9.80000019,
["baseColor"]= {0, 0, 0, 1},
shoreWaves = true,
forceRendering = false,
normalTexture = "waterbump.png",
},
teams = {
[0] = {startPos = {x = 936, z = 5210}},
[1] = {startPos = {x = 7280, z = 2981}},
[2] = {startPos = {x = 2787, z = 7564}},
[3] = {startPos = {x = 5409, z = 611}},
[4] = {startPos = {x = (2460), z = 6202}},
[5] = {startPos = {x = (5706), z = 1988}},
[6] = {startPos = {x = (62) , z = 1638}},
[7] = {startPos = {x = (8120), z = 6493}},
},
terrainTypes = {
[0] = {
name = "Default",
hardness = 1.0,
receiveTracks = true,
moveSpeeds = {
tank = 1.0,
kbot = 1.0,
hover = 0.9,
ship = 0.9,
},
},
},
}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Helper
local function lowerkeys(ta)
local fix = {}
for i,v in pairs(ta) do
if (type(i) == "string") then
if (i ~= i:lower()) then
fix[#fix+1] = i
end
end
if (type(v) == "table") then
lowerkeys(v)
end
end
for i=1,#fix do
local idx = fix[i]
ta[idx:lower()] = ta[idx]
ta[idx] = nil
end
end
lowerkeys(mapinfo)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Map Options
if (Spring) then
local function tmerge(t1, t2)
for i,v in pairs(t2) do
if (type(v) == "table") then
t1[i] = t1[i] or {}
tmerge(t1[i], v)
else
t1[i] = v
end
end
end
-- make code safe in unitsync
if (not Spring.GetMapOptions) then
Spring.GetMapOptions = function() return {} end
end
function tobool(val)
local t = type(val)
if (t == 'nil') then
return false
elseif (t == 'boolean') then
return val
elseif (t == 'number') then
return (val ~= 0)
elseif (t == 'string') then
return ((val ~= '0') and (val ~= 'false'))
end
return false
end
getfenv()["mapinfo"] = mapinfo
local files = VFS.DirList("mapconfig/mapinfo/", "*.lua")
table.sort(files)
for i=1,#files do
local newcfg = VFS.Include(files[i])
if newcfg then
lowerkeys(newcfg)
tmerge(mapinfo, newcfg)
end
end
getfenv()["mapinfo"] = nil
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
return mapinfo
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------