Beginner looking for help - Weapons and Storing data

The game I’m currently building is a single player experience that will potentially evolve into a 4 player co-op. I’m new to game development and Unreal 4 so this might be a very simple thing but I can’t seem to find anyone talking about this at all. If you’re familiar with Phantasy Star Online episodes I and II, I’m shooting for something closer to that including the timed attacks.

Let’s say I’m going to have a small array of weapons like a rifle, a melee weapon, and a bomb. I can easily set everything up in a character controller and have it so that when my character equips one of these weapons it sets a boolean true and then they use that weapon set (damage, animations, behavior, etc.). Much later down that road if funding continues there could easily be 36+ weapons, even if I try and stick to general categories I’m going to want some weapons to feel completely unique so that would be something like 9-10 potential graphs. Is this a problem? Is this even the right way to handle this kind of functionality?

I’ve been sitting on this ticket in my trello for a day really struggling with where to start so any help is appreciated. Up to this point most of the implementation I’ve done has had tutorials or I’ve had a general idea of how I want it to be handled, this is actually the first time my direction is really foggy and because of that I’m struggling with a starting place.

We’re looking at “Object Oriented” coding](Object-oriented programming - Wikipedia) (nothing too hard don’t worry, it’s the must-have knowledge to start making games).

In Unreal 4 as in many other engines / SDK it takes the form of Class and Child Class.

An element in Unreal is a class with a set of properties (components, variables, functions).
If we make an element a child class of another element, it will inherit its properties (it will have them all and also give you the possibility to manipulate them / add new ones).

In your case, you want to have a BP_Weapon class and lots of child classes which are all your different weapons.

This will make it easier to handle everything without adding new booleans everytime you add / remove weapons or modify anything about weapon features.

So I suggest you to take a look at some tutorials regarding parent and child blueprints before you jump on this task :slight_smile:

Maybe something like this: