Jump to content

More array questions...


Recommended Posts

In a function I have:

Form[] outfits_array

 followed by lots of if statements like:

ElseIf outfit_type == "default"
            outfits_array = myRefScript.default_outfit
            default_outfit_toggle[actor_index] = True

at the end of the function I have

dz_get_kit(NPC_ref_slot[actor_index],outfits_array,outfit_type)

however this does not result in myRefScript.default_outfit (if outfit_type = "default") being edited by the dz_get_kit function, which I guess is because I only made the contents of outfits_array the same as myRefScript.default_outfit, but not making 'outfits_array' a way to pass myRefScript.default_outfit to dz_get_kit.

Full function here:

  Reveal hidden contents

So what is the correct way to select the array I want using the If statements and then pass that array to another function?

 

diziet

Link to comment
Share on other sites

Does everything else work?  The only issue is that the array is not being set with the default outfit when the outfit type is not specified?

If that is the case, add something like the following (adjust as needed):

Else
  outfits_array = myRefScript.default
  default_outfit_toggle[actor_index] = True

With the above, if the outfit_type is not a specified one it will be treated as default and assign the default outfit to the array.  At least that is the theory, testing will be needed.

Link to comment
Share on other sites

I think I have misdirected my question:)  The complete function exists to detemine which array to operate on,  All the arrays are specified in the script attached to reference aliases, you will recognise that because you helped me with referencing them i.e

ReferenceAlias myRefAlias = refalias_array[actor_index] as ReferenceAlias
        dz_outfits_NPCrefalias_script myRefScript = myRefAlias As dz_outfits_NPCrefalias_script

I attempted to assign 'outfits_array' to whichever array in 'myRefScript' was selected.  However operations on 'outfits_array' did not affect the array attached to myRefScript.  Instead it appeared that I had created a new array 'outfits_array' with the same contents as the one attached to myRefScript.  In the end I changed the function to read:

  Reveal hidden contents

moving the operation on the array to the if statement, this of course, works:)

 

diziet

Link to comment
Share on other sites

  • Recently Browsing   0 members

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