Need help building a pylon system like ARMA 3 Jets

Hi All

I’m trying to set up a weapon pylon system (Think ARMA 3), where various hardpoints on an aircraft can be configured with specified loadouts.

I’ve got some arrow components at the moment to replicate where bombs might be attached:

First I make an array with these pylons:

image

Then for each pylon, I attach a bomb:

So far, so good:

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):

Has anyone add a similar issue? Would love to hear your solutions for this.

Use inheritance.

  • base class knows how to enable sim and detach
  • 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.

1 Like

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.

Figured it out! Created a base class called WeaponBase, then make a child blueprint class of that for the MK82

That way I can add multiple kinds of spawned actors to the array, provided they are children of WeaponBase

Here I did a flip flop through the array and added some GBU-10s. Thank you for your help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.