Tower Defense Starter Kit

Alright, so it’s not an upgrade tree with multiple maths. In that case, it won’t require a lot of modifications. What you could do is to add a new array of type ‘ETowerType’ to Struct_TowerData. Now within the Tower Data Array (in Game Instance class), add all supported second tier towers for each base tower using this new array member. Now when the ‘Widget_TowerConstructor’ class executes the ‘CreateTowerBuildButtons’ function to display the constructor UI buttons, you can add a check to ensure that buttons are created only for the tower types mentioned within the Tower Data Array element for base tower.

If you’re using two lasers, most of the extra work involved would only be centered around making sure that the new laser particle system gets updated alongside the original one. Since target acquisition is handled independently through a modular component based design, it shouldn’t require much in the way of changes, except providing it the new turret location (maybe somewhere between the muzzle locations of the two turrets). But not doing that shouldn’t crash the engine. So one potential reason for the crash might involve the new laser particle system getting invalidated at some point during runtime. You can try adding ‘Is Valid’ checks before accessing the particle system & see if the crash still persists.

My team decided to use one laser per tower after all. Before I can apply the changes to tiered towers, I’ve run into a problem with the tower type enum. We won’t be using the boost and mining towers in our game, so I went through the steps of adding a tower to delete the two un-needed towers. Now some ordering is off in the selection and build menus. “ETowerTypeMAX” is the name given for the Artillery slot, and “Artillery” is given for the sniper slot. I think something in the pipeline is referencing the enum expecting the old list and not the updated one. I refreshed each node referencing the Enum.

If you’re going to delete entries from enumerations, it’s generally better to rearrange them in such a manner that the unwanted entries are moved to the end of the list. The engine will then automatically apply the necessary changes (like in switch case nodes using the enum) wherever the enum is being used. Not doing so & deleting entries from mid way can sometimes cause the engine to keep looking for the old list as you mentioned.

What you could do in this situation is to either retry the deletion process from a backup copy after first rearranging the enum entries, or search and find every instance of the said enum & make sure it’s wired to the right nodes. If you won’t lose a lot of work in the process, I would definitely suggest the first method. Also in either cases, always make sure to save it before making any changes elsewhere.

Thanks, it seems to be working now. Now, we want a splash menu to appear before the main menu. I’ve imported it, added it to the HUD State enum and applied the addition to the Update HUD State function. Where is the Main Menu widget set as the default widget? It’s not applied in the default Game Mode under World Settings for the Main Menu level.

Alright, so you’re on the right track with the Update HUD State function. The Main Menu HUD state is set from the level blueprint for the Main Menu map. It is not set as part of the default settings in Game Mode because the toolkit opens up to the sample level. On a side note, one of the utilities of having a separate function to make the high level HUD state changes is that you can just search for it (after unticking ‘Find in current blueprint only’) to find every single instance of this function call.

It worked well. Now, how would I apply a unique texture image for each tower on the build button instead of the text from the TowerType Enum? I added an image widget over the build button in the blueprint and added a new variable to the TowerData struct set as a texture. However, in the Tower Constructor widget, setting the image widget as the image variable from the struct doesn’t work.

Added a new tutorial on how to create new levels from scratch: Tower Defense Starter Kit Tutorial: How to create a new level

Could you post a screenshot depicting how you’re setting the image for the tower build button? It would be a lot easier to see where changes need to be made that way.

The v2.0 update for Tower Defense Starter Kit has gone live on the Marketplace.

v2.0 Change Log:

  1. Removed the Unit-based wave spawning system, as the Batched wave spawning system can achieve the same results in a far more user-friendly manner.

  2. Segregated the wave spawning system into two child classes: one to control batched wave spawns & the other to handle AI threat level based waves. [Note: The Threat based system will be getting an upgrade in the upcoming update to include weighted AI spawn management]

  3. Removed the third sample map that showcased the use of dynamic nav modifiers to control AI paths.

  4. Added event dispatchers to decouple logic associated with enemy spawn, damage reception, & deletion based events.

  5. Integrated the pre-wave resource allocation data into the wave spawn data structures.

Free gameplay demo for the v2.0 edition of Tower Defense Starter Kit (Windows) now available at: Dropbox - File Deleted

All changes within the blueprints are marked with the boolean variable ‘Version2_0’ [screenshow example below] in order to easily identify the workflow changes introduced with this update. Comments are also written to describe the major changes.
​​​​​​

Ok, now I have a problem with one of the towers’ functions menu. All of the towers’ functions are working well except for one, which are greyed out. Do you know how it might have happened? Again, I checked myself but didn’t find the source of the problem. When I tried to look at the struct for functions, it caused all of the functions menus to bug out. I was able to load a backup of the file, but I’d rather not touch it again unless I know where the problem is.

If only one of the tower buttons is greyed out, then there’s a good chance that it is not set to be compatible with the said tower. Whenever a tower function button is added to viewport, it checks the ‘Activated’ variable (passed in as part of construct event) to determine if the function is available for the selected tower.

In order to ensure that a Tower Function is compatible with a certain type of tower, just open up associated element within the ‘Tower Functions Array’ (in BP_GameInstance blueprint), & add the tower type enum to the ‘CompatibleTowers’ entry.

Let me know if that fixes the issue for you. If not, we can try debugging the system.

The gameinstance change worked. Thank you. It must have still been trying to read the data array as it was before the tower deletion.

New issue. Packaging fails because of the deleted entries in the Tower Type list. I need to keep the original list and script as-is except that the UI needs to ignore the build buttons for the Boost and Mining towers.

Hi Menelin, could you post a screenshot of the errors/warnings displayed in the package output log?

Here’s the link to the question I posted in the AnswerHub. It has the output log of a successful package process with TDSK and the output log of a failed package process with the modifications.
https://answers.unrealengine.com/questions/730903/packaging-for-android-not-working.html

Can you check if packaging for Windows throws the same error?

I think you might have run into the problem mentioned here: Unknown structure Error When Cook - Programming & Scripting - Epic Developer Community Forums

Try renaming all the structs mentioned in the errors. If that doesn’t work, rename the output parameter of the functions used to retrieve them. If both these solutions don’t work, you would have to delete and replace all instances of calls to access these struct arrays.

I just purchased this. I do have access to a windows machine but my main developing machine is my Mac. I am confused why this only works on Windows if it is totally blueprint driven. Is there a chance this will be available for Mac? I like to develop on both machines depending on where I am at the time.

Hi @hilbelinknr , I did not add official support for Mac OS because I do not have access to one for testing purposes. But as you said, it should ideally work fine as long as there aren’t any platform specific bugs around. As for your query, are you able to download the project from the UE4 launcher on Mac? Or is it an issue with not being able to open the project itself?

I’m sorry it is working now. When I tried the other day it wouldn’t create the project for me but now it is working properly.

I do have a question about the splines. It seems like the example maps seem to show that they are supposed to be centered on the path but mine won’t stay centered on the path. Am I missing a setting?