Jump to content

Recommended Posts

modmain.lua

assets ={	Asset( "IMAGE", "minimap/afestertoy.tex" ),	Asset( "ATLAS", "minimap/afestertoy.xml" ),	Asset( "IMAGE", "minimap/afester.tex" ),	Asset( "ATLAS", "minimap/afester.xml" ),}AddMinimapAtlas("minimap/afestertoy.xml")AddMinimapAtlas("minimap/afester.xml")

afester.lua

    inst.MiniMapEntity:SetIcon("afester.tex")

afestertoy.lua

local common_postinit = function(inst)     if data.AfestertoyState == "SPISTER" then	inst.MiniMapEntity:SetIcon( "spistertoy_alive.tex" )    elseif data.AfestertoyState == "SLUSTER" then	inst.MiniMapEntity:SetIcon( "slustertoy_alive.tex" )    elseif data.AfestertoyState == "SPITSTER" then	inst.MiniMapEntity:SetIcon( "spistertoy_alive.tex" )	elseif data.AfestertoyState == "AFESTER" then	inst.MiniMapEntity:SetIcon( "afestertoy_alive.tex" )    endend

I am not really worried so much about the afestertoy but afester should be easy however it is not showing up. new game or old.

 

i have the xml and tex in minimap folder in mod base directory.

 

I am also having trouble getting a 3rd morph working on afester but i haven't exhausted all attempts to get it working.

Every instance with MiniMapEntity:SetIcon() it seems they use a .png for the image instead of a .tex.

 

Perhaps this is the source?

 

Edit1:

Another mod has a minimap icon setup and it is using a .tex, checking further.

 

Edit2:

Each mod has the XML, TEX, and PNG for the minimap.

Perhaps it is needing the .png for it to work.

 

Checking further.

 

Edit3:

Are these prefabs?

 

There seems to be something missing.

Edited by CarlZalph

modmain.lua

assets ={	Asset( "IMAGE", "minimap/afestertoy.tex" ),	Asset( "ATLAS", "minimap/afestertoy.xml" ),	Asset( "IMAGE", "minimap/afester.tex" ),	Asset( "ATLAS", "minimap/afester.xml" ),}AddMinimapAtlas("minimap/afestertoy.xml")AddMinimapAtlas("minimap/afester.xml")

afester.lua

    inst.MiniMapEntity:SetIcon("afester.tex")

afestertoy.lua

local common_postinit = function(inst)     if data.AfestertoyState == "SPISTER" then	inst.MiniMapEntity:SetIcon( "spistertoy_alive.tex" )    elseif data.AfestertoyState == "SLUSTER" then	inst.MiniMapEntity:SetIcon( "slustertoy_alive.tex" )    elseif data.AfestertoyState == "SPITSTER" then	inst.MiniMapEntity:SetIcon( "spistertoy_alive.tex" )	elseif data.AfestertoyState == "AFESTER" then	inst.MiniMapEntity:SetIcon( "afestertoy_alive.tex" )    endend

I am not really worried so much about the afestertoy but afester should be easy however it is not showing up. new game or old.

 

i have the xml and tex in minimap folder in mod base directory.

 

I am also having trouble getting a 3rd morph working on afester but i haven't exhausted all attempts to get it working.

 

Post your full code, what you've given does not give enough information.

how do you do the spoiler thing?

 

i just got all three morphs working. stupid missing one letter. here is the link to the mod I will be changing the different chester forms later. right now they are just place holders to make sure it is all working before i move forward. use stuff() to spawn in stuff

how do you make something a spoiler on these here forums?

 

any idea what i need to do to fix this?

 

on our custom chester when a client accesses the inventory of bluechester the client crashes and this pops up.

