Jump to content

Actor.getfactions() - anyone made such a function they care to share?


PJMail

Recommended Posts

 

To make a function that "returned" and array with all the factions that an npc is part of the papyrus scripting language would need to support vectors!

(A vector is basically a "at runtime resizeable" array)

Functions like getplayerfollowers() returns a dynamic array of actors (Actor[]).

Are you saying something like the following will not compile? I have not tried it...

 

Faction[] Function GetFactions(Actor akActor)

faction[] factions = new faction[0]

; fill in the factions array

return factions

Endfunction

 

YouDoNotKnowMyName is correct. Arrays are not dynamic (you cannot resize them on the fly) and they cannot have more than 128 elements.

Link to comment
Share on other sites

 

 

To make a function that "returned" and array with all the factions that an npc is part of the papyrus scripting language would need to support vectors!

(A vector is basically a "at runtime resizeable" array)

Functions like getplayerfollowers() returns a dynamic array of actors (Actor[]).

Are you saying something like the following will not compile? I have not tried it...

 

Faction[] Function GetFactions(Actor akActor)

faction[] factions = new faction[0]

; fill in the factions array

return factions

Endfunction

 

YouDoNotKnowMyName is correct. Arrays are not dynamic (you cannot resize them on the fly) and they cannot have more than 128 elements.

 

You can use add() or insert() to add elements to an array, which increases its size, and remove() or removelast() to remove elements from it at runtime, if that's not dynamic I don't know what you mean.

And, whilst the number of entries that you can add to an array is limited to 128, there are functions that return arrays that are larger than this, like those that find references or the ones that return linked references for instance.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...