MartinF said:
Perhaps the constants idea is the way to go.. but it would be a bit complicated and messy since it would be up to the author of the mod to correctly define the units there. Maybe rig something with the item value? You could scan a whole bunch of items using this and then look at item value vs in-game strength. Take out the extremes and then work that out into a formula of sorts. I think armor especially should be considered since that really makes a big difference to unit durability. As for global unit type (infantry/ranged/cavalry), there's troop_is_guarantee_horse and troop_is_guarantee_ranged. While those aren't always used for ranged units, they should be.
I inspected the autoloot code and didn't think it was a good direction. It's a fine work-around but requires that item values grow in a predictable way. I've found that in many mods that item values for new and more powerful articles are rarely consistent with the old Native set if they're even consistent with themselves. You can get around this with some guesswork and hackery like most engineering problems, but it adds a precondition to the system in a place that you might not expect.
I dunno. It might just be because I've been doing this for too long. I tend to not trust anything which I can't independently verify myself that requires someone else to get something right
[quote author=Mordachai]
Since we don't necessarily want to trust the top guy in a stack to be representative of everyone in the stack... can we spawn 100 parties of that template, and then average out the top guy in each stack, and then throw away those stacks? Is it fast enough to do that (use a disabled flag or something so that they don't trigger anything else)?
[/quote]
You could probably do this at startup where the cost woudn't be as noticeable. This is most likely the least intrusive solution.
[quote author=Mordachai]
Also - is there really absolutely no facilities in this module system for iterating through the party template tuples directly?
[/quote]
I've taken up the hobby of spellunking in the operations header source which lists out all the functions available in script. If it's there, I haven't been able to identify it.
[quote author=Mordachai]
Is there another modder out there with enough experience to answer whether it would be possible to (reasonably) extend the module system code to allow you to do so?
In fact, do the primitives that the module system uses come from python, or are they part of the game engine, or (as I suspect), a combination of both?
[/quote]
I'll let someone else field this one for real, but IMO, the simplest thing is probably to hack up the compiling process and add whatever data you need at that point.
I think each primitive is a part of the executable. I haven't seen anything in the python code or compilation process to lead me to believe otherwise. I've been poking around in there a bit.
> Edited for clarity and because I probably like the world "probably" too much.