Optional array function parameter

Post » Fri Sep 26, 2014 11:51 am

What's the best way to have an optional array parameter on a function? What I am doing currently is using "none" as the default, but that causes a warning in the Papyrus log to be generated whenever the function is called ("warning: Passing NONE to non-object argument 9.").

Is there a better way, or a method to not spam up the log with this warning?

EDIT:

Should have put Papyrus in the title. I can't change it now.

Oh, and the parameter in question is an integer array.

User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Fri Sep 26, 2014 7:24 am

I hit this a while back and I can't remember how I solved it. I think I coded it up another way in the end. Can't find it in scripts at any rate.

Funny thing is, you can test an array against None to see if it's pointing at any actual storage and Papyrus doesn't bat an eyelid. I think the warning is probably a red herring, so you can probably safely ignore it. Be interested to see if anyone has any better ideas though.
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm


Return to V - Skyrim