Difference between revisions of "Talk:Add - Array"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>LAITH10
(Created page with "==Not working on empty properties== I had been writing the following script: I have an array property of structs, that should be filled with new elements by a function. The ar...")
 
imported>Goggle
Line 4: Line 4:
But when trying to add a new element on this property, it simply does nothing (array is still empty). Using the same script with no modifications, but filling the array with a "dummy" element via CK suddenly works just fine.
But when trying to add a new element on this property, it simply does nothing (array is still empty). Using the same script with no modifications, but filling the array with a "dummy" element via CK suddenly works just fine.
I haven't tested it on non-property arrays thought.
I haven't tested it on non-property arrays thought.
: This function does work for non-property arrays. I've used the method myself. My only problem with that is, add expands the array, which isn't always what one wants to happen, you'd need a way to clamp it if is used in a while loop.--[[User:Twilight Sky|Twilight Sky]] ([[User talk:Twilight Sky|talk]]) 2016-09-25T08:12:34 (EDT)

Revision as of 07:12, 25 September 2016

Not working on empty properties

I had been writing the following script: I have an array property of structs, that should be filled with new elements by a function. The array initially is empty (no value has been set in CK for it), as it should be done solely per scripts. But when trying to add a new element on this property, it simply does nothing (array is still empty). Using the same script with no modifications, but filling the array with a "dummy" element via CK suddenly works just fine. I haven't tested it on non-property arrays thought.

This function does work for non-property arrays. I've used the method myself. My only problem with that is, add expands the array, which isn't always what one wants to happen, you'd need a way to clamp it if is used in a while loop.--Twilight Sky (talk) 2016-09-25T08:12:34 (EDT)