Ticket #1198: skirmish.diff

File skirmish.diff, 33.0 KB (added by sanderd17, 11 years ago)
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    107107
    108108    // Init map types
    109109    var mapTypes = getGUIObjectByName("mapTypeSelection");
    110     mapTypes.list = ["Scenario","Random"];
    111     mapTypes.list_data = ["scenario","random"];
     110    mapTypes.list = ["Scenario","Skirmish","Random"];
     111    mapTypes.list_data = ["scenario","skirmish","random"];
    112112
    113113    // Setup map filters - will appear in order they are added
    114114    addFilter("Default", function(settings) { return settings && !keywordTestOR(settings.Keywords, ["naval", "demo", "hidden"]); });
     
    471471    switch (g_GameAttributes.mapType)
    472472    {
    473473    case "scenario":
     474    case "skirmish":
    474475        mapFiles = getXMLFileList(g_GameAttributes.mapPath);
    475476        break;
    476477
     
    532533        switch (g_GameAttributes.mapType)
    533534        {
    534535        case "scenario":
     536        case "skirmish":
    535537            g_MapData[name] = Engine.LoadMapSettings(g_GameAttributes.mapPath+name);
    536538            break;
    537539
     
    656658        g_GameAttributes.mapPath = "maps/scenarios/";
    657659        break;
    658660
     661    case "skirmish":
     662        g_GameAttributes.mapPath = "maps/skirmish/";
     663        g_GameAttributes.settings = {
     664            PlayerData: g_DefaultPlayerData.slice(0, 4),
     665            Seed: Math.floor(Math.random() * 65536),
     666            CheatsEnabled: g_GameAttributes.settings.CheatsEnabled
     667        };
     668        break;
     669
    659670    case "random":
    660671        g_GameAttributes.mapPath = "maps/random/";
    661672        g_GameAttributes.settings = {
     
    959970
    960971        break;
    961972
     973    case "skirmish":
     974        mapSizeText.caption = "Default";
     975        numPlayersText.caption = numPlayers;
     976        numPlayersSelection.hidden = true;
     977        mapSize.hidden = true;
     978        if (g_IsController)
     979        {   //Host
     980            revealMap.hidden = false;
     981            victoryCondition.hidden = false;
     982            lockTeams.hidden = false;
     983            populationCap.hidden = false;
     984            startingResources.hidden = false;
     985           
     986            numPlayersText.hidden = false;
     987            mapSizeText.hidden = false;
     988            revealMapText.hidden = true;
     989            victoryConditionText.hidden = true;
     990            lockTeamsText.hidden = true;
     991            populationCapText.hidden = true;
     992            startingResourcesText.hidden = true;
     993           
     994            // Update map preview
     995            getGUIObjectByName("mapPreview").sprite = "cropped:(0.78125,0.5859375)session/icons/mappreview/" + getMapPreview(mapName);
     996           
     997            revealMapText.caption = "Reveal map:";
     998            revealMap.checked = (mapSettings.RevealMap ? true : false);
     999
     1000            victoryConditionText.caption = "Victory condition:";
     1001            victoryCondition.selected = victoryIdx;
     1002            lockTeamsText.caption = "Teams locked:";
     1003            lockTeams.checked = (mapSettings.LockTeams ? true : false);
     1004        }
     1005        else
     1006        {
     1007            // Client
     1008            numPlayersText.hidden = false;
     1009            mapSizeText.hidden = false;
     1010            revealMapText.hidden = false;
     1011            victoryConditionText.hidden = false;
     1012            lockTeamsText.hidden = false;
     1013            populationCap.hidden = true;
     1014            populationCapText.hidden = false;
     1015            startingResources.hidden = true;
     1016            startingResourcesText.hidden = false;
     1017            // Update map preview
     1018            getGUIObjectByName("mapPreview").sprite = "cropped:(0.78125,0.5859375)session/icons/mappreview/" + getMapPreview(mapName);
     1019
     1020            revealMapText.caption = (mapSettings.RevealMap ? "Yes" : "No");
     1021            victoryConditionText.caption = VICTORY_TEXT[victoryIdx];
     1022            lockTeamsText.caption = (mapSettings.LockTeams ? "Yes" : "No");
     1023        }
     1024
     1025        break;
     1026
     1027
    9621028    case "scenario":
    9631029        // For scenario just reflect settings for the current map
    9641030        numPlayersSelection.hidden = true;
     
    10461112                pCivText.caption = g_CivData[civ].Name;
    10471113            pTeamText.caption = (team !== undefined && team >= 0) ? team+1 : "-";
    10481114        }
    1049         else if (g_GameAttributes.mapType == "random")
     1115        else if (g_GameAttributes.mapType != "scenario")
    10501116        {
    10511117            pCivText.hidden = true;
    10521118            pCiv.hidden = false;
  • binaries/data/mods/public/gui/loading/loading.js

     
    4646        var mapName = data.attribs.settings.Name;
    4747        switch (data.attribs.mapType)
    4848        {
     49        case "skirmish":
    4950        case "scenario":
    5051            loadingMapName.caption = "Loading \"" + mapName + "\"";
    5152            break;
  • binaries/data/mods/public/maps/scenarios/Acropolis

     
    2307823078        </Entity>
    2307923079    </Entities>
    2308023080    <Paths/>
    23081 </Scenario>
    23082  No newline at end of file
     23081</Scenario>
  • binaries/data/mods/public/simulation/components/SkirmishReplacer.js

     
     1const civList = ["general", "athen", "brit", "cart", "celt", "gaul", "hele", "iber", "mace", "maur", "pers", "rome", "spart"];
     2
     3function SkirmishReplacer() {}
     4
     5
     6SkirmishReplacer.prototype.Schema = "";
     7for each (var civ in civList)
     8    SkirmishReplacer.prototype.Schema +=
     9        "<optional>" +
     10            "<element name='"+civ+"' a:help='Replacement template for this civ. If this element is not present, the \"general\" element (with {civ} replaced by the civ code) is taken. If this element is empty, or not defined, and also no general element, this entity is just deleted.'>" +
     11                "<text/>" +
     12            "</element>" +
     13        "</optional>";
     14
     15
     16
     17SkirmishReplacer.prototype.Init = function()
     18{
     19};
     20
     21SkirmishReplacer.prototype.OnOwnershipChanged = function(msg)
     22{
     23    if (msg.to == 0)
     24        warn("Skirmish map elements can only be owned by regular players. Please delete entity "+this.entity+" or change the ownership to a non-gaia player.");
     25};
     26
     27/**
     28 * Replace this entity with a civ-specific entity on the first turn
     29 */
     30SkirmishReplacer.prototype.OnUpdate = function(msg)
     31{
     32    var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player);
     33    var civ = cmpPlayer.GetCiv();
     34
     35    var templateName = "";
     36    if (civ in this.template)
     37        templateName = this.template[civ];
     38    else if ("general" in this.template)
     39        templateName = this.template.general;
     40
     41    if (!templateName || civ == "gaia")
     42    {
     43        Engine.DestroyEntity(this.entity);
     44        return;
     45    }
     46   
     47    templateName = templateName.replace(/\{civ\}/g, civ);
     48
     49    var cmpCurPosition = Engine.QueryInterface(this.entity, IID_Position);
     50    var replacement = Engine.AddEntity(templateName);
     51    var cmpReplacementPosition = Engine.QueryInterface(replacement, IID_Position)
     52    var pos = cmpCurPosition.GetPosition2D();
     53    cmpReplacementPosition.JumpTo(pos.x, pos.y);
     54    var rot = cmpCurPosition.GetRotation();
     55    cmpReplacementPosition.SetYRotation(rot.y);
     56    var cmpCurOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
     57    var cmpReplacementOwnership = Engine.QueryInterface(replacement, IID_Ownership);
     58    cmpReplacementOwnership.SetOwner(cmpCurOwnership.GetOwner());
     59
     60    Engine.DestroyEntity(this.entity);
     61};
     62
     63Engine.RegisterComponentType(IID_SkirmishReplacer, "SkirmishReplacer", SkirmishReplacer);
  • binaries/data/mods/public/simulation/components/interfaces/SkirmishReplacer.js

     
     1Engine.RegisterInterface("SkirmishReplacer");
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_civil_centre.xml

     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_civic_civil_centre">
     3  <Identity>
     4    <Civ>skirm</Civ>
     5  </Identity>
     6  <SkirmishReplacer>
     7    <general>structures/{civ}_civil_centre</general>
     8  </SkirmishReplacer>
     9  <VisualActor>
     10    <Actor>structures/athenians/civic_centre_new.xml</Actor>
     11  </VisualActor>
     12</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_gate.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_civil_centre.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_gate">
     3  <Footprint>
     4    <Square width="39.0" depth="8.0"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Obstructions>
     12      <Right width="12" depth="6.5" x="12.5" z="0"/>
     13      <Left width="12" depth="6.5" x="-12.5" z="0"/>
     14      <Door width="13" depth="6.5" x="0" z="0"/>
     15    </Obstructions>
     16  </Obstruction>
     17  <SkirmishReplacer>
     18    <general>structures/{civ}_wall_gate</general>
     19    <spart/>
     20  </SkirmishReplacer>
     21  <VisualActor>
     22    <Actor>structures/hellenes/wall_gate.xml</Actor>
     23  </VisualActor>
     24  <WallPiece>
     25    <Length>38.0</Length>
     26  </WallPiece>
     27</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_long.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_gate.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_long">
     3  <Footprint>
     4    <Square width="37" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="36.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <general>structures/{civ}_wall_long</general>
     15    <spart/>
     16  </SkirmishReplacer>
     17  <VisualActor>
     18    <Actor>structures/hellenes/wall_long.xml</Actor>
     19  </VisualActor>
     20  <WallPiece>
     21    <Length>36.0</Length>
     22  </WallPiece>
     23</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_medium.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_long.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_medium">
     3  <Footprint>
     4    <Square width="25" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="24.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <general>structures/{civ}_wall_medium</general>
     15    <spart/>
     16  </SkirmishReplacer>
     17  <VisualActor>
     18    <Actor>structures/hellenes/wall_medium.xml</Actor>
     19  </VisualActor>
     20  <WallPiece>
     21    <Length>24.0</Length>
     22  </WallPiece>
     23</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_short.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_medium.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_short">
     3  <Footprint>
     4    <Square width="13" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="12.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <general>structures/{civ}_wall_short</general>
     15    <spart/>
     16  </SkirmishReplacer>
     17  <VisualActor>
     18    <Actor>structures/hellenes/wall_short.xml</Actor>
     19  </VisualActor>
     20  <WallPiece>
     21    <Length>12.0</Length>
     22  </WallPiece>
     23</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_tower.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_short.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_tower">
     3  <Footprint replace="">
     4    <Circle radius="6.2"/>
     5    <Height>15.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="10" depth="10"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <general>structures/{civ}_wall_tower</general>
     15    <spart/>
     16  </SkirmishReplacer>
     17  <VisualActor>
     18    <Actor>structures/hellenes/wall_tower.xml</Actor>
     19  </VisualActor>
     20  <WallPiece>
     21    <Length>10</Length>
     22  </WallPiece>
     23</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_gate.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/default_wall_tower.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_gate">
     3  <Footprint>
     4    <Square width="37.0" depth="9.5"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Obstructions>
     12      <Right width="10" depth="8.5" x="13" z="0"/>
     13      <Left width="10" depth="8.5" x="-13" z="0"/>
     14      <Door width="16.0" depth="8.5" x="0" z="0"/>
     15    </Obstructions>
     16  </Obstruction>
     17  <SkirmishReplacer>
     18    <iber>structures/iber_wall_gate</iber>
     19  </SkirmishReplacer>
     20  <VisualActor>
     21    <Actor>structures/iberians/wall_gate.xml</Actor>
     22  </VisualActor>
     23  <WallPiece>
     24    <Length>36.0</Length>
     25  </WallPiece>
     26</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_long.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_gate.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_long">
     3  <Footprint>
     4    <Square width="37" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="36.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <iber>structures/iber_wall_long</iber>
     15  </SkirmishReplacer>
     16  <VisualActor>
     17    <Actor>structures/iberians/wall_long.xml</Actor>
     18  </VisualActor>
     19  <WallPiece>
     20    <Length>36.0</Length>
     21  </WallPiece>
     22</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_medium.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_long.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_medium">
     3  <Footprint>
     4    <Square width="25" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="24.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <iber>structures/iber_wall_medium</iber>
     15  </SkirmishReplacer>
     16  <VisualActor>
     17    <Actor>structures/iberians/wall_medium.xml</Actor>
     18  </VisualActor>
     19  <WallPiece>
     20    <Length>24.0</Length>
     21  </WallPiece>
     22</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_short.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_medium.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_short">
     3  <Footprint>
     4    <Square width="13" depth="9"/>
     5    <Height>9.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="12.0" depth="8"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <iber>structures/iber_wall_short</iber>
     15  </SkirmishReplacer>
     16  <VisualActor>
     17    <Actor>structures/iberians/wall_short.xml</Actor>
     18  </VisualActor>
     19  <WallPiece>
     20    <Length>12.0</Length>
     21  </WallPiece>
     22</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_tower.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_short.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_structure_defense_wall_tower">
     3  <Footprint replace="">
     4    <Circle radius="6.2"/>
     5    <Height>15.0</Height>
     6  </Footprint>
     7  <Identity>
     8    <Civ>skirm</Civ>
     9  </Identity>
     10  <Obstruction>
     11    <Static width="10" depth="10"/>
     12  </Obstruction>
     13  <SkirmishReplacer>
     14    <iber>structures/iber_wall_tower</iber>
     15  </SkirmishReplacer>
     16  <VisualActor>
     17    <Actor>structures/iberians/wall_tower.xml</Actor>
     18  </VisualActor>
     19  <WallPiece>
     20    <Length>10</Length>
     21  </WallPiece>
     22</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/units/default_cavalry.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/structures/iber_wall_tower.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_unit_cavalry">
     3  <Identity>
     4    <Civ>skirm</Civ>
     5  </Identity>
     6  <Promotion disable=""/>
     7  <SkirmishReplacer>
     8    <general>units/{civ}_cavalry_javelinist_b</general>
     9    <celt>units/celt_cavalry_swordsman_b</celt>
     10    <gaul>units/gaul_cavalry_swordsman_b</gaul>
     11    <hele>units/hele_cavalry_swordsman_b</hele>
     12    <iber>units/iber_cavalry_spearman_b</iber>
     13    <maur>units/maur_support_elephant</maur>
     14    <rome>units/rome_cavalry_spearman_b</rome>
     15  </SkirmishReplacer>
     16  <VisualActor>
     17    <Actor>units/athenians/cavalry_javelinist_b.xml</Actor>
     18  </VisualActor>
     19</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_melee_b.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/units/default_cavalry.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_unit_infantry_melee">
     3  <Identity>
     4    <Civ>skirm</Civ>
     5  </Identity>
     6  <Promotion disable=""/>
     7  <SkirmishReplacer>
     8    <general>units/{civ}_infantry_spearman_b</general>
     9    <rome>units/rome_infantry_swordsman_b</rome>
     10  </SkirmishReplacer>
     11  <VisualActor>
     12    <Actor>units/athenians/infantry_spearman_b.xml</Actor>
     13  </VisualActor>
     14</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_ranged_b.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_melee_b.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_unit_infantry_ranged">
     3  <Identity>
     4    <Civ>skirm</Civ>
     5  </Identity>
     6  <Promotion disable=""/>
     7  <SkirmishReplacer>
     8    <general>units/{civ}_infantry_javelinist_b</general>
     9    <athen>units/athen_infantry_slinger_b</athen>
     10    <brit>units/brit_infantry_slinger_b</brit>
     11    <cart>units/cart_infantry_archer_b</cart>
     12    <maur>units/maur_infantry_archer_b</maur>
     13    <pers>units/pers_infantry_archer_b</pers>
     14  </SkirmishReplacer>
     15  <VisualActor>
     16    <Actor>units/athenians/infantry_slinger_b.xml</Actor>
     17  </VisualActor>
     18</Entity>
  • binaries/data/mods/public/simulation/templates/skirmish/units/default_support_female_citizen.xml

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/units/default_infantry_ranged_b.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
     1<?xml version="1.0" encoding="utf-8"?>
     2<Entity parent="template_unit_support_female_citizen">
     3  <Identity>
     4    <Civ>skirm</Civ>
     5  </Identity>
     6  <SkirmishReplacer>
     7   <general>units/{civ}_support_female_citizen</general>
     8  </SkirmishReplacer>
     9  <VisualActor>
     10    <Actor>units/athenians/female_citizen.xml</Actor>
     11  </VisualActor>
     12</Entity>
  • source/graphics/MapReader.cpp

    Property changes on: binaries/data/mods/public/simulation/templates/skirmish/units/default_support_female_citizen.xml
    ___________________________________________________________________
    Added: svn:mime-type
    ## -0,0 +1 ##
    +text/plain
    \ No newline at end of property
     
    6464}
    6565
    6666// LoadMap: try to load the map from given file; reinitialise the scene to new data if successful
    67 void CMapReader::LoadMap(const VfsPath& pathname, CTerrain *pTerrain_,
     67void CMapReader::LoadMap(const VfsPath& pathname,  const CScriptValRooted& settings, CTerrain *pTerrain_,
    6868                         WaterManager* pWaterMan_, SkyManager* pSkyMan_,
    6969                         CLightEnv *pLightEnv_, CGameView *pGameView_, CCinemaManager* pCinema_, CTriggerManager* pTrigMan_, CPostprocManager* pPostproc_,
    7070                         CSimulation2 *pSimulation2_, const CSimContext* pSimContext_, int playerID_, bool skipEntities)
     
    8383    m_PlayerID = playerID_;
    8484    m_SkipEntities = skipEntities;
    8585    m_StartingCameraTarget = INVALID_ENTITY;
     86    m_ScriptSettings = settings;
    8687
    8788    filename_xml = pathname.ChangeExtension(L".xml");
    8889
     
    116117    if (pPostproc)
    117118        pPostproc->SetPostEffect(L"default");
    118119
    119     // load map settings script
    120     RegMemFun(this, &CMapReader::LoadScriptSettings, L"CMapReader::LoadScriptSettings", 50);
     120    // load map or script settings script
     121    if (settings.undefined())
     122        RegMemFun(this, &CMapReader::LoadScriptSettings, L"CMapReader::LoadScriptSettings", 50);
     123    else
     124        RegMemFun(this, &CMapReader::LoadRMSettings, L"CMapReader::LoadRMSettings", 50);
    121125
    122126    // load player settings script (must be done before reading map)
    123127    RegMemFun(this, &CMapReader::LoadPlayerSettings, L"CMapReader::LoadPlayerSettings", 50);
     
    138142    RegMemFun(this, &CMapReader::DelayLoadFinished, L"CMapReader::DelayLoadFinished", 5);
    139143}
    140144
    141 
    142145// LoadRandomMap: try to load the map data; reinitialise the scene to new data if successful
    143146void CMapReader::LoadRandomMap(const CStrW& scriptFile, const CScriptValRooted& settings, CTerrain *pTerrain_,
    144147                         WaterManager* pWaterMan_, SkyManager* pSkyMan_,
  • source/graphics/MapReader.h

     
    5353    ~CMapReader();
    5454
    5555    // LoadMap: try to load the map from given file; reinitialise the scene to new data if successful
    56     void LoadMap(const VfsPath& pathname, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*,
     56    void LoadMap(const VfsPath& pathname, const CScriptValRooted& settings, CTerrain*, WaterManager*, SkyManager*, CLightEnv*, CGameView*,
    5757        CCinemaManager*, CTriggerManager*, CPostprocManager* pPostproc, CSimulation2*, const CSimContext*,
    5858            int playerID, bool skipEntities);
    5959
  • source/ps/Game.cpp

     
    146146    {
    147147        // Load scenario attributes
    148148        std::wstring mapFile;
     149        // let settings undefined to take map file settings instead
     150        CScriptValRooted settings;
    149151        m_Simulation2->GetScriptInterface().GetProperty(attribs.get(), "map", mapFile);
    150152
    151         m_World->RegisterInit(mapFile, m_PlayerID);
     153        m_World->RegisterInit(L"scenarios/"+mapFile, settings, m_PlayerID);
    152154    }
    153155    else if (mapType == "random")
    154156    {
     
    160162        m_Simulation2->GetScriptInterface().GetProperty(attribs.get(), "settings", settings);
    161163
    162164        m_World->RegisterInitRMS(scriptFile, settings, m_PlayerID);
     165    }
     166    else if (mapType == "skirmish")
     167    {
     168        // Load skirmish attributes
     169        std::wstring mapFile;
     170        CScriptValRooted settings;
     171
     172        m_Simulation2->GetScriptInterface().GetProperty(attribs.get(), "map", mapFile);
     173        m_Simulation2->GetScriptInterface().GetProperty(attribs.get(), "settings", settings);
     174
     175        m_World->RegisterInit(L"skirmish/"+mapFile, settings, m_PlayerID);
    163176    }
    164177
    165178    if (m_IsSavedGame)
  • source/ps/World.cpp

     
    6565/**
    6666 * Initializes the game world with the attributes provided.
    6767 **/
    68 void CWorld::RegisterInit(const CStrW& mapFile, int playerID)
     68void CWorld::RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings, int playerID)
    6969{
    7070    // Load the map, if one was specified
    7171    if (mapFile.length())
    7272    {
    73         VfsPath mapfilename(VfsPath("maps/scenarios") / (mapFile + L".pmp"));
     73        VfsPath mapfilename(VfsPath("maps/") / (mapFile + L".pmp"));
    7474        CMapReader* reader = 0;
    7575
    7676        try
     
    7777        {
    7878            reader = new CMapReader;
    7979            CTriggerManager* pTriggerManager = NULL;
    80             reader->LoadMap(mapfilename, m_Terrain,
     80            reader->LoadMap(mapfilename, settings, m_Terrain,
    8181                CRenderer::IsInitialised() ? g_Renderer.GetWaterManager() : NULL,
    8282                CRenderer::IsInitialised() ? g_Renderer.GetSkyManager() : NULL,
    8383                &g_LightEnv, m_pGame->GetView(),
  • source/ps/World.h

     
    7373    /*
    7474    Initialize the World - load the map and all objects
    7575    */
    76     void RegisterInit(const CStrW& mapFile, int playerID);
     76    void RegisterInit(const CStrW& mapFile, const CScriptValRooted& settings, int playerID);
    7777
    7878    /*
    7979    Initialize the World - generate and load the random map
  • source/simulation2/Simulation2.cpp

     
    388388        {
    389389            // Load scenario attributes
    390390            std::wstring mapFile;
     391            CScriptValRooted settings;
    391392            m_ComponentManager.GetScriptInterface().GetProperty(m_InitAttributes.get(), "map", mapFile);
    392393
    393394            VfsPath mapfilename(VfsPath("maps/scenarios") / (mapFile + L".pmp"));
    394             mapReader->LoadMap(mapfilename, &secondaryTerrain, NULL, NULL, NULL, NULL, NULL, NULL,
     395            mapReader->LoadMap(mapfilename, settings, &secondaryTerrain, NULL, NULL, NULL, NULL, NULL, NULL,
    395396                NULL, NULL, &secondaryContext, INVALID_PLAYER, true); // throws exception on failure
    396397        }
    397398        else
  • source/simulation2/components/tests/test_Pathfinder.h

     
    6666        sim2.ResetState();
    6767
    6868        CMapReader* mapReader = new CMapReader(); // it'll call "delete this" itself
     69        CScriptValRooted settings;
    6970
    7071        LDR_BeginRegistering();
    71         mapReader->LoadMap(L"maps/scenarios/Median Oasis 01.pmp", &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     72        mapReader->LoadMap(L"maps/scenarios/Median Oasis 01.pmp", settings, &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    7273            &sim2, &sim2.GetSimContext(), -1, false);
    7374        LDR_EndRegistering();
    7475        TS_ASSERT_OK(LDR_NonprogressiveLoad());
  • source/simulation2/tests/test_Serializer.h

     
    642642        sim2.ResetState();
    643643
    644644        CMapReader* mapReader = new CMapReader(); // it'll call "delete this" itself
     645        CScriptValRooted settings;
    645646
    646647        LDR_BeginRegistering();
    647         mapReader->LoadMap(L"maps/scenarios/Latium.pmp", &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     648        mapReader->LoadMap(L"maps/scenarios/Latium.pmp", settings, &terrain, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
    648649            &sim2, &sim2.GetSimContext(), -1, false);
    649650        LDR_EndRegistering();
    650651        TS_ASSERT_OK(LDR_NonprogressiveLoad());