TommInfinite Posted February 19, 2017 Share Posted February 19, 2017 (edited) Hey everyone. I noticed long time ago that if you execute this code script will stop if eval sv_temp == "StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item" endifIt happens because string on the right side is too long. There's a workaround (see below). But is there another way I don't know of? let sv_temp2 := "StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item" if eval sv_temp == sv_temp2 endif Edited February 19, 2017 by TommInfinite Link to comment Share on other sites More sharing options...
DoctaSax Posted February 19, 2017 Share Posted February 19, 2017 (edited) Odd, the string size looks perfectly ok to me. If it's in a CO block, try using parentheses : if eval (sv_temp == "thestring")or reverse the order: if eval "thestring" == sv_tempor both. (edit)If that doesn't solve anything, you may have to use sv_compare. Edited February 19, 2017 by DoctaSax Link to comment Share on other sites More sharing options...
TommInfinite Posted February 19, 2017 Author Share Posted February 19, 2017 (edited) if eval ($GetActiveUIComponentFullName == "StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item") if eval ("StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item" == $GetActiveUIComponentFullName) if eval (sv_Compare "StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item", sv_temp) == 0 ; sv_temp is GetActiveUIComponentFullName I tried these and they still broke the script. Have you never encountered that? Edited February 19, 2017 by TommInfinite Link to comment Share on other sites More sharing options...
DoctaSax Posted February 19, 2017 Share Posted February 19, 2017 No, sorry, I'm just not seeing it. But since you're really not comparing a string var to a string but comparing two actual strings with each other, maybe you can do without the eval, and see if that removes the obstacle. Link to comment Share on other sites More sharing options...
TommInfinite Posted February 20, 2017 Author Share Posted February 20, 2017 Maybe it's one of those "Only enplczru" kind of bugs? Comparing string to a string is working fine. I don't like the idea of declaring string vars each time function checks for something. I also don't like the idea of keeping string variables in .nvse cosave. Maybe I'll use ModLocalData. Link to comment Share on other sites More sharing options...
PushTheWinButton Posted February 27, 2017 Share Posted February 27, 2017 I had similar script crashes which were hard to pin down when using ModLocalData, too. I find I often need to assign a variable from it beforehand and use that that in any if checks. ModLocalDataExists is particularly prone to crashing as I remember. Strings in general just seem to play up in ifs. Link to comment Share on other sites More sharing options...
TommInfinite Posted February 27, 2017 Author Share Posted February 27, 2017 I ended up using this code and it works. I think it's less CPU intensive than setting strings every time function is called. SetModLocalData "UINameTemp01" "StartMenu/NOGLOW_BRANCH/options_container/lb_meter_template_item" ; on game restart let sv_temp := GetActiveUIComponentFullName if eval (sv_temp == GetModLocalData "UINameTemp01") endif Link to comment Share on other sites More sharing options...
Recommended Posts