Navigation

    TripleA Logo

    TripleA Forum

    • Register
    • Login
    • Search
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags

    Allow income levels to be checked in conditions.

    Feature Requests & Ideas
    3
    17
    707
    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.
    • VictoryFirst
      VictoryFirst last edited by VictoryFirst

      Similar to "haveResources", it would be nice to have a way to check a player's income level in a condition attachment. Game events could be triggered when a nation's income level is higher or lower than a specific value. How it could look like is as follows:

      <attachment name="conditionAttachmentGermanyProductionCheck" attachTo="Germans" javaClass="RulesAttachment" type="player">
      	<option name="totalTerritoryProduction" value="production" count="20"/> <!-- Checks if Germany's income level is 20 or higher -->
      	<option name="invert" value="true"/> <!-- You can optionally flip it to check if the income level is 19 or lower -->
      

      Edit: made some changes:
      "resourceLevel" -> "totalTerritoryProduction"
      "PUs" -> "production"

      The income levels of all nations are directly displayed in the "Players" tab under the column "Production", so it might be possible to use this information in the XML.

      59f379e9-ad76-446d-baae-62f3b91d7dd0-image.png

      C 1 Reply Last reply Reply Quote 1
      • C
        Cernel Moderators @VictoryFirst last edited by

        @victoryfirst My understanding is that your proposed "resourceLevel" option is equipollent to the already proposed "haveResources" option at the
        https://forums.triplea-game.org/topic/2617/haveresources-as-a-condition-option
        topic. What am I missing if anything?

        If it is, I would close this topic as duplicate.

        CC @wc_sumpton

        VictoryFirst 1 Reply Last reply Reply Quote 2
        • VictoryFirst
          VictoryFirst @Cernel last edited by

          @cernel

          I believe "haveResources" deals with the amount of resources currently in a player's hand. This corresponds to the "PUs" column in the "Players" tab. However, I am talking about the "Production" column which is the sum of the production values of all territories the player controls. This is you amount of PUs you will get at the end of your turn.

          C 1 Reply Last reply Reply Quote 1
          • VictoryFirst
            VictoryFirst last edited by

            Now I am not sure... I've taken a closer look at the thread you linked and it is not clear if "haveResources" deals with income or resources in a player's hand... I also don't know if it has been implemented yet actually.

            1 Reply Last reply Reply Quote 1
            • C
              Cernel Moderators @VictoryFirst last edited by

              @victoryfirst said in Allow income levels to be checked in conditions.:

              @cernel

              I believe "haveResources" deals with the amount of resources currently in a player's hand. This corresponds to the "PUs" column in the "Players" tab. However, I am talking about the "Production" column which is the sum of the production values of all territories the player controls. This is you amount of PUs you will get at the end of your turn.

              Yes, that is the per player stock of the resource at the moment, which needs to be equal or greater than the count to satisfy the condition if @wc_sumpton can confirm it.

              I suggest to change "resourceLevel" to either "production" or "totalTerritoryProduction" or "income".

              If you intend to ignore units generating resources, it would be good to clarify this.

              The opposite of 20 or more in the discrete is 19 or less (not 20 or less).

              W 1 Reply Last reply Reply Quote 2
              • W
                wc_sumpton @Cernel last edited by

                @cernel

                Yes, haveResources would only check the currently held resource. As to production, I will check the engine to see how that is done.

                Cheers...

                W 1 Reply Last reply Reply Quote 2
                • W
                  wc_sumpton @wc_sumpton last edited by

                  @wc_sumpton

                  I believe that the "production" value that @VictoryFirst is talking about is only calculated for territories. It does not look like other sources of PUs, units plus or minus/ objectives plus or minus/ etc... are not included.

                  Cheers...

                  1 Reply Last reply Reply Quote 2
                  • VictoryFirst
                    VictoryFirst last edited by VictoryFirst

                    @Cernel @wc_sumpton

                    Thank you. It's true that "resourceLevel" might be indeed confusing. I suggest calling it "totalTerritoryProduction" because I think it's the clearest description.

                    So "totalTerritoryProduction" should only include the sum of all production values of all territories a player controls, not including any kind of bonus income from objectives or units.

                    I guess "value" can be "production" then instead? So that it looks like this?

                    <attachment name="conditionAttachmentGermanyProductionCheck" attachTo="Germans" javaClass="RulesAttachment" type="player">
                    	<option name="totalTerritoryProduction" value="production" count="20"/> <!-- Checks if Germany's income level is 20 or higher -->
                    	<option name="invert" value="true"/> <!-- You can optionally flip it to check if the income level is 19 or lower -->
                    </attachment>
                    

                    @Cernel You are right, it is indeed 19 or lower... I had a math exam once where my only mistake was exactly that, an error with the boundaries 😅

                    I edited my top post to include these changes.

                    C 1 Reply Last reply Reply Quote 0
                    • C
                      Cernel Moderators @VictoryFirst last edited by

                      @victoryfirst I don't understand why you chanced "PUs" to "production". I think that you should not have.

                      VictoryFirst 1 Reply Last reply Reply Quote 0
                      • VictoryFirst
                        VictoryFirst @Cernel last edited by VictoryFirst

                        @cernel

                        Do you think "PUs" is better? I thought "production" would be better suited as it is also called this way by TripleA. "PUs" would be the resources in your hand, "production" the production level of a nation. Why do you think "PUs" is better?

                        W 1 Reply Last reply Reply Quote 0
                        • W
                          wc_sumpton @VictoryFirst last edited by

                          @victoryfirst, @Cernel

                          Only one value is being checked, so, in essence, name="totalTerritoryProduction" value="20" would work.

                          As an aside note, creating the condition, adding the process to read and write the condition, and developing the method that evaluates the condition is not that hard to do.

                          But creating the internal testing environment is quite a bit more involved. This is the main reason "haveResources", and many of my "improvements" have not been submitted.

                          Cheers...

                          C 1 Reply Last reply Reply Quote 2
                          • C
                            Cernel Moderators @wc_sumpton last edited by

                            @wc_sumpton I forgot that "production" is hardcoded to PUs. My previous posts were based on the wrong assumptions that you could set "production" for any resource.

                            I would actually consider "production" as a legacy option for territory attachments, which should be deprecated.

                            I believe that this feature should apply to any resources (not just PUs), so I would have this looking at the "resources" option for territories and have every instance of
                            <option name="production" value="*"/>
                            be read as
                            <option name="resources" value="PUs" count="*"/>
                            .

                            I also believe that calling this option "resources" was a case of bad naming. Something like "resourcesProduction" would have been better in my opinion, but this is how it is.

                            W 1 Reply Last reply Reply Quote 1
                            • W
                              wc_sumpton @Cernel last edited by

                              @cernel

                              Sure, why not. As it sets right now "haveResources" takes a default value or "PUs", so name="haveResources" value="PUs" count="20" is the same as name="haveResources" value="20".

                              Creating a new condition like "estimatedResourceProduction" would operate in the same manner, the default value would be "PUs". A "value" with more the one resource would add those resources together. And using the "players" option would add the values together of all the players.

                              Again, creation of this condition is very strait forward. It is the internal testing that would cause the delay in submitting a PR.

                              Cheers...

                              1 Reply Last reply Reply Quote 2
                              • VictoryFirst
                                VictoryFirst last edited by

                                @wc_sumpton said in Allow income levels to be checked in conditions.:

                                Only one value is being checked, so, in essence, name="totalTerritoryProduction" value="20" would work.

                                Thanks, I thought you had to include "count" for the numbers. This is indeed better.

                                I wondering what it takes to implement feature requests. I assume you have to write some Java code, but where are the game files stored that you need to modify? Does it work that way?

                                I have no experience with Java, but I'd be eager to learn it. If there is any way I could be of assistance, that would be great.

                                W 1 Reply Last reply Reply Quote 1
                                • W
                                  wc_sumpton @VictoryFirst last edited by wc_sumpton

                                  @victoryfirst

                                  I use IntelliJ IDEA for editing and GitHub Desktop to help manage files. I'm an "old" basic programmer so would be of little help. I just jump in with both feet and try not to drown.

                                  Cheers

                                  1 Reply Last reply Reply Quote 2
                                  • C
                                    Cernel Moderators last edited by

                                    What I was saying is that I think it is needlessly limiting and backward to do anything which refers only to PUs: it should rather be something which refers to any resource so possibly PUs too. However, it is good to have PUs as default if a resource is not specified.

                                    W 1 Reply Last reply Reply Quote 2
                                    • W
                                      wc_sumpton @Cernel last edited by

                                      @cernel said in Allow income levels to be checked in conditions.:

                                      However, it is good to have PUs as default if a resource is not specified.

                                      Yes, this is how both conditions would/have been designed. "haveResources" is already set up in this manner. Whatever the other condition would be called would follow.

                                      Cheers...

                                      1 Reply Last reply Reply Quote 1
                                      • 1 / 1
                                      • First post
                                        Last post
                                      Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums