Remove pre-placed buildings from game map if disabled
Remove pre-placed buildings from game map if disabled
One thing that bothers me is when I go to disable VTOL factories and sometimes Cyborg factories too, the ones that were already placed on the map at the start of the game still remain. There should be a fix where any buildings that are placed on the map which are disabled in the Structure Limits menu disappear once the game starts.
OS: Windows 7 Home Premium 64-bit
Processor: AMD Phenom II X6 1045T (6 CPUs), ~2.7GHz
Memory: 8192MB RAM
Processor: AMD Phenom II X6 1045T (6 CPUs), ~2.7GHz
Memory: 8192MB RAM
Re: Remove pre-placed buildings from game map if disabled
It's possible to do that in WZ 3.2 via rules.js, but not yet implemented.
Code: Select all
// something like this would need adding to rules.js during eventGameInit()
// note: if .name doesn't contain structure string id (eg. "A0LightFactory") then we'd need a property to expose that
// cycle through each player
playerData.forEach(function(data, player) {
var structures = {};
var limit;
// build list of types of structures pre-placed by map for this player
enumStruct(player).forEach(function(structure) {
if (!structures.hasOwnProperty(structure.name)) structures[structure.name] = [];
structures[structure.name].push(structure);
}
// now remove excess structures owned by this player
Object.keys(structures).forEach(function(structureID) {
limit = getStructureLimit(structureID, player);
while (structures[structureID].length > limit) removeObject(structures[structureID].pop());
});
});
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Remove pre-placed buildings from game map if disabled
This would be great.
This is why some features aren't implemented: http://forums.wz2100.net/viewtopic.php?f=30&t=7490&view=unread#p87241