Tower Defense Starter Kit

Hi there, glad to hear that you got it working. I had accidentally typed the wrong tutorial name here (which has been corrected now) instead of the one on Youtube which was specifically about changing the UI thumbnails. So thanks for providing your feedback on the matter. I’ll be posting a new tutorial on Tower Functions later this week.

I am using version 4.24, adding custom levels as you said has no effect Ask for help!!!

Hi, I’m guessing you were following this tutorial for creating custom levels: https://unrealpossibilities.blogspot…orial-how.html

Parts of Step 9 listed there were based on an older version and have now been updated. But otherwise all of the remaining steps should work fine in 4.24. So I’d suggest going through the new Step 9.

If the issue still persists after that, could you share more info on the same? For example, are the enemies not spawning, or is the player interaction with the grid/towers not working, etc. That should help us figure out what’s causing the problem

A new level was added according to the tutorial, but it didn’t work

A new level is added to the main menu, but it is not displayed

Oh alright, I misinterpreted your earlier post as the gameplay not working in a new level.

Ok so if the level is not displaying in the level selection menu, just make sure to first close the project, delete the Saved folder and restart it. This will ensure that any previously saved level data will not override the new information that you added. Usually this turns out to be the problem, but if not could you share a screenshot of the new element that you added in the Level Data Array?

It has been resolved. I did not delete the savegame file before, thank you!!!

Yea, that’s an issue with using save files. Everytime we change some of the data, we have to go back and close the project and delete the old files to make sure that it doesn’t overwrite our new info. Glad to hear that you got it working :slight_smile:

Hi, just wanted to share the status of the v4.26 update. I’m currently working on a major update focused on adding a lot of usability improvements to the way Towers work. Most of the changes are based on feedback I’ve received over the years, with a focus on making the toolkit more accessible to newcomers but without sacrificing any of the existing features.

Due to the extensive modifications involved, I’m introducing these changes as part of the 4.26 compatibility update (and hence the delay). So those of you who are already using the 4.25 edition will always retain access to the base version of toolkit that was available to you at the time of purchase.

Meanwhile, if you’re not interested in the upcoming modifications, you can go ahead and convert your 4.25 projects to UE 4.26. I haven’t come across any 4.26 specific issues so far. So it should work quite fine without the need for any changes.

Changed to a new map, the camera has a problem at the beginning of the game, the camera is not in the middle of my map,may I ask where to set the camera.

Hi, the default camera is part of the BP_PlayerPawn blueprint. Since it gets spawned in at the Player Start actor location, you can move the Player Start around to change the camera view. However, since this wouldn’t give you a clear idea of what you’ll actually see in the game, I’d suggest temporarily adding an instance of “BP_PlayerPawn” to your level in the editor, and moving it around until you have the required view. You can then place the Player Start at this same location and delete the Player Pawn actor.

Apologies for rezzing this from the dark ages, but how would you accomplish this in the current 4.25 version of the kit? Specifically, where exactly do you

What I’m trying to do is break the AI path when building a tower. My test map is just level 1 with 2 lanes added that cross the grid generators:

So far, nothing I’ve tried works for breaking the navmesh/update the AI pathing at runtime.

Edit: If I set the NavModifierVolume in the BP_TowerParent to block Pawn, the enemies do avoid the tower as expected, but the path preview does not update/recalculate. Not sure if blocking Pawn breaks anything else or is a bad idea for any other reason.

Edit 2: Figured out that the AI path is a spline belonging to the SpawnPoint, and obviously it has to be re-calculated. Is there a good event I can hook when a tower builds on an empty cell, or perhaps a callback when the navmesh changes for any reason? What’s the best way to handle this?

Hi @Jaegermeiste , well you’re on the right track with Edit 2 and we can use Event Dispatchers to let the spawn points know when they should update the nav path splines.

But before getting to that, first make sure that the Runtime Generation parameter of your **RecastNavMesh **is set to Dynamic Modifiers Only.

This will ensure that the Nav Modifier Volume in our Towers can affect the Nav Mesh at runtime.

The next step is to head over to the **BP_Tower_Parent **blueprint and set the Area Class for its **NavModifierVolume **component to either NavArea_Null or NavArea_Obstacle. The former ensures that no unit will ever traverse through a grid cell containing a Tower while the latter allows for some flexibility when there is no other path to objective. IIRC, this became an issue only when you place a tower on a grid cell which already contains an enemy moving through it.

At that point, if you’re using the Null option, I’d suggest destroying every enemy unit around the Tower when it is spawned so as to prevent the AI getting stuck. On the other hand, with the Obstacle option, I believe it might be able to pass through if going back is not an option.

Finally, just play around with the Box Extent for the component to control how big of a hole is cut into the nav mesh when you spawn in a Tower. And that’s all we have to do with respect to the Tower BP modifications.

Next, we need to set up an Event Dispatcher system that gets called whenever a Tower is created/destroyed. Since this is handled by BP_TowerManager, that would be a good place to have this logic. So open up the blueprint and add a new Event Dispatcher “TowerSpawned/Destroyed”. Then head over to the **SpawnTower **& **DestroyTower **functions, and call the new dispatcher as shown below:

Next, we want to have the Spawn Points listen to this dispatcher, but since our paths are going to change dynamically, we also have to store references to the spline mesh components and have them destroyed before creating a new one. So open up the **DisplayAIPathUsingSplineMeshes **function of BP_SpawnPoint, and add the following logic:

Finally, head over to the **BP_SpawnPoint_NavMeshPathing **blueprint and make the following modifications in its Event Graph:

This will ensure that, everytime a Tower gets created or destroyed, the Spawn Point immediately gets around to updating the nav path splines. The AI movement should be automatically updated by Unreal’s nav mesh system.

And I believe that’s all there is to it. You should now be able to have the Towers influence the nav path display, but let me know if you have any doubts regarding the workflow.

That works great, thank you for the quick response and thorough explanation! Looking forward to the 4.26 update!

Glad to hear that you got it working. :slight_smile: Yea I’m hoping to publish it by the start of next week.

The game starts to choose tower defense and global capabilities. How do I choose all by default !!!

In the case of Towers, you can do that by setting the EnableTowerSelectionAtLevelStart? variable in **BP_GameMode_TowerDefense **to False. If you want the same for Global Abilities as well, the following modifications should do the trick.

Also, make sure to update the **BaseTowerModels **array in **BP_TowerManager **and **AvailableGlobalAbilities **array in **BP_GlobalAbilitiesManager **when you add or remove new Towers/Abilities.

Ok i’ll try it thanks

How’s the update coming along?

Hey, I don’t have an exact timeframe for the release since this is the first major update for the Tower blueprints in a long time and I have to make sure that it can handle future updates without having to be modified each time. Hopefully, a week or two, but if you just want to use it in 4.26, converting the 4.25 project to the new version should do quite fine.