production rule name doesn't matter, set quantity to -ve to indicate upgrade rule.
above rules say, buy 1 mech for 4pu, upgraded to 1 mech for 3pu.
higher quantities will still work with negative values.
placelimit is the minimum PU the territory must be to place this unit there (only applies to factories)
upgrades applies to any unit, a list of the unit types this unit can upgrade.
unitProduction applies to factories only, sets the production of this factory regardless of where it is placed.
maxProduction sets production at this territory. Still required for starting factory territories.
don't use unitProduction at the same time.
<property name="Place Factory On Island" value="false" editable="false"> <boolean/> </property>
can factories be placed on islands or not.
think that is it.
some general oddness, upgrading a factory places a new one, which then cannot be used.
so place units in a T before upgrading the factory.
upgrading other units follows all rules for normal purchases, i.e. you need to do it at a factory
and it uses a production slot.
looking at this now.
need clarification on some things regarding bombing.
are the limits on damage (both for PU and production)
currently working correctly?
currently damage _per_ plane is limited to PU of the territory under certain circumstances.
which generally makes no difference, as the total damage limit is handled later.
however if this was combined with damage to things that can take more damage than the T PU
then it is odd.
so for example using factory damage to unit production in a territory with PU of 3.
a single plane could only do 3 damage, when it should be allowed to do 6 as far as i'm aware.
kev if you read this, i imagine this will also be an issue with your bases in low PU territories.
I'm mostly curious if this currently occurs with the particular rules of any maps, and want to verify that it is indeed not per the rules.
any other bugs at all with strat bombing people are aware of i'd like to know now.
As far as I am aware, current bombing rules and damage, and _hit, works perfectly.
(although there is a bug when you have multiple factories damaged, and multiple kinds of factories. download my map, pacific 1940, and damage a factory, to see this)
Here is a more complete explaination of the rules:
1) ww2v2 revised rules: when bombing, the damage is not done to the factory, but is instead done to the bank. If the player has 20 pu's, and you bomb germany for 6, then they lose 6 pu's. If they have only 12 pu's, and you bomb them for 18, then they lose all 12 pu's. Nothing else is affected.
2) Territory Turn Limit Property: this property will work under both ww2v2 and ww2v3 rules. Basically it says that territories (ie: factories) can only be bombed UP TO the value of the territory, per turn. So if the Caucasus is worth 4, then Germany can only do 4 damage to it. If it is ww2v2 rules, then that damage is PU's lost. If it is ww2v3 rules, then that damage is actual damage to the factory, which will have to be repaired to produce any units there.
3) ww2v3 aa50 rules: when bombing, the damage is done to the factory, and remains on the factory even if the factory switches sides, etc. Factories can be damaged up to TWICE the value of the territory (can be over-riden with TTL). So if Germany is worth 10, then the factory can take up to 20 damage. You are damaging the ability of the factory to produce units. So the damage goes from 10 production, to negative 10 production. In order to produce units, you must repair it to positive production.
Any unit with Strategic Bomber can bomb a factory. Rockets also hurt factories.
Rockets follow special rules, again different between versions of a&a. Generally, rockets follow their own version of TTL rules.
my ww2v2 revised is per plane limited but not per turn limited.
that is, bombing a PU 2 factory with 5 planes results in 0-10 PU loss.
shouldn't it either be 0-30 or 0-2?
there are just too many properties and i don't know the rulesets well enough.
Boolean limitDamage = isWW2V2() || isLimitSBRDamageToProduction() || !m_targets.isEmpty();
is not gonna be valid though in future though.
assuming m_targets.isEmpty() is for when you choose between a factory and airbase etc.
then all such attacks will be per plane limited to puv. which is not desired.
just a note. I sea the pacific map tries to "fake" larger factory by using
production = 8
unitProduction = 10
this doesn't quite work, so if any other maps do this, they need to be changed.
the reason is the unitProduction value is the value used to track damage
if you do this, then your territory will start with 10 production
but as soon as it takes any damage it will revert to 8.
actually the game may crash if you took exactly 1 damage, i didn't really look.
but anyway that won't matter anymore.
you can now specify an attachment option unitProduction
always declare maxProduction after production. (as production defaults maxProduction)
do not use unitProduction at all. unless you deliberately want a temporary increase. or you want to force a player to repair on turn 1(this won't work if you also declare maxProduction) or production==unitProduction
regardless of new factories, you can now use maxProduction to set permanent arbitrary production in a territory, although it will be overridden if you place a factory with unitProduction value.
I don't think any of this will work with maps using non production damage factories, but you could try if you really wanted to.
have not yet dealt with upgrading factories, or limits on placement locations of factories.
this is one of the things we need for the next generation of a&a games (ie: global 1940). we need multiple factory types that can produce X amount (and take 2*X damage). The factory types are capable of producing up to X no matter where they the factory is located (so even if located in a territory worth 3 or worth 1000, they can only produce up to X).
Did you see what happens in pacific 1940 map when a factory is damaged? the next turn when the player is asked to repair that damage, they are shown BOTH factory types, even though they only have 1 factory damaged. It is pretty weird.
Anyway, I tested with 18.104.22.168 and can confirm that unitProduction being higher than production does not cause any bugs (and it does not reset to 8 when damaged).
If damaged by 1 point, the game continues and the player can produce 9 units there.
From what your post says, it looks like you are changing "unitProduction" to "maxProduction", while making a new unit attachment called "unitProduction".
If that is true, then it will mean a re-write of a ton of maps. If possible, could we keep unitProduction as it is named right now, and then call your awesome new unit-attachment something else? Like, how about "factoryProduction" or something?
in ww2v2 Revised, damage per ROLL (or plane? i dunno) is limited to the value of the territory
so attacking a factory in a territory worth 2, the max damage you can do per plane is 2.
So with 10 planes, you could do up to 0-20 damage.
TTL just means value of the territory per turn.
so attacking a territory worth 2 with 10 planes, you could do 0-2 damage
I should also mention that in ww2v1 Classic, there is something called "originalFactory" (i think), which means that any factory you controlled at the beginning of the game has infinite unit production. I'm sure this can be combined with all the other properties and rules to result in cool and weird combinations.
so.... ya, there are 5 rules-sets now supported, with little to no documentation. (sorry, only just joined the project).
I'll admit I didn't test extensively with pac40 before I made my changes, so the bug with showing both
types might have magically gone away now, i'll take a look tomorrow in any case and see if i can replicate it.
In the end I didn't bother trying to sort out wtf is going on with all the rulesets, i didn't change any of it. assume if something doesn't work someone will notice at some point.
regrading the change to the xml files, it is not strictly necessary to change any existing maps.
if production=unitProduction those maps would have worked fine, and will continue to do so.
if production!=unitproduction then they were broken before, and still are now.
you have the option of fixing them by changing unitProduction to maxProduction.
the name on the unit type attachment won't conflict with anything, there is no crossover from unitattachments to territoryattachments, sorry if its confusing that i called it unitProduction i didn't really consider it at the time.
incidentally, the reason why I didn't simply change what unitProduction does is to do with
how the data is set, both when parsed from file and during runtime. the name itself is used to invoke a method, so to change it requires that you hunt down every reference in the code.
tricky, especially considering someone could do something like.....
callSetOn( "uni" + "tProduc" + "tion" );
and you'd have no show in hell of finding that. not that i think anything like that is in the code, but its at least possible.
and yes, before you point it out, having people set a runtime variable from the xml is retarded in the extreme. I think perhaps it was never intended to be used from there.
ok I looked at that bug with it showing both factory types.
short version is, all repair rules are applied to all territories that are damaged
i could fix this but won't bother.
whenever kev gets around to doing repair for airbases/naval bases he will have to deal with
I am going to wait til after kev finishes his work to commit this patch. We may need to change some stuff depending on what kev has done, or not done, or w/e.
Anyway, i do have one comment:
you created a new property, "Place Factory On Island"
not sure if it defaults to false or true,
but if it defaults to true, that is bad because all properties should default to false
and if it defaults to false, then that is bad because currently ALL maps should be allowed to place factories on islands, so this would have to be added to all maps
i recommend changing to "Can Not Place Factory On Island"
which defaults to false
(and inverting any if statement that uses this property, etc.)
oh, i see it defaults to false,
anyway, that is still bad for the reason above,
i can make this change for you if you want..., but like i said i will wait for kev (hope he won't take too long...)
Just a question, I was putting together a scenario with those stuff like a damaged factory, but now when I start the game, all the factories are damaged, I have to repair them all first, does any one know what I'm doing wrong?
You have to set the "unitProduction" value="put the territory value here" as a territory attachement for all those territories where you have a factory.
<attatchment name="territoryAttatchment" attatchTo="Japan" javaClass="games.strategy.triplea.attatchments.TerritoryAttachment" type="territory"> <option name="production" value="8"/> <option name="unitProduction" value="8"/> <option name="capital" value="Japan"/> </attatchment> The result is a non damaged factory from start. You can lower the unitproduction value to start with some damage if you like.