That means that they are not identical variables. How did you create the Add node here? Drag a pin out from the GridTerrain reference and then type Add. The context sensitive search should give you the correct node.
On the Grid terrain map elements it will not allow me to add tile types when when selecting them from the pull down list it remains as none.
Yeah, you cannot add references to specific actors (which are what references are) to a blueprint that is not itself instanced. No need for that, though. This loop adds all the tiles in the viewport during runtime instead.
I got everything added into the ability base terrain bp as shown in your sample code.
but when I run I get this error.
And this is my code
After doing some careful review it was the bp I was referencing⦠here is video showing it working nowā¦
I am now setting up widget inside tile. If I want to have a widget be hidden inside a tile unless the tile is clicked whats the best way to activate a wiget on a tile that is otherwise hidden until needed?
I am guessing the best way to do widget visibility on tile is create a new ability class and have in that ability have ability triggered on tile have it show widget for that tile?
Abilities are a good way to handle player input and displaying relevant in-game visualization such as 3D widgets etc. However, Iām not sure if you need a separate ability for this. Am I correct in guessing that you only want to show one such widget at a time? If so you can add this widget to the ability you have already created, you then place it over a tile when the tile is clicked and make it visible.
Each tile has its own widget such as forest tile would have its own widget for construction or cutting down treeās ect, flat flat would have its own widget for its tile type. but widget should only be visible when current tile selected.
Basically in the Parent class of the Terrain tile I added a widget class created event interact set visibility of widget.
now what would be the best way to activate that event from the abilites blueprint?
Hey ,
first of all thank you for this wonderful toolkit!
I have been experiencing problems with the integrated object system(grid objects array, add object to grid function, remove object from grid function).
The fact that the array is made of FObjects Structures which contain an array of objects made me believe that the system is designed to allow multiple objects on one tile, the functions also seem to be made with the idea of multiple objects on one tile in mind. However, the add object to grid function seems to ālimitā the objects to one object per tile. Also, the remove object from grid function does not seem to work at all. Maybe there is just something weird going on in my project but it would be very kind if you could have a look at it on your side.
I hope to hear from you soon.
Justus
You have access to references of the tile actors through the GridTerrain TMap, which you can use to call events. I can recommend reading up a bit and doing some tutorials on working with blueprints more generally. Many of your questions have to do with blueprint communications. It is something that takes some time to learn, but it is a requirement if you wish to master UE4. The official docsis a good place to start, but there are also many tutorials on blueprint communications if you search for it
Hey Justus, thanks for the kind words. The way you describe it is indeed how the object system is supposed to work, and the fact that you are only able to store a single object in a tile is a bug. I actually discovered this bug just a couple of days ago, but Iām uncertain how long it has been present. This bug seems to be caused by some change to the underlying UE4 code and how the engine handles manipulating arrays within struct. I have made the following work-around that should bring the GridObjects functionality back to how it worked when it was initially implemented (here is a pastebin):
Hi, and that for the reply on the Question section. The idea for āmouse grab and moveā that i have, In the project that i am working on i need to be able to grab static meshes and move it where i want on the the map. I will have table and chairs and other stuff that the player can move around. Maybe pressing shift and the pointer turns into a hand so one can grab the movable object in the scene.
Hey ,
thank you for the quick work-around. Thatās what I thought. You are also experiencing the same problem with the remove object from grid function(the remove is not reflected back to the struct array), right?
Yeah, sorry. You need to do the same thing there. UE4 has gone back and forth a bit on whether manipulating nested arrays directly is functional.
Edit: Iāve modified the function a bit further to prevent the map filling up with empty values:
Perfect. Thanks!
There is a super weird issue with PMs that has been happening to me a while. I can see some of the text in my e-mail preview, but when I go to read the PM on the forums it is blank. Sometimes it is in text the first time, but then it goes blank later. [USER=ā2598148ā]Hayden Meek[/USER]: Iām sorry, but I canāt see your PMs now. Could you post in this thread instead? The PMs look like this:
Anyone experiencing something similar or know what the problem might be?
Hey ! Just want to say how great this toolkit is! I so appreciate the work youāve put into both making this kit and making the time to support it with videos and this forum. Makes it easier for me to pick through the blueprints for what I want, though Iāll admit that I am dumb environment artist and not a programmer.
With that in mind, I hope you donāt mind me asking a few questions:
Firstly, in one of your older tutorials, you quickly altered the square grid to a hex grid by switching out meshes and altering a few settings. However, now I am looking to switch the advanced square grid to a hex one and I am unable to locate anything obvious in scripting or otherwise. Does a simple option still exist? Would it merely be easier to add the advanced components to the hex grid instead, rather than converting the current advanced square grid to a hex?
If I wanted to spawn in enemy units in varying amounts at varying times during the game (Turn 10 would see three groups spawn, for example), how would I go about this? I followed some other post you made about this, but it seems out of date.
If I wanted to group enemyās turns based on their initiative, would this be possible? I want to spawn quite a few enemies, and I would like all enemies with the same initiative to act at the same time to save playerās time.
Thank you in advance!
Glad you like it No worries, we all have to start somewhere. Hope the toolkit will serve as a good learning tool.
BP_GridManager_Adv is literally just BP_GridManager with the stealth and cover components attached, so just add these components to the hex grid and youāre golden.
You can spawn units just like any other actor (By using the SpawnActorFromBlueprint node). There are exposed variables for placing the unit on the grid and in initiative on spawn. If you want to do this on turn 10 you could check the value of CurrentTurn near the end of EventBeginNewTurn (in BP_TurnManager), before the InitializeQueuedActions function is called. If the value is 10 you could then spawn your units.
Not sure if I understand what you mean here. Are you talking about having the enemy units act one after another, not going between the turns of individual player controlled units? If so this should be default player behavior? Or are you talking about animation everything all enemy units do simultaneously (which is pretty tricky to do). Which is it?
Hello from a fellow Norwegian Great toolkit this! Iām working on this little learning project we have going as well, so Iāll attempt to clarify a bit. Iām the dumb character artist doing a learn, so donāt expect any programmer intelligence out of me either.
I watched him try this, and what happened was some odd things where the square decal spawned on top of the hexagonal one on that units turn, both for the red and blue. This was on a copied grid manager though. It worked fine when editing the original (which we really donāt want to do, since weāre almost certain to break it at some point). Any idea what could cause this?
Golden, thanks for this!
What I think he is asking here is having the enemies with initiative of one all go one after the other, have the player units with the same initiative go after that (or before, depending), and then rinse and repeat for initiative 3, 10 etc. This is likely to group enemies spawned with a set initiative to go sequentially one after the other, without having the camera bouncing back and forth if itās set to follow the units for instance. Bit of a marginal use case as far as i can tell, but hey, weāre learning.
Edit: Spoke to the man who posted, and yes he would indeed like to know if it is possible to make the units move at the same time, to save time when large hordes of enemies move in a horde mode type of game for instance. Pathing will likely be a nightmare, I know. Is it possible to simulate the moves individually, but then have the animations play at the same time?
Takk for hjelpen!
No worries, Iāll do my best to explain and just let me know if you need more details.
Ah, sorry. That is a result of one of the uglier hacks in the toolkit. For the default abilities Iāve set it up so that they choose a square or hexagonal markers based on the class of the current grid manager. This is just there for easy testing and debugging. For a released game there is no reason to have code that decides which markers to use based on the grid, as you will in all likelihood be using one or the other. So Iād recommend just setting the markers directly. If youāre using BP_Ability_MoveAttack on your units, edit this ability and set the meshes of the various marker components to the meshes you want to use.
There are three different Turn Managers in the toolkit for various initiative behaviors. For a D&D-style initiative use BP_TurnManager_Initiative. If you ise the BP_ATBTT_Initiative GameState this turn manager will be used. Note that this will sorts units in initiative at startup, but not the new ones you add during the game. To sort the new units, call SortActorsInInitiativeOrder in the turn manager you are using, like so:
Ok, so that is a bit of a challenge, if doable. The toolkit is split up into gameplay logic that happens instantly and animation the plays out sequentially. I have played around with ways to have these animated actions run at the same time, either through sorting of the queued actions or through the use of multiple action managers working in parallel, but this is definitely not trivial to implement. If you are dead set on having this feature I can give it some more thought.
Bare hyggelig