Jump to content

Reloading Scripts, Textures In-Game


frootloopers

Recommended Posts

I've been testing stuff out related to attachments in debug mode, but having to repeatedly quit and continue to see the effects is time-consuming. Textures are worse because I've gotta close the game as well.

Is there a better way?

I know you can just reload lua files and models auto-update when the file is updated, but I cant find a way to do the same with .txt files and textures.

Link to comment
Share on other sites

Scripts must be parsed by the ScriptManager, to get this done at runtime, you must reinit the mod which contains them.

 

Here are som example calls:

getCore():ResetLua('default')    -- reinit everythings
getCore():ResetLua('foo')        -- reinit files from mod with id "foo"
getCore():ResetLua('foo', _G['bar.baz'])  -- reinit mod "foo" and call global object bar.baz

 

I never came up to test the third one since I didn't need that yet - just found it in the java classes and noted it for now. Might be useful for live mod updates or whatever.

But for debugging the first and second should be enough.

Edited by stuck1a
typo
Link to comment
Share on other sites

  • 8 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...