land transport - how to make them work?
-
land transport - how to make them work?
i tried to make a land transport unit and i failed...
what i did:
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="mechanizedInfantry" value="true"/> </attachment>
<attachment name="unitAttachment" attachTo="dabbaba" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="attack" value="6"/> <option name="defense" value="6"/> <option name="movement" value="2"/> <option name="hitPoints" value="2"/> <option name="isLandTransport" value="true"/> <option name="transportCapacity" value="600"/> <option name="maxBuiltPerPlayer" value="8"/> <option name="canNotTarget" value="$dabbabaTargets$"/> </attachment>
<attachment name="unitAttachment" attachTo="infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="attack" value="1"/> <option name="defense" value="2"/> <option name="movement" value="1"/> <option name="transportCost" value="200"/> <option name="isLandTransportable" value="true"/> <option name="artillerySupportable" value="true"/> </attachment>
did i miss something?
-
Everything looks good. You do have a <technology><technologies> and <playerTech> sections set?
Please explain the problems that you are having.
Cheers...
-
it doesn't bring up the load units window when one clicks on it. i assume that it works the same as air transports? i think i recall seeing that on another map i played...
thought i was pretty much done with the mod until i started playing it...
does it need to be listed in the "playerTech" list? paratroopers didn't...
i should probably just delete the unit. was supposed to be a fun unique flavour unit for the ottoman's in steampunk. first prob i found was that the AI doesn't understand the canNotTarget trait and so thinks it's a cheap ubertank and doesn't want to build anything else so i had to give it a max build limit just to force the AI to buy something else... battle calc doesn't get it either... oh well.
-
@cameron said in land transport - how to make them work?:
it doesn't bring up the load units window when one clicks on it. i assume that it works the same as air transports?
No, it does not: it works like normal movement: you pick what you want to move and where you want to move it, and then the engine only moves what is allowed thus to move.
Land transports can also pick up units on the way (like sea transports and unlike air transports).
-
it's not working that way either...
at least i assume what you mean is that one should select the transport and the units to be transported together and then move them to the target territory... -
@cameron You need to have
<technologies> <techname name="mechanizedInfantry"/> </technologies>
at the start of the "technology" section.
I'm actually surprised the game not giving you an error (if it does not) if you have a "techAttachment" option but not a techname for "mechanizedInfantry".
-
interesting... because it doesn't care about "paratroopers" not being there. i'd assumed that this was because they were "hardcoded" techs rather than custom ones...
looks like paratroopers is but mechanizedInfantry isn't as now that i've added them to the tech list they both appear on the player tab but only paratroopers has the "X"...
which means i'll have to do the more complicated triggered tech assignment... which i think i deleted b/c i gave capitals +1 techTocken generation instead of the "science" tech... sorry, i'm getting babbly.EDIT: sorted now with the triggered tech and adding it to the list.
thanks for the help! -
@cameron said in land transport - how to make them work?:
interesting... because it doesn't care about "paratroopers" not being there. i'd assumed that this was because they were "hardcoded" techs rather than custom ones...
looks like paratroopers is but mechanizedInfantry isn't as now that i've added them to the tech list they both appear on the player tab but only paratroopers has the "X"...
which means i'll have to do the more complicated triggered tech assignment... which i think i deleted b/c i gave capitals +1 techTocken generation instead of the "science" tech... sorry, i'm getting babbly.EDIT: sorted now with the triggered tech and adding it to the list.
thanks for the help!"mechanizedInfantry" is as hardcoded as "paratroopers".
I believe that you should not experience any difference for anything which you mention unless motivated by something different which you did.
I don't see any reasons why you would need to use triggers: hardcoded techs can be activated per player at start game via a "techAttachment". If you did this successfully for "paratroopers", you should be able to do the same for "mechanizedInfantry".
I'm fearing you may be using triggers to work around a problem which should rather be reported and fixed.
-
well, my initial use of
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="mechanizedInfantry" value="true"/> </attachment>
didn't work.
but using<attachment name="conditionAttachmentAlwaysTrue" attachTo="Ottoman_Empire" javaClass="RulesAttachment" type="player"> <option name="switch" value="true"/> </attachment> <attachment name="triggerAttachmentmechanizedInfantryForOttoman_Empire" attachTo="Ottoman_Empire" javaClass="TriggerAttachment" type="player"> <option name="conditions" value="conditionAttachmentAlwaysTrue"/> <option name="tech" value="mechanizedInfantry"/> <option name="uses" value="1"/> <option name="when" value="before:GermanyTech"/> </attachment>
did.
i'm not sure how i'd go about reporting it... is that a github thing? oh, i do see a bug reports subforum... still not sure what exactly to report.
EDIT: hmmm... in crazygs_ww1.xml they use
<attachment name="techAttachment" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="techCost" value="20"/> <option name="mechanizedInfantry" value="true"/> </attachment>
and that works, albeit with that weird "techCost" bit of which i know nothing...
-
@cameron Sounds like "techCost" (which is how much it costs to buy tech rolls, default being 5) is needed, which I find something strange if intended at all, but I'm mostly curious about what you did for "paratroopers" instead because you said that worked fine or at least differently.
Definitely, if all you need is giving some "techCost" value too, better doing that than working around with triggers.
-
<attachment name="techAttachment" attachTo="Germany" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="paratroopers" value="true"/> </attachment>
i'm pretty sure for mechanizedInfantry i just copy-pasta'd the paratroopers block and then did a replace all of paratroopers -> mechanizedInfantry.
oh, and as an aside, when i tried commenting out mechanizedInfantry from the tech list after putting in the triggers i did get the error you expected.
-
just tried it with
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="techCost" value="5"/> <option name="mechanizedInfantry" value="true"/> </attachment>
and it failed to work. so triggers it is but i don't know why...
-
@cameron said in land transport - how to make them work?:
just tried it with
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="techCost" value="5"/> <option name="mechanizedInfantry" value="true"/> </attachment>
and it failed to work. so triggers it is but i don't know why...
I suggest you make
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="techCost" value="5"/> <option name="paratroopers" value="true"/> <option name="mechanizedInfantry" value="true"/> </attachment>
and everything else the same between "paratroopers" and "mechanizedInfantry", and, if what happens is that (for the same player) "paratroopers" is active and works while "mechanizedInfantry" does not, report it (as a problem) uploading your map somewhere.
I do agree with going with the triggers so long as the problem (if it is a problem) is not fixed, of course.
-
@cameron
I think @cernel has something here. I believe that "techAttachment" are the same as "rulesAttachment" and "playerAttachment" and that only one is used per player since they are not individually named like triggerAttachment/conditionAttachment. So, if you have:<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="mechanizedInfantry" value="true"/> </attachment> <attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="paratroopers" value="true"/> </attachment>
Then only one "techAttachment" is used. Try doing both together, you don't have to add the "techCost" if you don't want to.
Cheers...
-
yep
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="mechanizedInfantry" value="true"/> <option name="paratroopers" value="true"/> </attachment>
works fine.
i think that with multiple separate entries it just goes with the last one listed... replacing the previous, i guess.well, that was an interesting journey.
thanks, y'all!
-
@cameron said in land transport - how to make them work?:
yep
<attachment name="techAttachment" attachTo="Ottoman_Empire" javaClass="games.strategy.triplea.attachments.TechAttachment" type="player"> <option name="mechanizedInfantry" value="true"/> <option name="paratroopers" value="true"/> </attachment>
works fine.
i think that with multiple separate entries it just goes with the last one listed... replacing the previous, i guess.well, that was an interesting journey.
thanks, y'all!
I assumed that the two options were either within the same attachment or within attachments belonging to different players.
You should just never have more than one attachment having the same name attached to the same player.
-
the Steampunk_Advanced.xml that i've been modding had them like that, as separate entries i mean.
this is my first proper mod so it's all rather new to me.