Refactor InworldConversation.psc
AlexBeesley opened this issue · comments
Great work btw, I was looking at the source code and noticed you had a bunch of ElseIf
statements in your StringToActionIndexConverter
function... Its a bit messy and slow to do that, I suggest this:
Int Function StringToActionIndexConverter(string str)
Int index = try(Int(str), 1)
return clamp(index, 1, 15)
EndFunction
Great suggestion! I wasn't aware of any proper way to convert a string to an integer in Papyrus when I wrote that. So, I chose the quickest (and dirtiest) method. I will take a look at this and refactor it as soon as possible.
No worries, Papyrus isn't ideal, but we must work with what our lord and saviour, Todd Howard, provides. I'll keep an eye on this project and am happy to lend a hand if required.