Allow unlimited number of placements at factory?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Allow unlimited number of placements at factory?

Frostion
I am having a hard time cracking this one. Could someone please tell me what XML setup and code I must use to allow factories to have unlimited placement ability?

It should hopefully work under these circumstances:
• There is only one factory type.
• All factories should be able to allow an unlimited number of placements (or alternately a high fixed number).
• The territories where the factories are placed give no income at all.
• The factories should work at capital territories as well as non-capital territories.

Maybe I am having trouble because my land territories give no income? Or am I just overlooking something simple and obvious, and that would be totally noob-like  (even though I have always seen all the placement options as a little confusing) No matter what I have tried, I always end up with the factories only allowing one unit to be placed

EDIT: I just reposted this in the ”general” section and removed it from the “development” section. Am I right when thinking development referes to development of the game engine and not the maps?
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

crazy_german
There are many potential ways to do this. The easiest way is just to set "canProduceXUnits" = 1,000 (or some other really big number) and "canProduceUnits" = true

DO NOT include "isFactory". Instead set all the individual options. You most likely also want
"isInfrastructure"= true
"isConstruction"= true (plus the couple of options that go with it)
"canBeDamaged" = true (plus options that go with it)

Hope this helps
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

Frostion
This post was updated on .
canProduceXUnits and canProduceUnits are already set. And so is isInfrastructure and isConstruction.
Why would I need canBeDamaged? I don’t plan on the factory to be damaged or lose placement ability.

I just can’t see what the problem is, or what I am missing. Maybe someone can spot it in the code, so I will post it here.

This is a factory (a United Federation of Planets space station):
<attatchment name="unitAttatchment" attatchTo="UFP-Space-Station" javaClass="games.strategy.triplea.attatchments.UnitAttachment" type="unitType">
            <option name="isInfrastructure" value="true"/>
            <option name="canProduceUnits" value="true"/>
            <option name="canProduceXUnits" value="10"/>
            <option name="isConstruction" value="true"/>
            <option name="constructionType" value="Space Station"/>
            <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
            <option name="maxConstructionsPerTypePerTerr" value="1"/>
            <option name="whenCapturedChangesInto" value="any:Borg:true:Assimilated-UFPSS:1"/>
            <option name="createsResourcesList" value="2:Supplies"/>
            <option name="repairsUnits" value="Command-Cruiser:Adv-Cruiser:Heavy-Cruiser:Light-Cruiser:Escort-Cruiser:Scout-Ship"/>
</attatchment>

This is the territory where the above factory is placed and it will only allow 1 placement:
<attatchment name="territoryAttatchment" attatchTo="Federation Outpost" javaClass="games.strategy.triplea.attatchments.TerritoryAttachment" type="territory">
            <option name="production" value="0"/>
            <option name="victoryCity" value="1"/>
            <option name="originalOwner" value="Federation"/>
</attatchment>

This is the entire xml: Star_Trek_Dilithium_War.xml
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

crazy_german
You don't need canBeDamaged (sorry if that was confusing. Just something you might have wanted)

I don't know why that wouldn't be working. I will take a look.
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

crazy_german
In reply to this post by Frostion
The issue is in your property list. I do not know which property however. It might be this
        <property name="Place in Any Territory" value="true" editable="false">
            <boolean/>
        </property>
But I couldn't test it. If not, there is something in the Age of Tribes property list that makes it work.

I put those exact unit attachments in another game's xml, it worked fine. I replaced the property list with your XML's property list, and it reverts to the limit being the territory's income, or 1 if the income is 0.

Great art and creative use of the engine by the way
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

Frostion
This post was updated on .
EDIT:
I deleted this post as I thought I had found a solution, but I have not.
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

Frostion
This post was updated on .
In reply to this post by crazy_german
I have been looking a bit at the property possibilities. One thing that confuses me is the "Placement Restricted By Factory" property. There seems to be conflicting information:

http://axisandallies.wikia.com/wiki/Factories:
Placement Restricted By Factory - Limits the number of units that can be placed at a factory to the production value of the territory.
http://axisandallies.wikia.com/wiki/Placement_Restricted_By_Factory: 
This property limits the number of units that can be placed at Factories.

At the same time there is a different (and presumably more correct) explanation in the pact_of_steel_2.xml:
“Placement Restricted By Factory” warns the player whenever they try to produce more units than their factories can handle (can be turned off for individual players using rules attachments for unlimitedProduction)