[00:00:57]: [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-113>   self =      callbacks = table: 1FA1F208      slotsperrow = 3      inst = 100643 -  (valid:true)      focus = false      children = table: 1FA1E920      focus_flow_args = table: 1FA295A0      focus_target = false      isopen = false      owner = 100073 - wx78 (valid:true)      open = false      inv = table: 1FA295C8      parent =       name = Container      enabled = true      focus_flow = table: 1FA21FF8      bgimage = Image - :      bganim = UIAnim      shown = true   container = 100070 - bluechester (valid:true)   doer = 100073 - wx78 (valid:true)   widget = nilscripts/screens/playerhud.lua:171 in (method) OpenContainer (Lua) <163-174>   self =      fireover = FireOver      shown = true      overlayroot = overlays      inst = 100074 -  (valid:true)      focus = true      handlers = table: 25A221A0      children = table: 25A21EF8      clouds = UIAnim      enabled = true      focus_target = false      vig = UIAnim      under_root = under_root      owner = 100073 - wx78 (valid:true)      controls = Controls      eventannouncer = EventAnnouncer      iceover = IceOver      root = root      name = HUD      focus_flow_args = table: 25A22178      focus_flow = table: 25A22150      callbacks = table: 25A21F48      parent = screenroot      bloodover = BloodOver   container = 100070 - bluechester (valid:true)   side = false   containerwidget = Containerscripts/components/container_replica.lua:204 in (method) Open (Lua) <190-211>   self =      ondetachclassified = function - scripts/components/container_replica.lua:64      acceptsstacks = true      _numslots = 0      _isopen = false      issidewidget = false      _cannotbeopened = net_bool (0CEB40D8)      classified = 100642 - container_classified (valid:true)      inst = 100070 - bluechester (valid:true)   doer = 100073 - wx78 (valid:true)scripts/components/container_replica.lua:58 in (field) fn (Lua) <56-59>   inst = 100070 - bluechester (valid:true)   self =      ondetachclassified = function - scripts/components/container_replica.lua:64      acceptsstacks = true      _numslots = 0      _isopen = false      issidewidget = false      _cannotbeopened = net_bool (0CEB40D8)      classified = 100642 - container_classified (valid:true)      inst = 100070 - bluechester (valid:true)scripts/scheduler.lua:187 in (method) OnTick (Lua) <161-217>   self =      running = table: 14FFED18      waitingfortick = table: 14FFECF0      tasks = table: 14FFECC8      waking = table: 1FA2A158      attime = table: 14FFED90      hibernating = table: 14FFED68   tick = 309   k = PERIODIC 100070: 0.000000   v = true   already_dead = falsescripts/scheduler.lua:398 in (global) RunScheduler (Lua) <396-404>   tick = 309scripts/update.lua:162 in () ? (Lua) <146-213>   dt = 0.033333335071802   tick = 309   i = 309[00:00:57]: SCRIPT ERROR! Showing error screen	[00:00:58]: QueryServerComplete no callback[00:00:58]: QueryServerComplete no callback[00:01:00]: Force aborting...

Edited by afetogbo

@afetogbo, you make a spoiler with:

[spoiler] text [/spoiler]

EDIT: I leave the code blurb. :-)

 

[*spoiler] text [*/spoiler]

without the *

 

Regarding you issue: are you using one of the widgets being setup in containers.lua or are you using a custom one? If you are using a custom one, you will have to extend the functionality of containers.widgetsetup to read and include your widget data.

Edited by DarkXero

We are just using chester container and shadowchester. from the base game. do we need to set up a custom container because frankly that is beyond me. I still haven't figured out the ins and outs of functions. wish i had a mentor but you guys are doing great helping me out.

 

blue chester is basily just a reskin clone of chester. we got everything working and then found this bug

 

http://steamcommunity.com/sharedfiles/filedetails/?id=407977022

Edited by afetogbo

I tracked down the issue.

 

The widget is not being constructed because the client is calling containers.widgetsetup(self).

This means the function will use self.inst.prefab as parameters to get the info of the widget.

 

Since there are no params, the client won't be able to construct the widget.

