• Content Count

  • Joined

  • Last visited

Community Reputation

5 Neutral

About Gobbel

  • Rank
    Junior Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi guys, sorry for the late reply. I incorporated a few of Ultraman´s tips regarding debugging and I actually found a problem with the new mushroomstump prefab and could fix that. However, still nothing new regarding the minimap icon. I try to use a few prints to check what´s wrong, but so far I think the only print that makes sense to use is the one which checks if that function is called or not, am I right? But, just as a side note. I also had a lot of trouble with my inventory images and in the end it was all because of faulty tex and atlas files, the code was correct. So maybe, this here is the same. Although I used the autocompiler for my png... Well, I´ll triple check XD
  2. I tried your suggestion, but still no icon showing. It really is driving me crazy, because if even someone like you says it should work, then it really should work indeed. I haven´t tried using print statements, because basically I haven´t yet learned how to use them. I am still a newbie and basically just use trial and error as well as reverse engineering code from already working mods.
  3. Oh, okay, thanks. So something went wrong with the conversion from png to tex/atlas, is that what you are saying? Then I will try to make a new tex and atlas. Edit: had a quick look at the file, and now it is so obvious. Thank you very much for pointing that out! Edit2: However, even after changing the atlas to the correct tex filename with notepadd++ it still won´t show on the minimap Do you have any idea why that is the case?
  4. Yes, that is true. But actually that code is not in use, hence the "--" in front of it. Basically I tried a modular approach, the code is identical to the one found in the original gold rock minimap icon mod. So all earlier to a minimap icon relevant code in the actual prefab file is not in use. All the work is handled in the modmain. The code is still the same, only the application method differs. But it still doesn´t work.
  5. Hi all, currently I am trying to get a minimap icon to work, but it doesn´t work. I looked at the sample mod, the old goldrocks icon mod, the beefalo icon mod, and I tried to find the fault in the code. However, I couldn´t find any, it should work correctly, but in-game there still is no minimap icon showing. There are no errors in any form also, meaning the game runs stable. I just upload my mod to here, and if anyone could help me find the mistake I would gladly appreciate it! Thank you very much! Dont Starve Together Mod v4.zip
  6. Okay, so I got it working fully. I used Felix Alchemy Potions as a base.
  7. Alright, then I guess I have to create a custom tech tree. I thought I could do without, but well. Thank you very much indeed for the help!
  8. Could you help me out one more time please? As I wrote above I added the tags to both the prototyper and the new recipes. ("mealermealer") But, even if there is no crash at all now, because I set all the tech trees to 1 instead of 0, the recipes won`t show up. I guess it is because of the tags. How is it possible to have these new recipes linked to the new prototyper only without creating a new tech tree? Or do I absolutely have to create one? Sorry for being such a trouble, but your knowledge is just too great a temptation to ask you.
  9. Thank you so much, I love you man! I`ll change that immediately. Such a simple mistake drove me nuts and I couldn`t figure it out. QQ Can I ask you one more thing? If I want the new recipes to only be available when the player is near the new prototyper I don`t have to add any new code, do I? Because the inst.components.prototyper.onturnon = OnTurnOn inst.components.prototyper.onturnoff = OnTurnOff inst.components.prototyper.onactivate = onactivate already does that, as far as I understood. Because after adding inst:AddTag("mealermealer") to the prototyper and adding that tag in the two new recipes local flour_recipe = Recipe("flour",{ Ingredient("wheat", 2) }, RECIPETABS.REFINE, {SCIENCE = 0}, nil, nil, true, nil, "mealermealer") flour_recipe.atlas = "images/inventoryimages/flour.xml" local turnip_sugar_recipe = Recipe("sugar",{ Ingredient("turnip", 2) }, RECIPETABS.REFINE, {SCIENCE = 0}, nil, nil, true, nil, "mealermealer") turnip_sugar_recipe.atlas = "images/inventoryimages/turnip_sugar.xml" , it crashes when it opens the crafting menu when standing near the prototyper. [00:02:24]: [string "scripts/components/builder.lua"]:193: attempt to index field 'accessible_tech_trees' (a nil value) LUA ERROR stack traceback: scripts/components/builder.lua:193 in (method) EvaluateTechTrees (Lua) <137-245> scripts/components/builder.lua:110 in (method) OnUpdate (Lua) <109-111> scripts/update.lua:192 in () ? (Lua) <149-228> [00:02:24]: Warning: Widget:SetFocusFromChild is happening on a widget outside of the screen/widget hierachy. This will cause focus moves to fail. Is ScriptErrorWidget not a screen? [00:02:24]: stack traceback: scripts/widgets/widget.lua:602 in (method) SetFocusFromChild (Lua) <599-624> scripts/widgets/widget.lua:621 in (method) SetFocusFromChild (Lua) <599-624> scripts/widgets/widget.lua:621 in (method) SetFocusFromChild (Lua) <599-624> scripts/widgets/widget.lua:649 in (method) SetFocus (Lua) <626-658> scripts/widgets/menu.lua:83 in (method) SetFocus (Lua) <74-85> scripts/widgets/scripterrorwidget.lua:109 in (method) OnUpdate (Lua) <102-119> scripts/update.lua:90 in () ? (Lua) <33-129> EDIT: let me guess, it is something with the tech tree cannot be 0, right?
  10. Sure, zip file coming right up. Unfortunately, there is no error log. I tried the mod on a new server, but it crashes before it can save anything (before day 1). Is there a way to still produce an error log? Dont Starve Together Mod.zip
  11. Hi, so this is another thing I am working on. A new prototyper. In the end this thing should make two new recipes under the REFINE tab available when standing near it! So far, I haven`t implemented these functions yet, because I cannot make it to a point where my game is stable, when placing the thing. I looked at old threads about prototypers, I even used one as an almost exact base for this one, but still, it crashes to the desktop without any error log. require "prefabutil" require "recipe" require "modutil" local assets = { Asset("ANIM", "anim/quagmire_mealingstone.zip"), Asset( "IMAGE", "images/inventoryimages/mealingstone.tex" ), Asset( "ATLAS", "images/inventoryimages/mealingstone.xml" ), } local prefabs = { "collapse_small", } local function onbuilt(inst) inst.AnimState:PlayAnimation("place") inst.AnimState:PushAnimation("idle") inst.SoundEmitter:PlaySound("dontstarve/common/cook_pot_craft") local fx = SpawnPrefab("collapse_small") fx.Transform:SetPosition(inst.Transform:GetWorldPosition()) fx:SetMaterial("stone") end local function doonact(inst) if inst._activecount > 1 then inst._activecount = inst._activecount - 1 else inst._activecount = 0 inst.SoundEmitter:KillSound("sound") end inst.SoundEmitter:PlaySound("dontstarve/common/researchmachine_lvl3_ding") end local function doneact(inst) inst._activetask = nil if not inst:HasTag("burnt") then if inst.components.prototyper.on then OnTurnOn(inst) else OnTurnOff(inst) end end end function OnTurnOn(inst) if inst.AnimState:IsCurrentAnimation("proximity_loop") then --NOTE: push again even if already playing, in case an idle was also pushed inst.AnimState:PushAnimation("proximity_loop", true) else inst.AnimState:PlayAnimation("proximity_loop", true) end if not inst.SoundEmitter:PlayingSound("dontstarve/creatures/together/clayhound/stone_shake") then inst.SoundEmitter:PlaySound("dontstarve/creatures/together/clayhound/stone_shake") end end function OnTurnOff(inst) inst.AnimState:PushAnimation("idle") end local function onactivate(inst) if not inst:HasTag("burnt") then inst.AnimState:PlayAnimation("proximity_loop") inst.AnimState:PushAnimation("idle", false) if not inst.SoundEmitter:PlayingSound("dontstarve/creatures/together/clayhound/stone_shake") then inst.SoundEmitter:PlaySound("dontstarve/creatures/together/clayhound/stone_shake") end inst._activecount = inst._activecount + 1 inst:DoTaskInTime(1.5, doonact) if inst._activetask ~= nil then inst._activetask:Cancel() end inst._activetask = inst:DoTaskInTime(inst.AnimState:GetCurrentAnimationLength() + 2 * FRAMES, doneact) end end ---------------------------------- local function onpreload(inst, data) --if data ~= nil and data.is_already_built ~= nil and inst.is_already_built == nil then -- inst.is_already_built = data.is_already_built --end end local function onsave(inst, data) --if data and inst.is_already_built ~= nil then -- data.is_already_built = inst.is_already_built --end -- if inst:HasTag("burnt") or (inst.components.burnable ~= nil and inst.components.burnable:IsBurning()) then -- data.burnt = true -- end end local function onload(inst, data) -- if data ~= nil and data.burnt then -- inst.components.burnable.onburnt(inst) -- end end ---------------------------------- local function onhammered(inst, worker) if inst.components.burnable ~= nil and inst.components.burnable:IsBurning() then inst.components.burnable:Extinguish() end inst.components.lootdropper:DropLoot() local fx = SpawnPrefab("collapse_small") fx.Transform:SetPosition(inst.Transform:GetWorldPosition()) fx:SetMaterial("stone") inst:Remove() end local function onhit(inst, worker) end ----------------------------------- local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddMiniMapEntity() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeObstaclePhysics(inst, .4) inst.MiniMapEntity:SetPriority(5) inst.MiniMapEntity:SetIcon("quagmire_mealingstone.png") inst.AnimState:SetBank("quagmire_mealingstone") inst.AnimState:SetBuild("quagmire_mealingstone") inst.AnimState:PlayAnimation("idle") inst:AddTag("structure") --prototyper (from prototyper component) added to pristine state for optimization inst:AddTag("prototyper") MakeSnowCoveredPristine(inst) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(4) inst.components.workable:SetOnFinishCallback(onhammered) inst.components.workable:SetOnWorkCallback(onhit) inst:AddComponent("prototyper") inst.components.prototyper.trees = TUNING.PROTOTYPER_TREES.TECH.SCIENCE_ONE inst.components.prototyper.onturnon = OnTurnOn inst.components.prototyper.onturnoff = OnTurnOff inst.components.prototyper.onactivate = onactivate inst:ListenForEvent("onbuilt", onbuilt) inst.OnSave = onsave inst.OnLoad = onload inst.OnPreLoad = onpreload return inst end return Prefab("mealingstone", fn, assets, prefabs), MakePlacer("mealingstone_placer", "quagmire_mealingstone", "quagmire_mealingstone", "idle") Could anyone please have a look at it? Thank you very much! I don`t know what`s wrong there
  12. My current attempt at fixing this: function MoreCrop:Harvest(harvester) if self.matured or self.inst:HasTag("withered") then if self.onharvestfn ~= nil then self.onharvestfn(self.inst, self.grower) end local product = nil if self.grower ~= nil and (self.grower.components.burnable ~= nil and self.grower.components.burnable:IsBurning()) or (self.inst.components.burnable ~= nil and self.inst.components.burnable:IsBurning()) then local temp = SpawnPrefab(self.product_prefab) product = SpawnPrefab(temp.components.cookable ~= nil and temp.components.cookable.product or "seeds_cooked") temp:Remove() else if not self.inst:HasTag("withered") then product = SpawnPrefab(self.product_prefab) else product = SpawnPrefab("spoiled_food") end end if product ~= nil then if product.components.inventoryitem ~= nil then product.components.inventoryitem:InheritMoisture(TheWorld.state.wetness, TheWorld.state.iswet) end if harvester ~= nil then if not product.inst:HasPrefab("wheat", "tomato", "potato") then product.components.stackable:SetStackSize(1) harvester.components.inventory:GiveItem(product) else product.components.stackable:SetStackSize(4) harvester.components.inventory:GiveItem(product) end else product.Transform:SetPosition(self.inst.Transform:GetWorldPosition()) end end self.matured = false self.growthpercent = 0 self.product_prefab = nil self.grower = nil return true, product end end Didn`t work by the way. It crashed when I tried to harvest a wheat plant. Well, at least compared to before it is better. Befor it crashed when planting any new seed.
  13. Is there noone who could help? So many views and no comments. Is it because what I would like to do is not possible? I tried several combinations of changing the code in the original mod: if harvester = SpawnPrefab("wheat") then product.components.stackable:SetStackSize(4) harvester.components.inventory:GiveItem(product) elseif harvester = SpawnPrefab("tomato") then product.components.stackable:SetStackSize(2) harvester.components.inventory:GiveItem(product) elseif harvester = SpawnPrefab("potato") then product.components.stackable:SetStackSize(2) harvester.components.inventory:GiveItem(product) elseif harvester = SpawnPrefab("onion") then product.components.stackable:SetStackSize(1) harvester.components.inventory:GiveItem(product) elseif harvester = SpawnPrefab("garlic") then product.components.stackable:SetStackSize(1) harvester.components.inventory:GiveItem(product) elseif harvester = SpawnPrefab("turnip") then product.components.stackable:SetStackSize(1) harvester.components.inventory:GiveItem(product) as well as: if harvester.components.inventoryitem = SpawnPrefab("wheat") then and: if product.components.inventoryitem = SpawnPrefab("wheat") then All didn`t work.