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

    Runtime error on unit placement

    Scheduled Pinned Locked Moved Map Making
    11 Posts 4 Posters 1.4k 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.
    • A Offline
      andrewthree Moderators
      last edited by

      Ok, i think I figured out what is causing the error. There is something wrong with the factories. I have a different factory for each player, GermanFactory, RussianFactory, etc. Whenever a player builds a factory, the error appears when you try to place the factory, or you try to place any other unit on an existing factory. But if you don't build a factory, the error does not happen.

      Is there a way to have player specific units that are factories? I want to have player specific factories because I want to give the factories each the ability to generate 1 PU per turn, and to make the factories cost different amounts for each player. For example, Italian factories cost 20 PUs but American factories cost 7. The US player can rapidly grow his income by building factories (there is no limit to number of factories which can be built in a territory) but the Italian player will probably build very few. I know how to do the XML properties but something about it is causing an error.

      If I have to use plain old factories which are the same for each player and don't generate extra income (I don't see the point of having income generating factories unless I can make the cost different for each player) I will but i'd really like to have this feature if possible. Thanks

      B 1 Reply Last reply Reply Quote 0
      • B Offline
        beelee @andrewthree
        last edited by

        @andrewthree I would think you can. Each player has it's own "productionFrontier" ? Seems weird it's been working all that time and now isn't.

        Maybe the "isFactory" is screwing things up ? Could just add the factory stuff separate and try that

        1 Reply Last reply Reply Quote 1
        • A Offline
          andrewthree Moderators
          last edited by

          That is what i'm trying now. Still getting error... I wonder if there are certain things that have to be there, or that I should leave out

          B 1 Reply Last reply Reply Quote 0
          • A Offline
            andrewthree Moderators
            last edited by

            This is my unit attachment so far:

            <attachment name="unitAttachment" attachTo="GermanFactory" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
              <option name="attack" value="0"/>
              <option name="defense" value="0"/>
              <option name="createsResourcesList" value="1:PUs"/>
              <option name="isConstruction" value="true"/>
              <option name="constructionType" value="bunker"/>
              <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
              <option name="maxConstructionsPerTypePerTerr" value="1"/>
              <option name='canProduceUnits' value='true'/>
              <option name='canProduceXUnits' value='-1'/>
              <option name='canBeDamaged' value='true'/>
              <option name='maxDamage' value='2'/>
            </attachment>
            
            1 Reply Last reply Reply Quote 0
            • B Offline
              beelee @andrewthree
              last edited by

              @andrewthree hmm...can you post the xml ? The different factories were working before the turn 8 trigger ?

              If you want it to act like regular factory, probably add all the factory stuff.

              Ahh...just saw you latest. Check your properties and make sure the right ones are true. I think you might have to turn some on. Not sure tho. Worth a try 🙂

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

                I would try to remove the trigger you added to the Russians first. See if that eliminates the error. If it does... then you know something is wrong with it and you can now isolate what is wrong with the trigger.

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

                A 1 Reply Last reply Reply Quote 2
                • A Offline
                  andrewthree Moderators @Hepps
                  last edited by

                  @Hepps without the trigger it doesn't work. There is something about my factories that is not working. I don't get it. Maybe I'll just go back to normal factories and find another way to generate PUs.

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

                    @andrewthree I'd have to look at the entire XML to be sure.

                    Good luck

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

                    1 Reply Last reply Reply Quote 2
                    • wc_sumptonW Offline
                      wc_sumpton
                      last edited by

                      @andrewthree

                      What is the error that you are getting? The only error I have received is the "Missing Unit Image" error, because I did not create the factory units in every unit folder. Besides that error, which I ignored, I was able to go several rounds with no problems.

                      I used the 'GermanFactory' as a guide and created the same unit for each player, with different production cost. The factories worked good, even the generated PUs worked. Since the is no 'whenCapturedChangesInto', but no attack or defense the unit could not be taken as a casualty, thus when Germany captured a 'RussianFactory' I received the error stated above. But Germany was still able to use the missing factory to produce units.

                      I also created one 'factory' using the 'GermanFactory' with different production cost for each player. Because each player used the same 'factory' the was no error, and everything worked well.

                      As others have stated, without more information, I have been unable to recreate the problem. But I have tried. Sorry.

                      Cheers...

                      1 Reply Last reply Reply Quote 2
                      • A Offline
                        andrewthree Moderators
                        last edited by

                        Thanks for the responses. I'm glad it's working for somebody. My xml is just screwed up. I'll have to get it straightened out.

                        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