Announcement

Collapse
No announcement yet.

[SUPPORT] Advanced Turn Based Tile Toolkit

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Monokkel View Post
    That is a bug, and not one I was aware of. Thanks a lot for letting me know.
    Managed to fix it. Not really a bug, It's just how widgets work. https://forums.unrealengine.com/deve...d-right-clicks

    I just put an invisible button under skill buttons. A bit hacky but it works.

    Comment


      Hi Monokkel,

      I've been trying to change up the turn,so a turn would go in phases, for example, on the start of a players turn it would go:
      phase 1: player movement, phase 2: player melee combat, phase 3: player shooting..etc. cycling through each unit of that player. Then the next player or ai would go repeating all the phases cycling through all their units. Then a new turn would start cycling all over again. I'm new at this and cant seem to find an answer yet so if you or anyone has any advice I would appreciate it.
      BTW love your toolkit and thanks in advance.

      Comment


        Originally posted by ClaimedInfinity View Post

        Managed to fix it. Not really a bug, It's just how widgets work. https://forums.unrealengine.com/deve...d-right-clicks

        I just put an invisible button under skill buttons. A bit hacky but it works.
        Ok, thanks a lot for letting me know. I was aware of that issue and thought I had fixed it long ago, but apparently not. I'll make sure to fix it in the next update.

        Originally posted by Fat Daddee View Post
        Hi Monokkel,

        I've been trying to change up the turn,so a turn would go in phases, for example, on the start of a players turn it would go:
        phase 1: player movement, phase 2: player melee combat, phase 3: player shooting..etc. cycling through each unit of that player. Then the next player or ai would go repeating all the phases cycling through all their units. Then a new turn would start cycling all over again. I'm new at this and cant seem to find an answer yet so if you or anyone has any advice I would appreciate it.
        BTW love your toolkit and thanks in advance.
        Definitely possible, but will require a bit of tweaking. I'll look into it later today and see if I can find a good approach for this.
        Advanced Turn Based Tile Toolkit (Marketplace - Support)

        Dungeon Crawler Toolkit (Marketplace - Support)

        Discord

        Comment


          Originally posted by Fat Daddee View Post
          Hi Monokkel,

          I've been trying to change up the turn,so a turn would go in phases, for example, on the start of a players turn it would go:
          phase 1: player movement, phase 2: player melee combat, phase 3: player shooting..etc. cycling through each unit of that player. Then the next player or ai would go repeating all the phases cycling through all their units. Then a new turn would start cycling all over again. I'm new at this and cant seem to find an answer yet so if you or anyone has any advice I would appreciate it.
          BTW love your toolkit and thanks in advance.
          Ok, I've quickly hacked something together which should work as a first step. I've modified BP_Unit so that instead of activating the default ability of the unit, it activates a move or attack ability depending on which turn it currently is, circling through a move ability and two attack abilities (using the same attack ability twice here just as a demonstration). You would probably want something less hard coded in terms of ability selection, as well as maybe having a separate turn counter for "real" turns, but it is a starting point:

          Advanced Turn Based Tile Toolkit (Marketplace - Support)

          Dungeon Crawler Toolkit (Marketplace - Support)

          Discord

          Comment


            Originally posted by Monokkel View Post

            Ok, I've quickly hacked something together which should work as a first step. I've modified BP_Unit so that instead of activating the default ability of the unit, it activates a move or attack ability depending on which turn it currently is, circling through a move ability and two attack abilities (using the same attack ability twice here just as a demonstration). You would probably want something less hard coded in terms of ability selection, as well as maybe having a separate turn counter for "real" turns, but it is a starting point:

            Thank you for your time and pointing me in the direction to go, I couldn't figure out where to get started (really new at this). I'll dive into it tonight when I get home. Thanks again.

            Comment


              Just bought your turn based tile tool kit, currently using 4.24.1 of unreal

              When I load the test map I am I see the box grid, when I try running the test game am only able to select the different units but I cant get any of them to move anywhere on the map not getting any draw path indicator for grid spaces.. do I have to do anything if I am using latest version of Unreal?

              Comment


                Originally posted by AlbertFive View Post
                Just bought your turn based tile tool kit, currently using 4.24.1 of unreal

                When I load the test map I am I see the box grid, when I try running the test game am only able to select the different units but I cant get any of them to move anywhere on the map not getting any draw path indicator for grid spaces.. do I have to do anything if I am using latest version of Unreal?
                Hmm, that is odd. Have not heard of that issue before. The toolkit should work right out of the box for UE4.24. You are creating the project by selecting Create Project from the Vault in the Epic Games launcher and then selecting 4.24? Opening the newly created project should take you straight to the Example map (which is hexagonal), and pressing play in editor should result in a functional game. Have you made any modifications or attempted to migrate assets?
                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                Dungeon Crawler Toolkit (Marketplace - Support)

                Discord

                Comment


                  Originally posted by Monokkel View Post

                  Hmm, that is odd. Have not heard of that issue before. The toolkit should work right out of the box for UE4.24. You are creating the project by selecting Create Project from the Vault in the Epic Games launcher and then selecting 4.24? Opening the newly created project should take you straight to the Example map (which is hexagonal), and pressing play in editor should result in a functional game. Have you made any modifications or attempted to migrate assets?

                  I start unreal and open the project it asks if I want to open copy of project. have not made any changes at all just opening project and trying to run it and only being able to select unit but cant click to get movement path or anything.

                  Comment


                    Originally posted by AlbertFive View Post


                    I start unreal and open the project it asks if I want to open copy of project. have not made any changes at all just opening project and trying to run it and only being able to select unit but cant click to get movement path or anything.
                    Ok, that is the message you get when you are trying to open an older version of ATBTT in a newer version of Unreal Engine. To fix this, create a new ATBTT project from the launcher (you can find the toolkit in the Vault at the bottom of your Library tab). You should get a prompt where you can select the Engine version. Select 4.24 and it should work:

                    Advanced Turn Based Tile Toolkit (Marketplace - Support)

                    Dungeon Crawler Toolkit (Marketplace - Support)

                    Discord

                    Comment


                      If I want to set up a tile so I can have multiple type of tiles to represent Hills, forests ect and make it so tiles can be selected like units cans be selected not just units how do I make terrain clickable so I can access the terrain tile information?

                      something like in this video.

                      https://www.youtube.com/watch?v=RO_NOJJ6kNc


                      update on my question

                      What I am meaning to ask is there an easy way to have tile type classes and have the grid manager then use those tiles for generating of map?

                      I am trying to do a populous type game where how one raises and lower the terrain or change the tile type improves the terrain to gain access to improvements and expansions on one's settlement.

                      Last edited by AlbertFive; 04-05-2020, 01:30 PM.

                      Comment


                        I managed to get some of my test terrain tiles in such as hills and forest..

                        Comment


                          Originally posted by AlbertFive View Post
                          If I want to set up a tile so I can have multiple type of tiles to represent Hills, forests ect and make it so tiles can be selected like units cans be selected not just units how do I make terrain clickable so I can access the terrain tile information?

                          something like in this video.

                          https://www.youtube.com/watch?v=RO_NOJJ6kNc


                          update on my question

                          What I am meaning to ask is there an easy way to have tile type classes and have the grid manager then use those tiles for generating of map?

                          I am trying to do a populous type game where how one raises and lower the terrain or change the tile type improves the terrain to gain access to improvements and expansions on one's settlement.

                          Originally posted by AlbertFive View Post
                          I managed to get some of my test terrain tiles in such as hills and forest..


                          Hey Albert, so there are likely many ways you can go about doing this, but I'll give you a simple setup to get you started.

                          First you need a way to store your terrain tiles on the grid in appropriate grid indexes. We can start by creating a new special tile actor for your terrain tiles. This might not be what you want, especially if you have a very large map and want your tiles to be instanced meshes But maybe it is fine for your game, and it is simple for our demonstration. I create a new child actor of BP_GA_Tile, which I've called BP_Tile_Terrain. I create three child actors of this for plains, forest and mountains and place them on a grid with the default tiles hidden:



                          Now we need to add these tiles to the grid. I add this code to BP_GridManager_Hex directly for simplicity. When the GridManager is activated I loop over all BP_Tile_Terrain on the map and add them to a newly created GridTerrain TMap. Since our terrain tiles are children of GridActor they have their GridIndex easily accessible (if not we could have converted their location with ConvertLocationToIndex):



                          Ok, so far so good. The tiles are in our game and stored in the grid, but we need to access them so we can manipulate them. Most interaction of this sort is done through abilities in this toolkit. Abilities do not need to be tied to a unit, but can represent an input mode of the player. BP_Ability comes with a lot of stuff only related to units and AI, though, so here we'll use the parent actor BP_AbilityBase as a parent of our new ability.

                          BP_AbilityBase already has all the code we need to hover over tiles and interact with them, so we just need to define what happens when we interact (click)

                          I keep it simple here. When the player interacts through this ability we check that there is a valid tile under the cursor and that the mouse is released. If so we check if there is a value in GridTerrain on the clicked tile. If so we push the tile 50UU up on a left click and 50UU down on a right click. We make sure to update GridLocations to reflect this, so that the location stored on the grid is updated for pathfinding and the like:



                          Ok, almost there. Now we just need a way for the player to activate this new ability. For this demonstration I'll make it as simple as possible. In the Player Controller I add a couple of nodes that activate the ability if the player presses X on the keyboard:



                          Et voilà:

                          Advanced Turn Based Tile Toolkit (Marketplace - Support)

                          Dungeon Crawler Toolkit (Marketplace - Support)

                          Discord

                          Comment


                            Trying to follow your code how do I add in the Parent activate grid manager cant find that bit to add also where do I locate the "ADD" bit at end I circled the two bits I am having issue locating to add to the blue print

                            Comment


                              I managed to find the two but I cant seem to figure out how to add the Grid Terrain into the add bit at end? where is that function to add to that slot?


                              Also what if instead of having it do the terrain high adjustment when player clicks on tile if instead I want it to pop up a widget that would have buttons assigned to perform different actions for that tile.. so instead whenever player click tile it pops up widget for that terrain tile type?



                              Update I managed to find the Add bit at the end I had to create a variable


                              In the ability base where do I locate the event server interact function to add it?
                              Attached Files
                              Last edited by AlbertFive; 04-06-2020, 05:50 AM.

                              Comment


                                Originally posted by AlbertFive View Post
                                I managed to find the two but I cant seem to figure out how to add the Grid Terrain into the add bit at end? where is that function to add to that slot?


                                Also what if instead of having it do the terrain high adjustment when player clicks on tile if instead I want it to pop up a widget that would have buttons assigned to perform different actions for that tile.. so instead whenever player click tile it pops up widget for that terrain tile type?



                                Update I managed to find the Add bit at the end I had to create a variable


                                In the ability base where do I locate the event server interact function to add it?
                                Hey, seems like you managed to figure out a lot on your own. For any child blueprint you can right click the event graph and type the name of any event in the parent blueprint to override the event. If you do not wish to override it, but add to it, afterwards you need to right click the event and select call parent function. Functions (not events) in a child blueprint can also override functions in the parent blueprint by clicking the override button at the top of the function list (though you do not need that in this case, since ServerInteract is an event)
                                Advanced Turn Based Tile Toolkit (Marketplace - Support)

                                Dungeon Crawler Toolkit (Marketplace - Support)

                                Discord

                                Comment

                                Working...
                                X