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

    No Such Element Exception

    Scheduled Pinned Locked Moved Map Making
    14 Posts 5 Posters 1.7k Views 5 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.
    • redrumR Offline
      redrum Admin @RogerCooper
      last edited by redrum

      @RogerCooper It appears you have a map that is relying on default player colors where you have more than 8 players and there are only 8 defaults defined in TripleA. If you edit the map to define player colors for all players or all but 8 or less, it should work.

      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

      RogerCooperR RoiEXR 2 Replies Last reply Reply Quote 0
      • RogerCooperR Offline
        RogerCooper @redrum
        last edited by

        @redrum Here is the map.properties file. Is there somewhere else I need to define the colors?

        #Color settings for the map, values must be in 6 digit hex form
        color.Uthgardian_Empire=ffff80
        color.Pirates_Of_Razor_Pass=808081
        color.Dragonfire_Coast_Federation=ff0001
        color.Gandar_Republic=004080
        color.Burusian_Empire=808001
        color.League_Of_Kahnbrek=008001

        units.scale=1.00
        map.showCapitolMarkers=false
        map.width=3500
        map.height= 2000
        map.scrollWrapX=false

        should we draw territory names

        map.showTerritoryNames=true
        map.showSeaZoneNames=true

        redrumR 1 Reply Last reply Reply Quote 0
        • redrumR Offline
          redrum Admin @RogerCooper
          last edited by

          @RogerCooper That looks fine. Either it isn't reading your properties file or you have lots of other players with their colors defined. If you send me the map, I can take a look.

          TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

          RogerCooperR 1 Reply Last reply Reply Quote 0
          • RogerCooperR Offline
            RogerCooper @redrum
            last edited by

            @redrum 6Kingdoms.zip
            Note that there are no other players at all.

            HeppsH 1 Reply Last reply Reply Quote 0
            • HeppsH Offline
              Hepps Moderators @RogerCooper
              last edited by

              @RogerCooper Do the other errors that repeat equal all the players listed in the properties file?

              "A joyous heart sours with the burden of expectation"
              Hepster

              RogerCooperR 1 Reply Last reply Reply Quote 0
              • RogerCooperR Offline
                RogerCooper @Hepps
                last edited by

                @Hepps The error repeats many times, far more than 6.

                I was able to fix the problem with the other scenario (I was missing a player in map.properties).

                Note that small portion of the map is displayed with colors.

                6_Kingdoms.png

                redrumR 1 Reply Last reply Reply Quote 0
                • redrumR Offline
                  redrum Admin @RogerCooper
                  last edited by

                  @RogerCooper It loads fine for me. Can you double check that you don't have multiple versions of it in your maps folder?

                  TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                  RogerCooperR 1 Reply Last reply Reply Quote 0
                  • RogerCooperR Offline
                    RogerCooper @redrum
                    last edited by

                    @redrum Only 1 version. It does not work for me when zipped either.

                    redrumR 1 Reply Last reply Reply Quote 0
                    • redrumR Offline
                      redrum Admin @RogerCooper
                      last edited by redrum

                      @RogerCooper Hmm. And you are using 1.9.0.0.13066 or a pre-release version? I just tested with 1.9.0.0.13066 with the zipped map and see this:
                      14440d0c-2fb8-418a-aadd-eb65877867f0-image.png

                      TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                      RogerCooperR 1 Reply Last reply Reply Quote 0
                      • RogerCooperR Offline
                        RogerCooper @redrum
                        last edited by

                        @redrum I am using the prerelease (19049)

                        1 Reply Last reply Reply Quote 0
                        • RoiEXR Offline
                          RoiEX Admin @redrum
                          last edited by

                          @redrum Nice to hear that the stacktraced seems to be cause by such a "simple" problem, but I found the stacktrace super confusing nevertheless.
                          Would it be easy to add some sort of pre-condition so we would fail to parse a map when the engine noticed there aren't enough default colors? I think a simpler error message would be desirable here.

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            danelyoung
                            last edited by

                            The NoSuchElementException in Java is thrown when one tries to access an iterable beyond its maximum limit. This means that, this exception is thrown by various accessor methods to indicate that the element being requested does not exist . The next() method in Java returns the next element in the iteration or NoSuchElementException if the iteration has no more elements.

                            As with most programming languages, the Iterator class includes a hasNext() method that returns a boolean indicating if the iteration has anymore elements. If hasNext() returns true, then the next() method will return the next element in the iteration otherwise raise exceptions if the iteration has no more elements.

                            if(input.hasNextInt() )
                                 number1 = input.nextInt(); // if there is another number  
                            else 
                                 number1 = 0; // nothing added in the input
                            
                            RogerCooperR 1 Reply Last reply Reply Quote 0
                            • RogerCooperR Offline
                              RogerCooper @danelyoung
                              last edited by

                              @danelyoung The scenario is still not working in pre-release, but works in the stable version.

                              1 Reply Last reply Reply Quote 0

                              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
                              Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums