Nadevill

  • Content Count

    14
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Posts posted by Nadevill


  1. Did the most recent patch change this?

     

    attachicon.gifcustom slot sizes.JPG

     

    I'm going to see if it's easy to edit the background to the chest tomorrow, I'm just to tired to change it right this second.

     

    Or is it a problem with clients? I haven't tested that.

     

    EDIT: added a new picture, because I got a custom texture working, I'm working right now on making it more 'nicely' moddable

     

    To clarify: it's fairly nicely moddable as it is, but you have to replace the containers.lua with a mod. more "mildly annoying" than anything, and it means multiple mods that use containers.lua wouldn't work together.

     

    This may be due to the way container_replica and container_classified work, but I'll keep looking in to it.

     

    I'm not sure how much farther I can go with this, I keep getting frustrated. I've uploaded the rar here, in case someone wants to take it and run with it to try to make it more 'nicely' moddable.

     

    The best solution I can think of is to get an "AddParams" function going, but I'm far too tired right now to even think about it.

     

    The params may be local, but the function widgetsetup is Global.

    local containers = require "containers"containers.old_widgetsetup=containers.widgetsetup--define params here for your prefab- mine is cookpot.local params = {}params.cookpot ={}function containers.widgetsetup(container, prefab)    target = prefab or container.inst.prefab    if target == "cookpot" then        local t = params.cookpot        if t ~= nil then            for k, v in pairs(t) do                container[k] = v            end            container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0)        end    else        containers.old_widgetsetup(container,prefab)    endend

  2. I've been  working on it for days using different tactics, and I cant seem to get it.

    Background:

    Curreny, The mod works this way:

    The container widget setup is overriden to add a button. its functionality is 

    --server size    if inst.components.container ~= nil then        GLOBAL.BufferedAction(inst.components.container.opener, inst, action):Do()    --client size    elseif inst.replica.container ~= nil and not inst.replica.container:IsBusy() then        GLOBAL.SendRPCToServer(GLOBAL.RPC.DoWidgetButtonAction, action.code, inst,action.mod_name)    end

    when the action is PREDICT, defined here:

    PREDICT.str = "Predict"PREDICT.id = "PREDICT"PREDICT.fn = function(act)	if act.target:HasTag("SMARTERCROCKPOT") then		item ,odds= act.target.components.predicter:Predict()	endend

    where the predicter components does the calculation, and outputs the result using:

    prefab:PushEvent("prediction", {item = loot,odds = chance})

    which is intercepted in the container widget (just like itemget) and activates a method to add a utilSlot (InvSlot with empty code so it does nothing) with the item to the cookpot.

     

    for more, you can always download.

     

    The problem:

    All this works for the hostonly.

    for the client, predicter:Predict() gets called, but the event isnt pushed into the widget.

     

     

    Do you have any tips or code to aid me so the mod will work for the clients too? 

    Help wiil be appreciated :)