skyrimisokiguess Posted September 7, 2022 Share Posted September 7, 2022 Hello everyone, I'm relatively new to Skyrim modding and Papyrus, but sometimes I feel like I just can't find reference info about some really basic things. I'm trying to parse a string that contains a Hexadecimal number into an int value (eg. "0x10" -> 16). Basically, I'm reading Form ID values from a config file, and I want to use them for Game.GetFormFromFile but I just can't figure out how to parse the string as a hex int.I've tried casting to int, but that just seems to parse it as 0 (maybe because of the leading 0? If I pass "123" to sampleText it makes it to the message properly): String sampleText = "0xF" Debug.MessageBox(sampleText as int) ; Outputs 0 I'm running out of ideas about how to handle this, and I really don't want to write my own parser. Does anyone know of a string hex number parser either built in or in SKSE or PapyrusUtil? I'm hoping this is just a noob question with a really simple answer. Thanks,v Link to comment Share on other sites More sharing options...
skyrimisokiguess Posted September 8, 2022 Author Share Posted September 8, 2022 For anyone visiting from the future, I just wrote it myself. I uploaded it on Nexus as HexUtil, if anyone ever needs this functionality too and is feeling a bit lazy. Link to comment Share on other sites More sharing options...
Recommended Posts