Posted March 17, 2021 by GrimmSlayingDolt
Welcome to Gobo Rampage's fourth devlog!
Inheritance
After our prototyping, we wanted to add inheritance to our prank items so meshes wouldn't glitch out. We also wanted to add a way that the player has one thing to focus on, which we implemented at the same time. We played around with a few different methods of checking how to do it. Checking the specific base class of the selected item had a pretty easy solution. We first tried doing it with an unreal enum. This would've been a lot of messing around with setting variables each time we wanted to change something. Turns out the built in Cast function returns a boolean that made it so we can just check the cast and work from there. For storing the items in the inventory, we used a int value and to spawn a new one in, we made an array that stores the template blue prints for what we want to spawn in. The int value we stored in our inventory slots goes together with the index of that template in the array. To indicate what that selected closest thing was that the player could interact with, we wanted an outline on. One of our programmers had some experience with this type of thing but had a some problems doing making this work with c++. So we had to make a connection between the blueprint and base class. The proper uproperty keywords to be able call on something form the class were visibleanywhere and blueprintreadwrite.
See you next week with another devlog!