'Militia' Python. Civics Spawn Units From Improvements.
Brought to you by:
archid
The Current version of this spawns a Unit on Construction of the Improvement, when that civic is activate.
It might be nice to have the second option of it also being able to spawn repeatedly.
I am not sure how the spawning rate works at the moment, but it would be good if that were definable too, so it could be very slow or very fast depending on how it is set each time. Rather than being one fixed rate spawning rate across the board.
The current spawning mechanism is controlled by the Handicap and GameSpeed, but the improvement can apply a percentage modifier to this. The code is this:
If you don't want the improvement to keep spawning then you can set the <iSpawnRatePercentage> tag on the improvement to 0.
I still need to add something that will spawn a unit when the improvement is built as that doesn't exist yet. The existing lairs do that in the map generation code.
That sounds good!
I think the spawn on creation is important, so thank you for working on that.
It will allow things like forts to spawn a static defence turret and stuff under certain conditions. which will be cool!
With the improvement spawn rate, can it be both +/- percentage so it can be made slower and faster than the norm?
That would be cool! :D
The rate is a percentage so 50 halves the spawn rate whilst 200 doubles it
There is no 'under certain conditions' in this it will spawn a unit when it is built and/or randomly
So we couldn't for example have
Civic A, make Improvement A, Spawn Unit A at 50% speed
And
Civic B, make Improvement A, Spawn Unit A at 150% speed
And (when ported)
Trait A, make Improvement A, Spawn Unit A at 100% speed
My guess with this last one is that it would potential clash with Civic A or B and explode?
hmmm for some reason I cannot see the last comment you wrote, it only seems to be in my email.
Anyway...
That I dea for putting the rates/effects into improvements is fine by me. Do you think we could also have a trait one as well?
Same deal?
No, it wouldn't clash as the tags all go in the ImprovementInfo.
We could make the Civic & Traits AND or OR with regard to requirement but the spawn rate would be independent so both would apply.
LOVE IT!
At the moment there is no text for Improvement spawning stuff in the Civic Screen, at the moment I am using the help text to apply it, but an automated feature like for other stuff (Unit cost changes, building prereqs, etc.) Would be great to have!
Also it seems that the spawn code is broken, I just made farms spawn units when built when militia civic is active, but now when a unit touches a garden tile, the garden is destroyed as a lair.. Also it seems the 'civic requirement' doesn't seem to have any effect either, as the garden spawns a unit whether the civic is active or not..
Can we remove lair destruction, and just use the standard pillage system?
Last edit: Lib Spit 2015-06-03