Jump to content

Array property not changing sizes


LordWabbit

Recommended Posts

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

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

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

@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

  • Recently Browsing   0 members

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