Has this property changed over time? Is there some way to get this to work as it is described in the wiki? That would maybe solve my problem.
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

GhostWriter
i am playing an early AAA variant, i think 1942, which i have renamed Iron Blitz. (or not? - does AAA have an Iron Blitz map?)

anyway, the following allows for unlimited unit placement in this game:

            <attatchment name="territoryAttatchment"  attatchTo="Wake Island" javaClass="games.strategy.triplea.attatchments.TerritoryAttachment" type="territory" >
                    <option name="production" value="0" />
                    <option name="originalFactory" value="true" />
            </attatchment>

note that only the line "<option name="originalFactory" value="true" />" has been added to this XML file entry.

note also, that the territory has an income value of zero...

hope this helps, GhostWriter
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

Frostion
@GhostWriter
I just tried the originalFactory thing. There are still complications. As this feature is described, it allows the original owner of the territory to place an unlimited number of units, but the problem is that any other player who captures it is again limited to 1 placement (at least on my map).

Is it not the same on your map?
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

crazy_german
That is how original factory works (and how it is supposed to)

I am pretty sure there is some global property related to factories that will fix this. You could try and use the property list from Europe 1940, since that map has factories that produce exactly 10 units.
Correctly crazy, disingenuously German
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

Frostion
This post was updated on .
Finally some progress!  The following territory attachment works with the following property, resulting in allowing 10 placements and a 0 PU income.

<attatchment name="territoryAttatchment" attatchTo="Federation Outpost" javaClass="games.strategy.triplea.attatchments.TerritoryAttachment" type="territory">
<option name="production" value="0"/>
<option name="unitProduction" value="10"/>
<option name="victoryCity" value="1"/>
<option name="originalOwner" value="Federation"/>
</attatchment>


<property name="Damage From Bombing Done To Units Instead Of Territories" value="true" editable="false">
<boolean/>
</property>


I was trying to make use the following information in the Pact_of_Steel_2.xml, but could not get it to work.:
Line2354:
the following options are allowed for "territoryAttatchment"
production values: the PU production of the territory. also sets unitProduction to the same value. (If setting unitProduction separately, please set "production" before setting "unitProduction")
productionOnly values: this sets "production" without setting "unitProduction"
unitProduction values: unitProduction defaults to whatever "production" is, so please set it after you set "production"
If using property, "Damage From Bombing Done To Units Instead Of Territories", damage will be done to an individual Unit instead of a Territory.
"unitProduction" lets you set the unit production potential of a territory, separate from the production. This means a territory with unitProduction = 2 will be able to produce 2 units there, regardless of if production is 0 or 20.
(The damage potential of these units will normally be 2x the unitProduction, but this can be set individually by creative use of maxDamage and canProduceXUnits)


The final crucial bit that I had to know about this system is written about 100 lines further down. It was under the Territory Attachments section:
Line 2427:
unitProduction …. used with newer maps which are using the new damage rules ("Damage From Bombing Done To Units Instead Of Territories"), which have damage done to an individual Unit instead of a Territory.
When used with these rules, "unitProduction" lets you set the unit production potential of a territory, separate from the production. This means a territory with unitProduction = 2 will be able to produce 2 units there, regardless of if production is 0 or 20.


So the "Damage From Bombing Done To Units Instead Of Territories" was needed. I had not thought about something like this, as I have not implemented any sort of bombing in my map. Thx for the help and suggestions guys, I was really on the verge of giving op and scrapping the map altogether.
Reply | Threaded
Open this post in threaded view
|

Re: Allow unlimited number of placements at factory?

crazy_german
Frostion wrote
So the "Damage From Bombing Done To Units Instead Of Territories" was needed. I had not thought about something like this, as I have not implemented any sort of bombing in my map. Thx for the help and suggestions guys, I was really on the verge of giving op and scrapping the map altogether.
Please don't scrap it, it looks awesome so far

I'm guessing that to date, no map had complex production rules without bombing, so this property just hadn't been checked thoroughly. This is really odd and I might test to see if there is a better way when I get some time.

If for some reason this solution stops working, there are other ways to do this. An easy example, just set all territories to 10 production, but then give a National Objective of -10 for each territory held. Then you could just use standard factory options (but hey if your way works, don't mess with it)
Correctly crazy, disingenuously German