BlocTheWorker / Inworld-Skyrim-Mod

Source Code of Skyrim's Inworld AI Mod. Contains C++, Papyrus and Typescript code

Home Page:https://bloctheworker.github.io/Inworld-Skyrim-Mod/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refactor InworldConversation.psc

AlexBeesley opened this issue · comments

commented

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
commented

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.

commented

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.