Jump to content

Small mod scripting question.


Recommended Posts

I'de like know how to override a few clock functions from widgets/uiclock.lua and I'm not shure how to access the clock and it's functions.

 

I've tried:

GLOBAL.UIclock

and

GLOBAL.GetClock()

as I've seen in this thread: http://oldforums.kleientertainment.com/showthread.php?10817-Creating-a-Mod-using-the-Mod-System/page10

 

but neither seem to work since "the variables are not declared"

 

Anyone have an idea on how to do this?

 

 

 

Not shure if this is the right location to ask about a mod scripting question. Sorry if it is not!

Link to comment
Share on other sites

Actually managed to figure out a way which is working for me.

 

example to override the UpdateDayString() function of the clock

 

local require = GLOBAL.requirelocal tempclock = require "widgets/uiclock"tempclock.UpdateDayString = function (self)    //codeend

 

 

 

Link to comment
Share on other sites

Another question:

 

How can someone overwrite a script file completely ?

 

 

 

I've tried adding the directories  scritps/components/.....

 

with the lua file I want to replace but it doesn't seem to work.

Link to comment
Share on other sites

I've tried adding the directories  scritps/components/.....   with the lua file I want to replace but it doesn't seem to work.
 That should work. That is the method I am using in DST RoG Characters to replace the eater component, spiderbrain, etc. If it's not working then the issue is probably elsewhere...
Link to comment
Share on other sites

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
 Share

×
  • Create New...