Is there any way to get string input from the user from within sr3_city.lua?

One thing I've wanted to do is add a new command to Sandbox+ that prompts the user for a Lua command, and then executes it. It is possible to execute code from a string in Lua using loadstring("code here")(), but the problem is actually getting the string from the user. I tried calling the routine used for naming outfits and entering cheats, but it didn't work. I assume the proper functions cannot be called from sr3_city.lua. I read somewhere (I think it was a developer's post) that the Lua filesystem functions were removed to save memory, so loading a string from a file (or a whole script, for that matter) is out. Is there any way to get arbitrary string input from a source that doesn't require restarting the game with each new input?
 
I can't think of a good way to get a user entered string from the gameplay Lua state. :(

I'm adding a note to my list of bugs/features to add a hook for this. Hopefully we can get this added in an upcoming patch for you.
 
Back
Top