For hosts, it doesn't matter because you set the widget via another function and you give it the prefab "chester" as argument.

 

To fix the client crash, what is needed in modmain is:

containers = require "containers"local old = containers.widgetsetupfunction containers.widgetsetup(self, prefab, data)	if self.inst.prefab == "bluechester" then		prefab = "chester"	end	return old(self, prefab, data)end

so the client calls the function using a prefab, and a prefabs that it has the parameters for.

 

Now, I found a bug in your mod,

[00:01:54]: [string "../mods/workshop-407977022/scripts/prefabs/..."]:163: variable 'MorphBlueShadowChester' is not declaredLUA ERROR stack traceback:=[C]:-1 in (global) error (C) <-1--1>scripts/strict.lua:23 in () ? (Lua) <21-26>   t = table: 064E25E0   n = MorphBlueShadowChester../mods/workshop-407977022/scripts/prefabs/bluechester.lua:163 in (method) MorphBlueChester (Lua) <152-164>   inst = 110289 - bluechester (valid:true)   canBlueShadow = true   canBlueSnow = false   container = table: 07509F08../mods/workshop-407977022/scripts/stategraphs/SGbluechester.lua:182 in (field) fn (Lua) <179-184>   inst = 110289 - bluechester (valid:true)scripts/stategraph.lua:550 in (method) UpdateState (Lua) <518-562>   self =      tags = table: 0FD1AC80      mem = table: 0750C348      statemem = table: 0FD21D00      currentstate = table: 04DB5748      timeinstate = 2.0000001043081      sg = Stategraph : bluechester      inst = 110289 - bluechester (valid:true)      statestarttime = 103.63333873823      bufferedevents = table: 0E03B340      lastupdatetime = 105.63333884254      laststate = table: 04DB4CA8      prevstate = table: 04DB4CA8   dt = 0.13333334028721   startstate = table: 04DB5748   idx = 2   old_time = 2.0000001043081   extra_time = 1.0430812835693e-007scripts/stategraph.lua:589 in (method) Update (Lua) <581-609>   self =      tags = table: 0FD1AC80      mem = table: 0750C348      statemem = table: 0FD21D00      currentstate = table: 04DB5748      timeinstate = 2.0000001043081      sg = Stategraph : bluechester      inst = 110289 - bluechester (valid:true)      statestarttime = 103.63333873823      bufferedevents = table: 0E03B340      lastupdatetime = 105.63333884254      laststate = table: 04DB4CA8      prevstate = table: 04DB4CA8   dt = 0.13333334028721scripts/stategraph.lua:123 in (method) Update (Lua) <107-146>   self =      updaters = table: 0C3349E8      OnEnterNewState = function - scripts/stategraph.lua:27      tickwaiters = table: 0617E348      haveEvents = table: 0C3341F0      hibernaters = table: 0617E398      instances = table: 0617E2F8   current_tick = 3169   waiters = table: 13E44F80   updaters = table: 0C33AAA0   k = sg="bluechester", state="transition", time=2.00, tags = "busy,"   v = truescripts/update.lua:199 in () ? (Lua) <146-213>   dt = 0.033333335071802   tick = 3169   i = 3169

caused when Bluster morphed into shadow Bluster in a full moon.

 

And this is because:

