krt0143 Posted September 21, 2023 Report Share Posted September 21, 2023 I'm making some Mercenaries, but since they shouldn't be available in unlimited numbers like you own champions, I've tried to limit their numbers using the "hero" units' limit system. So I added into their template this: <Identity> <VisibleClasses datatype="tokens">Ranged Archer</VisibleClasses> <GenericName>Elite Mercenary</GenericName> </Identity> <TrainingRestrictions> <Category>Elite Mercenary</Category> <MatchLimit>20</MatchLimit> </TrainingRestrictions> Unfortunately, as long as they have that "TrainingRestrictions" part, I can't train a single of them! The games states "You can train 20 of them" all right, but when I click on the icon nothing happens. It doesn't get added to the queue. Now when I remove this "TrainingRestrictions" part, I can train them just fine, so it is clearly something about the "TrainingRestrictions" syntax I've missed. Any ideas what it could be? Quote Link to comment Share on other sites More sharing options...
Grapjas Posted September 21, 2023 Report Share Posted September 21, 2023 (edited) @krt0143Did you define the limitation in template_player.xml? I'm actually not that up to date with the current code but you could look into it. Edited September 21, 2023 by Grapjas Quote Link to comment Share on other sites More sharing options...
krt0143 Posted September 21, 2023 Author Report Share Posted September 21, 2023 38 minutes ago, Grapjas said: Did you define the limitation in template_player.xml? That was it, now it works. I knew there must be something missing... Thanks a lot! 1 Quote Link to comment Share on other sites More sharing options...
krt0143 Posted October 3, 2023 Author Report Share Posted October 3, 2023 So... I think I've observed that the entry in "template_player.xml" indeed limits how many you can have at a given time, but the "TrainingRestrictions" entry inside the unit file fixes the maximum amount you can train during the whole game session. Is that true? I'm using it to manage my "mercs" (champion units I've built because Britons are champion-starved): There are several types (pikes, archers, siege) but to keep some balance, you can only have a limited amount of them at the same time: Their general limit is 20 mercs at any time, but you can buy 30 of each type (except siege, which is unique, like a hero unit), so you can mix & match depending on what you need: 20 archers, or 20 pikemen, or 10+10. It seems to work as intended, but I've not tested it really extensively either. I'm wondering if I won't make all high grade (champion units) a limited resource (only x of them available during a game session). After all, populations were very limited back then, and highly trained/exceptional units were extremely rare and long to train. If you're being reckless, at some point you should run out of them. Now of course the problem is the AI, if it can't handle that limitation it will eventually "run out" and become an easy prey. And I'm indeed afraid it can't handle it, having seen it waste its unique heroes unnecessarily, one after the other, for no purpose (once an AI hero unit attacked my fortress all alone, under the fire of 2 towers and the fortress itself. Needless to say it died...). Now since I always play the same civilizations, I might do this just for my civilization, and let the AI wield its unlimited unit cornucopia as before. Hmm. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted October 3, 2023 Report Share Posted October 3, 2023 4 hours ago, krt0143 said: So... I think I've observed that the entry in "template_player.xml" indeed limits how many you can have at a given time, but the "TrainingRestrictions" entry inside the unit file fixes the maximum amount you can train during the whole game session. Is that true? Right. Just use the player.xml class to restrict normally. Use the additional entry in the unit xml to restrict for whole match (if you want to. If you don't, then you don't need that line) 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.