The problem comes when I want to do anything with a weapon (i.e set simulate physics True on each attached bomb actor).
I could add each actor I spawn to an new array, but then the array will for a specific actor class (i.e I can’t just change the actor in Spawn Actor from MK82 to a Missile because the array I add each new actor to is for MK82s):
various attachables of mass destruction inherit from it
the array is of base class and can contain any attachable
Or use an interface:
the array is of Actor type and we do not care about the above at all
But, first things first - classes:
MK82 to a Missile because the array I add each new actor to is for MK82s
What’s the difference between the MK82 and MK82s? They should only be separate classes if the functionality differs a lot. If it’s just some stats and a mesh, then I’d keep it a single class and change the data - stats, sounds, mesh, icon and whatnot.
A fuel tank and a GAU-8/A should probably be separate classes since they differ quite a bit in their functionality. But they can still both inherit from some Generic Attachable Base Class that holds onto shared variables and functions (being damaged, reporting status, detaching, basic stats like weight, air resistance, cost).
This way you script the shared stuff only once, any class extending from it already knows how to do it.
Thank you very much for your help. Please forgive me as my knowledge of inheritance and classes in general is very poor.
My understanding is that actor is a parent class, and because I created a blueprint based on the actor type, the MK82 is a child class of actor… I think?
So because the MK82 (bomb) inherits from the Actor class, I could instead just make an array of actors instead, without the subclass of whichever weapon I put into the array. That way I could put whatever I wanted into this new array, provided they are child classes of the actor class?
I can’t seem to figure out how to make an array of generic actors. Any guidance you could offer is extremely appreciated.
What’s the difference between the MK82 and MK82s? They should only be separate classes if the functionality differs a lot. If it’s just some stats and a mesh, then I’d keep it a single class and change the data - stats, sounds, mesh, icon and whatnot
I meant an array of MK82 bombs, plural. Sorry for the misunderstanding.