Ticket #3174: disable_ptol_lighthouse.patch

File disable_ptol_lighthouse.patch, 2.4 KB (added by Itms, 9 years ago)

Disable the lighthouse on maps full of little water spots

  • binaries/data/mods/public/maps/random/belgian_uplands.json

     
    77        "BaseTerrain" : ["temp_grass", "temp_grass_b", "temp_grass_c", "temp_grass_d", "temp_grass_long_b", "temp_grass_clovers_2", "temp_grass_mossy", "temp_grass_plants"],
    88        "BaseHeight" : 0,
    99        "Preview" : "belgian_uplands.png",
     10        "TriggerScripts": [
     11            "scripts/disable_ptol_lighthouse.js"
     12        ],
    1013        "XXXXXX" : "Optionally define other things here, like we would for a scenario"
    1114    }
    1215}
  • binaries/data/mods/public/maps/scenarios/Belgian_Bog_night.xml

     
    7070    }
    7171  ],
    7272  "Preview": "belgian_bog_night.png",
    73   "RevealMap": false
     73  "RevealMap": false,
     74  "TriggerScripts": [
     75    "scripts/disable_ptol_lighthouse.js"
     76  ]
    7477}
    7578]]></ScriptSettings>
    7679    <Entities>
  • binaries/data/mods/public/maps/scripts/disable_ptol_lighthouse.js

     
     1let cmpPlayerManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager);
     2
     3for (let i = 1; i < cmpPlayerManager.GetNumPlayers(); ++i)
     4{
     5    let cmpPlayer = Engine.QueryInterface(cmpPlayerManager.GetPlayerByID(i), IID_Player);
     6    if (cmpPlayer)
     7        cmpPlayer.AddDisabledTemplate("structures/ptol_lighthouse");
     8}
  • binaries/data/mods/public/maps/skirmishes/Belgian

     
    5555    }
    5656  ],
    5757  "Preview": "belgian_bog.png",
    58   "RevealMap": false
     58  "RevealMap": false,
     59  "TriggerScripts": [
     60    "scripts/disable_ptol_lighthouse.js"
     61  ]
    5962}
    6063]]></ScriptSettings>
    6164    <Entities>