Tlam99 Posted February 14, 2022 Posted February 14, 2022 This is a script from CreatureFramework V201A SE. Would really appreciate help here. CreatureFrameworkUtil.psc
Tlam99 Posted February 14, 2022 Author Posted February 14, 2022 7 minutes ago, Pamatronic said: Here you go Thank You Pama it's this it might be wrong in there Original ; Get a Papyrus string array from a JArray string[] function GetStringArrayFromJArray(int array) global int size = JArray.Count(array) string[] strings = Utility.CreateStringArray(size) int i while i < size strings = JArray.GetStr(array, i) i += 1 endWhile return strings endFunction Changed ; Get a Papyrus string array from a JArray string[] function GetStringArrayFromJArray(int array) global int size = JArray.Count(array) string[] strings = Utility.CreateStringArray(size) int i while i <= size strings = JArray.GetStr(array, i) i += 1 endWhile return strings endFunction For me it looks, the last string is never loaded, or I am wrong here ?
Pamatronic Posted February 14, 2022 Posted February 14, 2022 If you refer to the original, Im amazed it compiles at all, considering how j is never initialized (exept of course thats a typo on your end) Did you test wheter the changed version works properly? One thing that jumps at me is this: "while i <= size" Wouldnt this have to be something like this "while i < size" , to avoid an Index out of Bounds error?
Tlam99 Posted February 14, 2022 Author Posted February 14, 2022 2 minutes ago, Pamatronic said: ld not be caught here? because the loop stops before the last string. i < like 100 entries, loop runs to 99 but will no more run the "load string 100" This might be the reason for the always missing schlong on creatures after a while playing.
Pamatronic Posted February 14, 2022 Posted February 14, 2022 2 minutes ago, Tlam99 said: because the loop stops before the last string. i < like 100 entries, loop runs to 99 but will no more run the "load string 100" This might be the reason for the always missing schlong on creatures after a while playing. Keep in mind that an Arrays index starts at 0. so if you go from String[0] to String[99], you do have 100 entries.
Tlam99 Posted February 14, 2022 Author Posted February 14, 2022 14 minutes ago, Pamatronic said: Keep in mind that an Arrays index starts at 0. got it i is initialized 0, first entry list 0. OK, learned at least something ?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.