TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    How can I change unit properties with game options?

    Scheduled Pinned Locked Moved Map Making
    13 Posts 4 Posters 2.2k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B Online
      beelee
      last edited by beelee

      yea this would be the condition

      <option name="conditions" value="tank"/>

      when the option is on it'll fire

      edit oops I mean Penalize not tank 🙂

      1 Reply Last reply Reply Quote 0
      • Jason Green-LoweJ Offline
        Jason Green-Lowe
        last edited by Jason Green-Lowe

        Thanks! Seems like a good start.

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          ff03k64 @Jason Green-Lowe
          last edited by

          @Jason-Green-Lowe I assume the message disappearing means you figured it out?

          1 Reply Last reply Reply Quote 1
          • Jason Green-LoweJ Offline
            Jason Green-Lowe
            last edited by

            I forgot to replace "unit" with "tank," I'm not sure it's working, but at least it's not crashing. Still testing.

            1 Reply Last reply Reply Quote 0
            • Jason Green-LoweJ Offline
              Jason Green-Lowe
              last edited by

              This line is still hard for me to understand:

              		<option name="unitAttachmentName" value="UnitAttachment" count="unitAttachment"/>
              

              Can you explain what that's doing?

              1 Reply Last reply Reply Quote 0
              • Jason Green-LoweJ Offline
                Jason Green-Lowe
                last edited by

                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>
                
                1 Reply Last reply Reply Quote 0
                • Jason Green-LoweJ Offline
                  Jason Green-Lowe
                  last edited by

                  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>
                  
                  F 1 Reply Last reply Reply Quote 0
                  • F Offline
                    ff03k64 @Jason Green-Lowe
                    last edited by

                    @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.

                    1 Reply Last reply Reply Quote 1
                    • Jason Green-LoweJ Offline
                      Jason Green-Lowe
                      last edited by

                      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! 🙂

                      F 1 Reply Last reply Reply Quote 2
                      • F Offline
                        ff03k64 @Jason Green-Lowe
                        last edited by

                        @Jason-Green-Lowe Good luck with the rest of it!

                        1 Reply Last reply Reply Quote 3
                        • LaFayetteL Offline
                          LaFayette Admin
                          last edited by

                          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.

                          1 Reply Last reply Reply Quote 3

                          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
                          • 1 / 1
                          • First post
                            Last post
                          Powered by NodeBB Forums