Monument resource storage 1 is type 14 (Monuments captured), amount 1, mode 2 (give back and reset after death)
-
for KOTH mode, it checks if resource 14 (monuments captured) == 1, and then gives a countdown based on that. it does this for each player. monuments currently have their resource storage value 1 set to type 14, amount 0, mode 2 (gives back the resource after the building is converted or destroyed, exactly the same as how a unit takes 1 pop until its converted or destroyed). now knowing this, you can theoretically set an effect that affects resource 14 directly, bypassing the need for a monument. current idea to make this work for RMS where you have multiple monuments and want players to be able to control multiple monuments such that they need N monuments to get the countdown, but would like them to be able to own N+M monuments without breaking the KOTH countdown, is to initialize a technology at the monument which researches this technology every time you capture it.
-
[5:22 PM]
based on research, NOT based on decompiling. so i may be wrong about how exactly it works, but thats what testing showed
- [5:22 PM]
note that for a repeatable technology initialized at a building, you must own ZERO of that building in order for the technology to initiate again. that also includes formerly owned buildings converted to another player, at least when tested with autoconverting buildings. this was not tested versus monks with redemption, so they may work in a different manner (edited)
my current goal is to place one monument for each player, and have it function such that owning one or more of these monuments has a working king of the hill countdown. (If you just naively place multple monuments down on the map, when a player captures a new monument the monuments captured resource goes over 1, stopping the countdown). this will require a dat mod so that initializing technology works, or alternatively an XS script that can do xsEffectAmount(cModResource, 14, cAttributeSet, 1), where 14 is the integer value of Monuments Captured
Here’s how to probably do it in an XS script. Note that A. I didn’t test this code, and B. XS scripts do not issues, as I last checked, transfer to spectators, a major flaw. You can check the status of XS script transferring on ugc.aoe2.rocks
Also, you’d need to put it in a rule so that it can run every few gameticks
resourceMonumentsCaptured = 14;
P1_Monuments = xsPlayerAttribute(1, resourceMonumentsCaptured );
xsEffectAmount(cModResource, resourceMonumentsCaptured, cAttributeSet, 1);
XS Reference:
Functions Reference - xsPlayerAttribute