icecreamassassin Posted February 12, 2016 Share Posted February 12, 2016 ok I give up. Can't figure out why my MCM function isn't working in a specific instance. This code works perfectly for dozens of other menu categories but for this one category it leaves several items as blank titled check marks meaning it isn't acquiring the name of the item. The ONLY difference I can see between these missing items and the other items on the list that are working is the fact that the missing items are weapons rather than armor. The other thing is that these weapon items are actually on a sub formlist which the code is able to make a deep dive for and return the name just fine on the weapons. Furthermore this function works as written on any named object no matter of form type if it's on the native formlist rather than a subform. Any advice is appreciated. Function ListItem() ObjectReference DISP Form ITM While Index < ITMCNT DISP = DISPLIST.GetAt(Index) as ObjectReference ITM = ITMLIST.GetAt(Index) as Form if ITM.GetName() != "" ItemName = ITM.GetName() else SubList = ITMLIST.GetAt(Index) as FormList ITM = Sublist.GetAt(0) as Form debug.notification("item is " + ITM.getname() + " ") ItemName = ITM.GetName() Endif if DISP.IsEnabled() AddToggleOption(" " + ItemName + " ", true) else AddToggleOption(" "+ ItemName +" ", False) endif Index += 1 EndWhile EndFunction Link to comment Share on other sites More sharing options...
blennus Posted February 12, 2016 Share Posted February 12, 2016 (edited) ITM = Sublist.GetAt(0) as Form Why 0? Shouldn't it be Index? Edited February 12, 2016 by blennus Link to comment Share on other sites More sharing options...
icecreamassassin Posted February 12, 2016 Author Share Posted February 12, 2016 Because it's just for the purposes of acquiring the name. The main list has 60 items and the sublists each have only 2 and they are both named the same thing (one is enchanted and one is unenchanted),and both the weapons on these sublists are properly named just like the armor items but for some reason they just will not acquire the name from weapons on sublists in this case. Link to comment Share on other sites More sharing options...
blennus Posted February 12, 2016 Share Posted February 12, 2016 (edited) Have you tried just the line if ITM.GetName() instead of if ITM.GetName() != "" Empty Strings should return false either way edit: also another thought, maybe check that the weapons don't have non-empty but blank strings in their name field, such as " " or something similar. Edited February 12, 2016 by blennus Link to comment Share on other sites More sharing options...
icecreamassassin Posted February 12, 2016 Author Share Posted February 12, 2016 OMG I feel like a rube, lol. I forgot to copy the stupid plugin into the MO folder, the one it was running off of didn't have items on the weapon sublists yet lol... thanks for trying to help, all resolved now :) Link to comment Share on other sites More sharing options...
blennus Posted February 12, 2016 Share Posted February 12, 2016 lol. It happens. I've done the exact same thing before too, scratching my head wondering why it isn't working as intended, when all I forgot to do was to copy the pex file to the right folder. :laugh: Link to comment Share on other sites More sharing options...
Recommended Posts