forked from 0ad/0ad
leper
276f0a41a0
Throw a warning if a invalid (not present) AI is specified in a map. Replace the last occurences of jubot with qbot. Exclude the common siege templates from the Units Demo map. Fix an error with flying units. Replace CFG_GET_SYS_VAL with CFG_GET_USER_VAL and rename it to CFG_GET_VAL to reflect its behaviour better. Fix linker error with clang 3.2. Refs 1588. Remove some useless includes. This was SVN commit r13031.
111 lines
2.6 KiB (Stored with Git LFS)
XML
111 lines
2.6 KiB (Stored with Git LFS)
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<Scenario version="5">
|
|
<Terrain patches="20" texture="blackness" priority="0" height="16384"/>
|
|
<Script><![CDATA[//
|
|
|
|
var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|
|
var entityTemplates = cmpTemplateManager.FindAllTemplates(true);
|
|
|
|
var patches = 20;
|
|
var x0 = 20, z0 = 20, x1 = patches*16*4-20;
|
|
var x = x0, z = z0;
|
|
var maxh = 0;
|
|
var gap = 14;
|
|
|
|
for each (var template in entityTemplates) {
|
|
if (template.match(/^(rubble\/|special\/|actor\|)/)) continue;
|
|
|
|
// Exclude common templates used for inheritance only.
|
|
if (template.match(/_common$/)) continue;
|
|
|
|
print(template+"...\n");
|
|
|
|
var ent = Engine.AddEntity(template);
|
|
|
|
if (!ent) {
|
|
print("Failed to load "+template+"\n");
|
|
continue;
|
|
}
|
|
|
|
var cmpFootprint = Engine.QueryInterface(ent, IID_Footprint);
|
|
if (!cmpFootprint) {
|
|
print(template+" has no footprint\n");
|
|
continue;
|
|
}
|
|
var shape = cmpFootprint.GetShape();
|
|
var w, h;
|
|
if (shape.type == 'circle') {
|
|
w = h = shape.radius*2;
|
|
} else {
|
|
w = shape.width;
|
|
h = shape.depth;
|
|
}
|
|
|
|
if (x + w >= x1) {
|
|
// Start a new row
|
|
x = x0;
|
|
z += maxh + gap;
|
|
maxh = 0;
|
|
}
|
|
|
|
var cmpPosition = Engine.QueryInterface(ent, IID_Position);
|
|
cmpPosition.MoveTo(x + w/2, z);
|
|
cmpPosition.SetYRotation(Math.PI*3/4);
|
|
|
|
var cmpOwnership = Engine.QueryInterface(ent, IID_Ownership);
|
|
if (cmpOwnership)
|
|
cmpOwnership.SetOwner(1);
|
|
|
|
x += w + gap;
|
|
maxh = Math.max(maxh, h);
|
|
}
|
|
|
|
//]]></Script>
|
|
<Environment>
|
|
<LightingModel>standard</LightingModel>
|
|
<SkySet>default</SkySet>
|
|
<SunColour r="0.811765" g="0.792157" b="0.701961"/>
|
|
<SunElevation angle="0.785398"/>
|
|
<SunRotation angle="5.49779"/>
|
|
<TerrainAmbientColour r="0.313726" g="0.376471" b="0.521569"/>
|
|
<UnitsAmbientColour r="0.501961" g="0.501961" b="0.501961"/>
|
|
<Water>
|
|
<WaterBody>
|
|
<Type>default</Type>
|
|
<Colour r="0.3" g="0.35" b="0.7"/>
|
|
<Height>5</Height>
|
|
<Shininess>150</Shininess>
|
|
<Waviness>8</Waviness>
|
|
<Murkiness>0.45</Murkiness>
|
|
<Tint r="0.28" g="0.3" b="0.59"/>
|
|
<ReflectionTint r="0.28" g="0.3" b="0.59"/>
|
|
<ReflectionTintStrength>0</ReflectionTintStrength>
|
|
</WaterBody>
|
|
</Water>
|
|
</Environment>
|
|
<Camera>
|
|
<Position x="141.287" y="78.0967" z="32.4902"/>
|
|
<Rotation angle="0"/>
|
|
<Declination angle="0.523599"/>
|
|
</Camera>
|
|
<ScriptSettings><![CDATA[
|
|
{
|
|
"Name":"Units Demo",
|
|
"Description":"Every unit in the game.",
|
|
"Keywords": ["demo"],
|
|
"PlayerData":
|
|
[
|
|
{
|
|
"Civ":"hele"
|
|
}
|
|
],
|
|
"RevealMap":true,
|
|
"GameType":"endless"
|
|
}
|
|
]]></ScriptSettings>
|
|
<Entities/>
|
|
<Paths/>
|
|
<Triggers/>
|
|
</Scenario>
|