icecreamassassin Posted October 1, 2015 Share Posted October 1, 2015 So GetName() can pull an item name off an item that is on a formlist with no problem, but it can't do so from a nested FormList (a formlist within a formlist). Can anyone think of a way to structure a simple function such as if it calls GetName() on the index and results in NONE to call up the formlist AT said index and run GetName() on that list's index 0 instead? I'm just mentally fried at the moment and get get my head around it. I've managed to condense my 2K+ lines of MCM code down to a few hundred, but this one function is sort of holding me up. Thanks in advance. Link to comment Share on other sites More sharing options...
icecreamassassin Posted October 1, 2015 Author Share Posted October 1, 2015 Well maybe I have a solution. I coded this to check if the GetName() result string is "" or not (returns text or none) and if it returns no text fill another property with what FormList is at the index location and then poll it's 0 index for a name. Compiles fine, but wanna check here before testing it out. Function ListItem() ObjectReference DISP Form ITM While Index < ITMCNT DISP = DISPLIST.GetAt(Index) as ObjectReference if ITMLIST.GetAt(index) as Form != "" ITM = ITMLIST.GetAt(Index) as Form elseif ITMLIST.GetAt(index) as Form == "" SubList = ITMLIST.GetAt(Index) as FormList ITM = Sublist.GetAt(0) as Form Endif ItemName = ITM.GetName() 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...
icecreamassassin Posted October 1, 2015 Author Share Posted October 1, 2015 Well it doesn't seem to work in game AND it seems to take 4 times longer than my old script lol Link to comment Share on other sites More sharing options...
icecreamassassin Posted October 1, 2015 Author Share Posted October 1, 2015 Nevermind I got it working. Had some functions conditioned in the wrong order :P 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 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...
sLoPpYdOtBiGhOlE Posted October 1, 2015 Share Posted October 1, 2015 (edited) Edit: NVM, you already got it... Edited October 1, 2015 by sLoPpYdOtBiGhOlE Link to comment Share on other sites More sharing options...
Recommended Posts