Working on a game similar to Bomberman to further familiarize myself with how UE4 works, I’ve managed to make a BP which generates a grid of any size for me which in turn creates the level itself. Each generated grid is assigned an ID, starting from 0 and then it increments from there - this is also their index in the array where all grids are stored*(separate array for each type of grid)*.
By doing this I can easily access any grid from within the array and assure I’ve got the right ID, so far it’s all been working - however I have run into some problems.
I’ve also made the very basic functionality for the bomb, using debug mode it will show me on what grids the explosions will occur.
Since I got that working I moved onto spawn points, my idea here is to get a random empty grid and assign it as a spawn point. I’m successfully able to generate a random ID excluding the exterior walls but for some reason I am unable to change the colour now for my debug mode.
I have absolutely no idea why it’s not working for the spawn point, but it works just fine for the bomb even if I increase or decrease the power level. It is done identically(yes, the working on doesn’t check validity because the blue note message really bugged me - I’ve tried both with and without).
I have printed text all over to make sure all references are valid and also made sure it’s not failing to cast. So basically, I’m all out of ideas on what to do. I’ve tried doing it all in the Event Graph instead of via functions - but it yields the same results.
I’ve checked the length of the array to make sure it has the correct number of grids.
if anyone has any suggestions I’d greatly appreciate it.