1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/maps/scenarios/Units_demo.xml
Ykkrosh dd501b2a5a # Add initial basic player AI framework.
Support direct access to serializer streams, so serializers can be
nested.
Make component script "this.template" read-only.
Stop globally-subscribed component scripts receiving messages posted to
local components, to reduce out-of-sync risks.
Move pathfinder data out of entity template directory.
Fix GuiInterface deserialization.

This was SVN commit r8865.
2011-01-12 12:29:00 +00:00

103 lines
2.3 KiB (Stored with Git LFS)
XML

<?xml version="1.0" encoding="UTF-8"?>
<Scenario version="5">
<Terrain patches="12" texture="blackness" priority="0" height="16384"/>
<Script><![CDATA[//
var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
var entityTemplates = cmpTemplateManager.FindAllTemplates(true);
var patches = 12;
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(/^(special\/|actor\|)/)) 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);
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>
<SkySet>default</SkySet>
<SunColour r="1.5" g="1.5" b="1.5"/>
<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>