#NPC thing
1 messages · Page 1 of 1 (latest)
Ah that's alright
You've got a few options, you can either have all the npcs add themselves to a list, and whenever you target them you just iterate through the list
Then for starters, the system works like this:
- There is a "current target" variable which is 1 enemy at a time
- The function tries to access all TargetPoints of a given area (Like arm, head, leg, etc)
I don't need to find the NPC actually, I have that down and it works well enough. My problem is that I want to get all the components of a specific to be accessed without relying on a For Each loop
I guess I'm having a hard time understanding what it is you're trying to do
components as in like, actor components?
Lets say I want to get all components of X class, with a specific variable value on the Enum
It's a SceneComponent class Component I made for this system, yes
what does the enum do?
2 things, controls what type of damage the player deals, and checks for a different area of the body to target
So if the head is blocked out of view, the player would not be able to target it
for loop shouldn't be that expensive if you're only running through like 6 things 
what sets the area type?
It's a variable set when added to the actor, and currently nothing else changes it
I just like to avoid using ForLoop unless explicitly necessary
for loops are kind of how you crawl through lists
do you have a consistent amount of limbs/areas?
I think for loop is your best option here at my knowledge level
I see...
My other idea was to instead have 1 class for each enum value
So I could get specifically all those components of said classes