steve40 Posted January 9, 2021 Share Posted January 9, 2021 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 arrayreturn factionsEndfunction 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 More sharing options...
DieFeM Posted January 9, 2021 Share Posted January 9, 2021 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 arrayreturn factionsEndfunction 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 More sharing options...
steve40 Posted January 9, 2021 Share Posted January 9, 2021 You're correct, they can be dynamically resized in FO4 - I was confusing with Skyrim. Link to comment Share on other sites More sharing options...
Recommended Posts