Fluxistence Posted May 21, 2019 Share Posted May 21, 2019 DST has a module called "util" in its scripts bundle which contains various scripting paraphernalia that one may find useful. I'd like to use the weighted_random_choice() function it has, but when I use require "util" to import the code (currently to my modmain file but I plan on moving it out of there shortly) and then use it, I get an error for invoking a nil value. I know I can copy the function, of course but since it's already there and various game scripts use it, I figure there should be a way to import it into a mod environment as well - or am I wrong? Assistance would be appreciated, like always. =) Link to comment Share on other sites More sharing options...
Cunning fox Posted May 21, 2019 Share Posted May 21, 2019 You don't need to load it, it's loaded already in the global env. Use GLOBAL.weighted_random_choice() 1 Link to comment Share on other sites More sharing options...
Fluxistence Posted May 21, 2019 Author Share Posted May 21, 2019 Oh, you're right. How lovely. =) Thanks. ^_^ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now