What exactly is the difference? Arrays don't actually exist in-game really, they're properties or variables. I get that. But what is the difference otherwise? I'm sure there's plenty, but... I'd like your opinions
Also, to create a function like the following:
I imagined it would look somewhat like this:
Int Function CountActors(Float Radius, FormList ActorsToCount); radius is how close the actors need to be to be counted, array is the actors to count within that radiusInt ActorCount; you can declare variables within functions - they can only be used within those functions, actor count is to count how many actors are within the radiusInt aIndex = ActorsToCount.GetSize While aIndex; actor index, checks the size of the formlist aIndex -= 1 Actor kActor = ActorsToCount.GetAt(aIndex) As Actor; forms need to be cast properly, for us we're checking for actors so typecast to an actor If kActor.GetDistance(Self) <= Radius ActorCount += 1; add one to count of actors within radius EndIf EndWhile Return ActorCount; return amount of actors within radiusEndFunction
But from what I can tell, this would only work for unique actors. If I just pull in 10 of the same type of actor, would that formlist count 1 of that actor, or 10? So if I had 10 dunBandits (don't think those exist, but something like that - a leveled actor), and I pulled those into the formlist, would the formlist be 10 long, and thus go through 10 actors and return 10 if 10 dunBandits were within the radius, or would it be 1 long and just return 1 or 0, regardless of the amount?