krylincy

Adapt DS Mod to Dst and get widget error

Recommended Posts

krylincy    1

Hi,

so I tried to adapt the DS mod to DST and it will not work. I alreday updated the ThePlayer stuff, but there is still something missing ... about widget replica.

 

Creating the item is working, but when i will open/use it, it crashes:

[00:01:35]: [string "scripts/widgets/containerwidget.lua"]:29: attempt to index local 'widget' (a nil value)
LUA ERROR stack traceback:
scripts/widgets/containerwidget.lua:29 in (method) Open (Lua) <24-149>
   self =
      callbacks = table: 7E6DEBC8
      slotsperrow = 3
      inst = 101727 -  (valid:true)
      focus = false
      children = table: 7E6DEC40
      focus_flow_args = table: 7E6DF1B8
      focus_target = false
      isopen = false
      owner = 100184 - wendy (valid:true)
      open = false
      can_fade_alpha = true
      inv = table: 7E6E0658
      parent = 
      name = Container
      bgimage = Image - :
      focus_flow = table: 7E6DEB78
      enabled = true
      bganim = UIAnim
      shown = true
   container = 101056 - casket (valid:true)
   doer = 100184 - wendy (valid:true)
   widget = nil

 

The problem my be in the new compontent: https://github.com/krylincy/local_casket/blob/master/scripts/components/casket.lua

but i don't know whats wrong. i read about init the widget https://github.com/krylincy/local_casket/blob/master/scripts/prefabs/casket.lua#L60

but that isnt working ...

 

any help would be great :)

 

Share this post


Link to post
Share on other sites
krylincy    1

For anyone who land here:

We need to add the container widget to the replica, too:

 

if not TheWorld.ismastersim then
		inst.OnEntityReplicated = function(inst) 
			inst.replica.container:WidgetSetup("casket",containerparams.casket) 
		end
		
		return inst
	end	

 

Share this post


Link to post
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