Papyrus array string "None" returns None

Post » Mon Nov 09, 2015 1:57 am

I need a sanity check for these scripts. When I create a string array of length 1 and set the first element to the string value "None" the array will return an actual none when its retrieved later with myArray[0].

Event OnSample()    Debug.MessageBox(MakeArrayA()[0]) ; Undefined    Debug.MessageBox(MakeArrayB()[0]) ; "Empty"EndEventstring[] Function MakeArrayA()    String[] sArray = new String[1]    sArray[0] = "None" ; returns a none element    return sArrayEndFunctionstring[] Function MakeArrayB()    String[] sArray = new String[1]    sArray[0] = "Empty" ; returns a string "Empty"    return sArrayEndFunction

If thats how it works then whats up with that? :)

User avatar
Juliet
 
Posts: 3440
Joined: Fri Jun 23, 2006 12:49 pm

Post » Sun Nov 08, 2015 9:16 pm

Yep, this seems to be the way it's meant to be from what I can tell.

When I was doing Character Gen. Overhaul, for Abilities I had 'None' as an option, and ended up changing it to 'No Ability' because it wasn't working right with 'None'. Admittedly, though, it was my first time working with Arrays, so maybe *I* did something wrong.

I've not tried, but I'd assume "- None - " would work OK?

User avatar
Rob Davidson
 
Posts: 3422
Joined: Thu Aug 02, 2007 2:52 am

Post » Mon Nov 09, 2015 12:19 am

Yea, I just tried the string " None" and got the expected value. Now I wonder if this is a string thing or an array thing..

User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm


Return to V - Skyrim