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

    Restrict movement of unit

    Scheduled Pinned Locked Moved Map Making
    16 Posts 4 Posters 4.9k 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.
    • P Offline
      Prussia
      last edited by

      I'm trying to do Japanese Kamikazes

      I want the only land territory Kamiz could land on be Tokyo.

      Then I will restrict the kamiz's movement to seazones surrounding japan.

      However, I do not want to code every territory that the Kamiz cannot enter (since that would be way too many).

      The kamiz could only enter 10 territories or so, I'm hoping I could simply say "Allow Kamiz to only move within these 10 territories."

      redrumR HeppsH 2 Replies Last reply Reply Quote 0
      • redrumR Offline
        redrum Admin @Prussia
        last edited by

        @prussia Unfortunately, I don't think there is currently an inverse territoryEffect option to unitsNotAllowed. The best way to achieve what you want is to add a territoryEffectAttachment to all other territories but those 10 that doesn't allow Kamikaze units (Tokyo and the nearby sea zones). Probably could argue creating the inverse territoryEffect option would be useful.

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

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

          @prussia You could acheive what you want using the new "RequiresUnitToMove" attachment.

          You could simply make a unit that the Kamikazes require to move... then place one of those in all 10 of the SZ and on Tokyo. Then those would be the only places the Kamiz's could move.

          Just make a unit image that defines the terr. or SZ as a move for the Kamiz. A Katana... or the Japanese character for suicide...

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

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

            @hepps I don't think that will work currently as I believe we made "requiresUnitsToMove" units have to be ALLIED to allow movement. This would need to be changed to ALL so if an enemy fleet moves into a sea zone the kamikaze could still move there.

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

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

              @redrum Yes you would just need to add triggers before Japans combat move to change the unit back to a Japanese unit if the Terr. or SZ were caputred... then a trigger to change it back at the end of the combat moves.

              Little bit of work for all 11 territories and SZ.... but it would still be less than having to do a limiting definition to every other Terr. and SZ on the entire map.

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

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

                @hepps Yeah. It does bring up the question on whether "requiresUnitsToMove" should consider ALL instead of ALLIED though. Which I'm starting to think would be better as the default. Could also add a new parameter to it that specifies either OWN/ALLIED/ENEMY/ALL.

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

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

                  @redrum Yes. I do like the idea of being able to set the parameter for the property.

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

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Prussia
                    last edited by

                    We should request the following feature:

                    add a new "movementRestriction" property to units without terrain effect being needed.

                    We already have "placement restriction" so it can't be that more difficult to add "movementRestriction" 😉

                    1 Reply Last reply Reply Quote 0
                    • General_ZodG Offline
                      General_Zod Moderators
                      last edited by

                      You can get away with using territory effects to restrict the unit access and not code every territory on the map. Just give this effect to places that the kamikaze can actually reach from the allowable territories. The amount of territories will depend on the movement your kamikaze have.

                      redrumR 1 Reply Last reply Reply Quote 2
                      • redrumR Offline
                        redrum Admin @General_Zod
                        last edited by

                        @general_zod Good idea. That should make it so you can create a ring of territories with the territoryEffect preventing movement around the 10 or so you want them to be able to move to.

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

                        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