LordWabbit Posted October 21, 2013 Share Posted October 21, 2013 Greetings I am new to modding, but I am a programmer by trade, so I am sure I am just missing something obvious. I have taken an existing mod and modified it slightly to better suit my needs. I changed an array property (hidden) from 20 to 50, but when I do a length I get 20 not 50 I changed WakkaActors = new WakkaActorAlias[20]To WakkaActors = new WakkaActorAlias[50]But this returns Debug.Notification("Array Length : " + WakkaActors.Length)20, not 50. Whats also strange is that I get no errors when assigning values above 19, so I think internally the array has changed size. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 21, 2013 Share Posted October 21, 2013 If you check the array length after adding in new entries does the length value change? If so, it could be that length returns the number of valid entries rather than total possible entries in the array. Link to comment Share on other sites More sharing options...
Deleted800173User Posted October 22, 2013 Share Posted October 22, 2013 Just a thought, are you running the old version of the mod as well? Make sure your version of the mod is the only one, or if your mod is an add-on mod to the old one, make sure it is loaded after the old mod. Link to comment Share on other sites More sharing options...
acidzebra Posted October 22, 2013 Share Posted October 22, 2013 As a final tip and to add to the others' advice, when you go and test, do not load a previous save. At the main skyrim screen, just open the console and "coc whiterun" or wherever, then do your testing. God knows what kinds of variables and other bits gets baked into your savegames, but there's a lot of it and it's always best to test from a clean slate situation. Link to comment Share on other sites More sharing options...
Deleted800173User Posted October 23, 2013 Share Posted October 23, 2013 BTW, if this is an array of actors, I've noticed that I always have issues using arrays of actors. Honestly, I would literally suggest making 50 different actor variables and then making a function called wakkaActors(int i) and that function would return an actor based on an int, similar to how an array would. Then i would make another function called SetWakkaActors(int i, Actor myWakka). And finally just have a constant variable for length that you can declare at the top. I use this for my code that uses 100 actors and I've noticed that it is more efficient during run time. Also before, when I used an actor array I would consistently get 'none' for any actor that I stored. WHY? I do not know. Link to comment Share on other sites More sharing options...
myztikrice Posted October 23, 2013 Share Posted October 23, 2013 Is your set wakka function just 100 if statements? Link to comment Share on other sites More sharing options...
Deleted800173User Posted October 24, 2013 Share Posted October 24, 2013 @myZtikrice If your asking me, then yes. I literally copied an pasted it and changed the numbers, but the script I'm using I plan to reuse so for the run time efficiency increase it was worth it to me. I don't know why arrays in papyrus are so inefficient. It seems like something that critical would have been very important to the developers, but Every time I use arrays of large sizes it gets really slow. Link to comment Share on other sites More sharing options...
Recommended Posts