Grab array in actor, two different actors
Posted: Fri May 26, 2017 11:26 pm
I have two actors that both have arrays that, if inserted, have 4 elements:
And they are in two actors (DummyAnimActor,RPG_PlatformPawn), the first is a subclass of Actor and the second is a subclass of playerpawn. I need a way to determine who my input actor is into a function, if it isn't either of these then return, but otherwise output these actors as a selected, in-game actor. But I need either of them to be under a catch-all actor title (a name or string, not sure honestly) and modify the array (Sprites).
Here is an idea for how to do this, is this going the right way?
I've read that typecasting an actor as a string will give me the package name.actor name[number] (eg. "RPG_Game_dev.DummyAnimActor0").
If I do this, the problem becomes typecasting back into a class and being able to do something like
because if I make classTitle "class<actor>" then I could get issues with not finding this array in class actor.
I'm working on a parser that goes through .int files to assign textures to these arrays for the directional sprite thing. I have most of that written, but this is the last piece before I can test it.
Code: Select all
struct Animations
{
var array<BitMap> Stand;
var array<BitMap> Walk;
var array<BitMap> Jump;
var array<BitMap> Run;
};
var private array<Animations> Sprites;
Here is an idea for how to do this, is this going the right way?
Code: Select all
function DetermineActor(actor Target, out string targStr)
{
if(Target == class<DummyAnimActor>) {targStr = string(Target);}
else if(Target == class<RPG_PlatformPawn>) {targStr = string(Target);}
[SANITY CHECKS ETC. GO HERE]
return targStr;
}
If I do this, the problem becomes typecasting back into a class and being able to do something like
Code: Select all
classTitle.Sprite[i].Walk[i]
I'm working on a parser that goes through .int files to assign textures to these arrays for the directional sprite thing. I have most of that written, but this is the last piece before I can test it.