EQ2Interface (http://www.eq2interface.com/forums/index.php)
-   XML Modification Help & Info (http://www.eq2interface.com/forums/forumdisplay.php?f=22)
-   -   Extracting portion of a GameData string (http://www.eq2interface.com/forums/showthread.php?t=18537)

Seagoat 05-18-2018 09:35 PM

Extracting portion of a GameData string
Still chipping away at updating my XP Bars mod, and I'm curious if there's a way to extract only a portion of the string returned by a GameData element.

For instance, I'd like to get only the class name from /GameData.Self.AscensionLevelClass. The default string returned is "Level X Classname," and while there's a way to get just the level with GameData (.AscensionLevel), there's no class name equivalent.

Is there a DynamicDataFilter that will accomplish this (I am a 100% bitflag noob), or a bit of fancy code I can use to return only the third word in the string?

Darqwood 05-19-2018 08:42 AM

Splitting a string into parts generically, I've never found a way to do that. But you can do your specific example by setting up four concatenated strings:

"Level " ## .AscensionLevel ## " Elementalist"
"Level " ## .AscensionLevel ## " Etherealist"
"Level " ## .AscensionLevel ## " Geomancer"
"Level " ## .AscensionLevel ## " Thaumaturgist"

and then compare each of them to .AscensionLevelClass. If the character has an Ascension class, one of them will match. It's not sexy but it works. There is an example "FindAscClass" in the DarqUI broker window.


Seagoat 05-19-2018 02:52 PM

Wow, thanks! I'll have to dig in and see what I can find!

All times are GMT -5. The time now is 09:18 AM.

vBulletin® - Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.