local function MorphShadowBlueChesterDobMorph(inst, canBlueShadow and MorphBlueShadowChester

Pick one.

Edited by DarkXero
To fix the client crash, what is needed in modmain is:

 I thought that patch was no longer necessary? He should be able to just pass "chester" to the prefab parameter, here.

 

Edit: Ah, so the client is getting it from container_replica and calling widgetsetup(self). @PeterA I guess this still needs a bit of patching? If widgetsetup, called on the host, caused it to store a netvar for the prefab or params and sent that, that would solve it.

Edited by rezecib

Thankyou so much for the help with the containers problem we were having! This has been updated.

 

And yes the morphing into shadow bluster is still being a pain in our keesters. It also doesn't help that I've been sick and dealing with a bunch of family issues to be right here digging through the code all day. Afe and I have been shooting in the dark for this mod the entire time.

@DarkXero are you sure? this is the original chester code

local function MorphChester(inst)    local canShadow, canSnow = CanMorph(inst)    if not (canShadow or canSnow) then        return    end    local container = inst.components.container    for i = 1, container:GetNumSlots() do        container:RemoveItem(container:GetItemInSlot(i)):Remove()    end    DoMorph(inst, canShadow and MorphShadowChester or MorphSnowChester)end

 

oh and I will have more to ask when i start trying to get the hider spider behavior into one of the transformations and the spitter spider into another.

 

edit: also would we need to do this for the shadowchester container? because right now when he morphs to shadow chester he still has chester 3x3 but he should have shadowchester 3x4

containers = require "containers"local old = containers.widgetsetupfunction containers.widgetsetup(self, prefab, data)    if self.inst.prefab == "bluechester" then        prefab = "shadowchester"    end    return old(self, prefab, data)end

 

I found this while looking in the chester code and it looked fishy.

    inst.OnSave = OnSave
    inst.OnLoad = OnLoad

 

now it has the onsave function but no onload function

 

what it does have is

local function OnPreLoad(inst, data)
    if data == nil then
        return
    elseif data.ChesterState == "SHADOW" then
        DoMorph(inst, MorphShadowChester)
    elseif data.ChesterState == "SNOW" then
        DoMorph(inst, MorphSnowChester)
    end
end

 

is this an error or intended?

Edited by afetogbo

Alright so this should all be fixed now with the bluster morphing into shadow bluster. If not then it's back to the drawing board, thanks for the little highlight on that thread of code as to why it wasn't working.

 

As a quick question that might sound stupid, but I am adding in 'Big Daddy' chester to this mod hopefully tonight.

 

But before doing that, I want him to have the inventory of shadow chester. He won't be able to morph, which is his own downfall for being so fat (yes he's fat too). I want to make sure he will spawn in with the shadow chester stuff without much of a hiccup in jsut being shadow chester reskinned into big daddy and not morphing.

 

Which string of code is it I would change on the normal chester, so he has the shadow chester inventory?

@afetogbo, my bug correction points out that the function is "MorphShadowBlueChester" and in the morph process, "MorphBlueShadowChester" is called.

 

The host can mangle with widgets as he likes, but the client is a bit different. If nothing gets added to the client part of the chester prefab, then a client will load the chester widget via widgetsetup(self), and the function will look for self.inst.prefab, which is bluechester.

 

Since chester morphs to shadow chester and the prefab keeps being chester, Klei put the OnIsShadowChesterDirty(inst) for the client, so the client calls inst.replica.container:WidgetSetup("shadowchester") in order to update. When you edited "shadowchester" to "blueshadowchester" inside "OnIsBlueShadowChesterDirty", you broke it, because there are no params for "blueshadowchester". You can either edit widgetsetup with

if prefab == "blueshadowchester" then   prefab = "shadowchester"end

or just leave it at shadowchester. I would rather you leave it at shadowchester.

 

Your fishy code should have OnPreLoad instead of OnLoad then?

 

Finally, now that I think of it, maybe instead of editing widgetsetup, what we can do is edit the not TheWorld.ismastersim so it looks like:

    if not TheWorld.ismastersim then        inst.replica.container:WidgetSetup("chester")        inst._clientshadowmorphed = false        inst:ListenForEvent("onisblueshadowchesterdirty", OnIsBlueShadowChesterDirty)        return inst    end

and see if it works.

We were wondering what the isshadowchesterdirty thing was. I'll try out both of them and see what happens. With the widget setup on the shadow chester inventory, would that be the easiest method for putting in Big Daddy with the Shadow Chester abilities?

 

Also I need to know if deleting snow chester and shadow chester from the code will stop big daddy from ever morphing. Because the downside to him is he can't morph.

