How can I change unit properties with game options?
-
Thanks! Seems like a good start.
-
@Jason-Green-Lowe I assume the message disappearing means you figured it out?
-
I forgot to replace "unit" with "tank," I'm not sure it's working, but at least it's not crashing. Still testing.
-
This line is still hard for me to understand:
<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>Can you explain what that's doing?
-
Yeah, the code isn't throwing any errors, but it's also not having any effect -- the tank is still attacking at its normal value on amphibious assault. Not sure what's wrong. I feel like my trigger isn't adequately linked to my condition -- how does the trigger know when to go off?
<attachment name="PenalizeGermanTank" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="gameProperty" value="Penalize Heavy Equipment During Amphibious Assault"/> </attachment> <attachment name="triggerAttachmentPenalizeGermanTank" attachTo="Germans" javaClass="TriggerAttachment" type="player"> <option name="unitType" value="tank"/> <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/> <option name="unitProperty" value="isMarine" count="-3"/> </attachment> -
OK, fixed it. Thanks for the help! It's working now. It's a medium-sized pain to have to add a separate condition and trigger for each unit for each country, but I can get it done.
<attachment name="PenalizeGermanTank" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="gameProperty" value="Penalize Heavy Equipment During Amphibious Assault"/> </attachment> <attachment name="triggerAttachmentPenalizeGermanTank" attachTo="Germans" javaClass="TriggerAttachment" type="player"> <option name="conditions" value="PenalizeGermanTank"/> <option name="unitType" value="tank"/> <option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/> <option name="unitProperty" value="isMarine" count="-3"/> </attachment> -
@Jason-Green-Lowe said in How can I change unit properties with game options?:
OK, fixed it. Thanks for the help! It's working now. It's a medium-sized pain to have to add a separate condition and trigger for each unit for each country, but I can get it done.
I am guessing you will only need to use one condition for everything. And i think it would be worth trying a colon separated list for the unitType. That might help you not have to do as much. Might not either.
-
Different units have slightly different penalties, because I'm trying to set all the heavy equipment's attack values equal to 1. I was able to double up on the halftrack and jeep, since they both attack at 2, normally. Anyway, done now. Thanks again for the help!

-
@Jason-Green-Lowe Good luck with the rest of it!
-
FWIW, being able to specify unit stats at the start of a game is something I've wanted to build in for some time. Having to do triggers to get the same effect is clearly a workaround, so I'm sorry you're having to go through that pain. Hopefully some time in 2021 this will be a built in feature.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login