I’m doing a turn-based game project for school to learn more about Unreal Engine and C++. I’m using the Top Down template (the C++ version) to start off but I don’t know how to start making the grid needed for a turn-based game. Any help on this would be appreciated.
There’s a thing for this in marketplace.
I saw that, it’s just I wanted to try doing it from scratch using C++. Maybe I’ll ask my academic adviser and see what she says.
If you don’t want to buy my toolkit you can check out a very early version of what was to become the toolkit here (I think you’ll need to install UE4.4 for it to work, though). It does show how to spawn a grid and how to relate the tiles on the grids to data in an array. It’s done in blueprints, but if you know both blueprint and C++ it is easy to convert blueprints to C++. In any case it might be good as inspiration.
Thanks for the link.
So it turns out my adviser is ok with me using the toolkit. So now I’m wondering if it’s possible to select an individual tile in the toolkit?
Ok, cool! I’ll need you to clarify a bit. What is it you are trying to achieve? The locations of all tiles are stored in an array, and there are multiple arrays corresponding to the indexes of this array that store the data of the tiles. The data of a tile can be accessed by getting the appropriate index of these arrays. I have included functions for clicking a tile and convert the clicked vector to the corresponding index, but there are several other ways to do this depending on what you’re after. I recommend taking a look at my tutorial videos if you want to get an overview of what the toolkit is capable of
I was trying to make it so that if the player lands on a special tile they get an item or something. Kinda like those items you can find in the middle of battle in Fire Emblem.
Ok, that’s certainly possible. There are manyways do this, but the easiest is probably to simply use powerups with collision on the tiles in question and fire your “find item” event when a unit overlaps it (note that the default units do not have collision enabled by default, so make sure it is enabled and overlaps the same channel as your units. Also have the collision ignore PathTrace and RangeTrace as otherwise this will screw with tile clicking and visibility)
They said that all of C++ is visual orchestratable
Sorry, I’m not sure what you mean by orchestratable and Google is not helping. Good article, though. C++ has the benefit of being much more performant than C++, but blueprints make for much faster iteration in most cases. My personal strategy is to use blueprints until I experience poor performance for the hardware I am targeting. If this happens (hasn’t so far, though) I convert the needed parts to C++. It is also worth noting that though C++ is potentially a lot quicker, bad C++ code can still be slower than good blueprint graphs.
Well any code I make for this has to be in C++. All the blueprint classes in the asset can be accessed in C++ right?
Like Monokkel said. Get his toolkit. The buisness terms state that you can alter anything on assets you purchased. Add to etc. All those assets are like video tutorial. All the info an plans are there and yours. They show you blueprints and eveything. Good idea. Thats why I bought some to see how others did what they did. The builders of engine swear u can do anything that C++ can do
I already bought it, I was just wondering if the blueprint classes in the asset can be called in C++ code. I’m still new to Unreal and just want to know how C++ communicates with blueprints?
Blueprint functions can be called in C++ code, though I have not played around with this myself yet. Here is an AnswerHub thread discussing calling blueprint functions in C++. You should further look at Epic’s C++ tutorials or ask in the C++ subforum to learn more.
Can The Advanced Turn Based Tile Toolkit be customized wherein:
- there will be 4 variables added which are the team1unit_designated_movement, team1unit_designated_action, team2unit_designated_movement, and team2unit_designated_action
1.1. team1 unit will normally do movement and action but after it is done the movement and action will be saved in the custom variables team1unit_designated_movement and team1unit_designated_action then the position of team1 unit will be reset prior the normal movement and action
1.2. do the same to team2 unit but for team2unit_designated_movement and team2unit_designated_action variables then also reset team2 unit position
apply the saved movement and action values of the 4 custom variables in team1unit_designated_movement, team1unit_designated_action, team2unit_designated_movement, and team2unit_designated_action at the same time for both team units
Will it be possible? So it will be like this:
1.1. [Plan] Move, act, save (movement and action), and reset the position of team 1 unit
1.2. [Plan] #1.1. but for team 2 unit
2. [Execute] apply saved #1.1. and #1.2.
3. Next turn
or something similar to it…