Alrighty thanks, now I jsut gotta get the anim files to actually convert. The converter keeps telling me there is no chester_budy.png (when it's right in this things face!) Im about to write chester_body.png on a piece of paper then throw it at the computer.

 

Oh scripter, how I love you so... Until you decide to be a pain in the butt! (why was it easier with bluster?)

Okay now I just have to edit a few things in the code to get the skin I made for Big Daddy to work... And then place the stuff in the same mod as bluster and hope things work -crosses fingers-

 

Also unfortunately the widget stuff for shadow bluster had no luck. I'll have to go back to square one with him maybe or think of some other thing he hcan do as a shadow chester. We did change the code so he can transform on any night you wish it to happen for bluster after all.

Well now Im having an issue getting big daddys code to actually READ big daddy as big daddy. The game has started to throw hissy fits at me over the chester_build already existing and blah blah blah all over again. This was one of our first issues when we had made bluster but I've gone through all of the code and theres no sign of anyting with chester_build.

 

I'll throw him into the test folder of the mod itself for you to take a look at. He's supposed to be a seperate chester all in one (big white beard too)

well this is what it should have been like for blue chester

 

local function OnIsSlusterDirty(inst)
    if inst._issluster:value() ~= inst._clientslustermorphed then
        inst._clientslustermorphed = inst._issluster:value()
        inst.replica.container:WidgetSetup(inst._clientslustermorphed and "shadowchester" or nil)
    end
end

 

    if not TheWorld.ismastersim then
        inst._clientslustermorphed = false
        inst:ListenForEvent("onisslusterdirty", OnIsSlusterDirty)
        return inst
    end
 

Yes. Here's the zip for blue chester.

 

Also, rezecib,

if not TheWorld.ismastersim then    inst:DoTaskInTime(0, function()        inst.replica.container:WidgetSetup("chester")    end    inst._clientshadowmorphed = false    inst:ListenForEvent("onisblueshadowchesterdirty", OnIsBlueShadowChesterDirty)    return instend

is a nice hack that avoids touching widgetsetup at all.

 

Bigdaddy_build had the chester_build name, so I renamed it, but when I tried to load it, Don't Starve crashed. Maybe it's corrupt? So I suggest you take a tea and calm down, then try again.

 

Code is fine, I used chester banks and animations, for him and his eyebone.

 

Zips:

workshop-407977022.zip

daddy.zip

Edited by DarkXero

lol i tried to tell her that but she said she already did that.

 

so to get both chester and shadow chester containers can i do

if not TheWorld.ismastersim then    inst:DoTaskInTime(0, function()        inst.replica.container:WidgetSetup("chester")        inst.replica.container:WidgetSetup("shadowchester")    end     inst._clientshadowmorphed = false    inst:ListenForEvent("onisblueshadowchesterdirty", OnIsBlueShadowChesterDirty)    return instend

@afetogbo, you just put in bluster

if not TheWorld.ismastersim then    inst:DoTaskInTime(0, function()        inst.replica.container:WidgetSetup("chester")    end     inst._clientshadowmorphed = false    inst:ListenForEvent("onisblueshadowchesterdirty", OnIsBlueShadowChesterDirty)    return instend

because the

inst.replica.container:WidgetSetup("shadowchester")

gets performed when bluster updates to shadow bluster, so it's not needed.

 

Download the first zip I put on my previous post, it will show you.

 

If you use your code, you will end up having the chester widget on host, and shadowchester widget on client. Each container has one widget, you either load one or the other. chester at the beginning, shadowchester when chester morphs, and chester when shadowchester demorphs.

Edited by DarkXero

ok... I am calm... thanks for the help guys you are awesome, there's a lot of things with this mod that Im trying to work out. Meanwhile in the real world there's things that are keeping me from being able to focus on this project or even work on it so diligently and I always feel rushed and I feel bad sometimes too when I leave Afetogbo to work on some of this stuff by himself.

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