Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Clopen

Using DST's Util Module

Recommended Posts

Clopen    12

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. =)

Share this post


Link to post
Share on other sites