Luis95R

  • Content Count

    68
  • Joined

  • Last visited

Community Reputation

8 Neutral

About Luis95R

  • Rank
    Junior Member
...

Recent Profile Visitors

1095 profile views
  1. Will we eventually be seeing other Twitch drops added to the Rewards page?
  2. Abigail causes a crash when attacking an eyeplant: [00:09:22]: [string "scripts/prefabs/abigail.lua"]:564: attempt to index local 'data' (a nil value) LUA ERROR stack traceback: scripts/prefabs/abigail.lua:564 in (upvalue) on_target_attacked (Lua) <563-567> inst = 143491 - abigail_vex_debuff (valid:true) target = 137841 - eyeplant (valid:true) data = nil scripts/prefabs/abigail.lua:638 in (local) fn (Lua) <638-638> target = 137841 - eyeplant (valid:true) data = nil scripts/entityscript.lua:1040 in (method) PushEvent (Lua) <1027-1054> self (valid:true) = GUID = 137841 Transform = Transform (4FEAF4F8) inlimbo = false actionreplica = table: 4FEA95E8 event_listening = table: 4FEAA358 actioncomponents = table: 4FEA94A8 lower_components_shadow = table: 4FEA9458 minionlord = 119123 - lureplant (valid:true) minionnumber = 29 entity = Entity (4FDB4F98) AnimState = AnimState (4FEAF518) prefab = eyeplant updatecomponents = table: 0E585D08 modactioncomponents = table: 4FEAA948 OnSave = function - ../mods/workshop-1267009196/modmain.lua:134 Network = Network (4FEAF558) Physics = Physics (4FEAF7F8) OnLoad = function - ../mods/workshop-1267009196/modmain.lua:143 event_listeners = table: 4FEAA290 SoundEmitter = SoundEmitter (4FEAF538) name = Eye Plant hkdata = table: 0E63B9B0 sg = sg="eyeplant", state="attack", time=0.67, tags = "canrotate,attack," spawntime = 0 replica = table: 4FEA94D0 persists = true components = table: 4FEA9480 pendingtasks = table: 4FEAA240 event = attacked data = nil listeners = table: 52232938 tocall = table: 29B94580 i = 2 fn = function - scripts/prefabs/abigail.lua:638 scripts/components/minionspawner.lua:63 in (local) fn (Lua) <62-65> minion = 137841 - eyeplant (valid:true) scripts/entityscript.lua:1040 in (method) PushEvent (Lua) <1027-1054> self (valid:true) = GUID = 137841 Transform = Transform (4FEAF4F8) inlimbo = false actionreplica = table: 4FEA95E8 event_listening = table: 4FEAA358 actioncomponents = table: 4FEA94A8 lower_components_shadow = table: 4FEA9458 minionlord = 119123 - lureplant (valid:true) minionnumber = 29 entity = Entity (4FDB4F98) AnimState = AnimState (4FEAF518) prefab = eyeplant updatecomponents = table: 0E585D08 modactioncomponents = table: 4FEAA948 OnSave = function - ../mods/workshop-1267009196/modmain.lua:134 Network = Network (4FEAF558) Physics = Physics (4FEAF7F8) OnLoad = function - ../mods/workshop-1267009196/modmain.lua:143 event_listeners = table: 4FEAA290 SoundEmitter = SoundEmitter (4FEAF538) name = Eye Plant hkdata = table: 0E63B9B0 sg = sg="eyeplant", state="attack", time=0.67, tags = "canrotate,attack," spawntime = 0 replica = table: 4FEA94D0 persists = true components = table: 4FEA9480 pendingtasks = table: 4FEAA240 event = death data = table: 29B97758 listeners = table: 4FEAACE0 tocall = table: 29B9AF70 i = 1 fn = function - scripts/components/minionspawner.lua:62 scripts/components/health.lua:354 in (method) SetVal (Lua) <334-371> self = minhealth = 0 absorb = 0 firedamagecaptimer = 0 nofadeout = false firedamageinlastsecond = 0 externalabsorbmodifiers = table: 4FEAA8A8 playerabsorb = 0 inst = 137841 - eyeplant (valid:true) externalfiredamagemultipliers = table: 4FEAA628 fire_damage_scale = 1 takingfiredamagetime = 0 _ = table: 4FEAA588 fire_timestart = 1 val = 0 cause = abigail afflicter = 141294 - abigail (valid:true) old_health = 15 max_health = 30 min_health = 0 scripts/components/health.lua:383 in (method) DoDelta (Lua) <373-392> self = minhealth = 0 absorb = 0 firedamagecaptimer = 0 nofadeout = false firedamageinlastsecond = 0 externalabsorbmodifiers = table: 4FEAA8A8 playerabsorb = [00:09:22]: [string "scripts/prefabs/abigail.lua"]:564: attempt to index local 'data' (a nil value) LUA ERROR stack traceback: scripts/prefabs/abigail.lua:564 in (upvalue) on_target_attacked (Lua) <563-567> scripts/prefabs/abigail.lua:638 in (local) fn (Lua) <638-638> scripts/entityscript.lua:1040 in (method) PushEvent (Lua) <1027-1054> scripts/components/minionspawner.lua:63 in (local) fn (Lua) <62-65> scripts/entityscript.lua:1040 in (method) PushEvent (Lua) <1027-1054> scripts/components/health.lua:354 in (method) SetVal (Lua) <334-371> scripts/components/health.lua:383 in (method) DoDelta (Lua) <373-392> scripts/components/combat.lua:446 in (method) GetAttacked (Lua) <420-498> scripts/components/combat.lua:930 in (method) DoAreaAttack (Lua) <920-936> scripts/components/aura.lua:52 in (method) OnTick (Lua) <44-65> scripts/components/aura.lua:22 in (field) fn (Lua) <21-23> scripts/scheduler.lua:177 in (method) OnTick (Lua) <155-207> scripts/scheduler.lua:371 in (global) RunScheduler (Lua) <369-377> scripts/update.lua:180 in () ? (Lua) <159-238> [00:09:22]: 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:09:22]: stack traceback: scripts/widgets/widget.lua:605 in (method) SetFocusFromChild (Lua) <602-627> scripts/widgets/widget.lua:624 in (method) SetFocusFromChild (Lua) <602-627> scripts/widgets/widget.lua:624 in (method) SetFocusFromChild (Lua) <602-627> scripts/widgets/widget.lua:656 in (method) SetFocus (Lua) <629-665> 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>
  3. Hey cister with a blister!

  4. Hi, I was looking through the workshop and found a mod called Enforce Good Behavior. What it basically does is prevent people from placing down Spider Eggs or reading the On Tentacles book by Wickerbottom, if you are near the spawn Portal. Whenever I use the mod and try crafting Spider Eggs or making an On Tentacles book the server crashes followed by either: "Attempt to index deploy a nil value" if I try to craft a Spider Egg or "Attempt to index book a nil value" if I try to craft the On Tentacles book. Would anyone by any chance know how to fix this issue? I would really like to be able to use this mod it's just a shame that it crashes. I've attached the lua file if you'd like to see it for yourself. Any help is appreciated. Thank you! enforce_good_behavior.lua
  5. Thank you! I just read this response months later but it definitely helps!
  6. Hi, I was wondering if it's possible to put a widget setup in its own file instead of putting it on modmain.lua? Here is the example I'm talking about: -------------------------------------------------------------------------- --[[ compost_box ]] -------------------------------------------------------------------------- _G = GLOBAL local params={} params.compost_box = { widget = { slotpos = {}, animbank = "ui_chest_3x3", animbuild = "ui_chest_3x3", pos = _G.Vector3(0, 200, 0), side_align_tip = 160, }, type = "chest", } for y = 2, 0, -1 do for x = 0, 2 do table.insert(params.compost_box.widget.slotpos, _G.Vector3(80 * x - 80 * 2 + 80, 80 * y - 80 * 2 + 80, 0)) end end function params.compost_box.itemtestfn(container, item, slot) return (item.components.edible and item.components.perishable) or item.prefab == "spoiled_food" or item.prefab == "rottenegg" or item.prefab == "guano" or item.prefab == "poop" or item:HasTag("fresh") or item:HasTag("stale") or item:HasTag("spoiled") end local containers = _G.require "containers" containers.MAXITEMSLOTS = math.max(containers.MAXITEMSLOTS, params.compost_box.widget.slotpos ~= nil and #params.compost_box.widget.slotpos or 0) local old_widgetsetup = containers.widgetsetup function containers.widgetsetup(container, prefab, data) local pref = prefab or container.inst.prefab if pref == "compost_box" then local t = params[pref] 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 return old_widgetsetup(container, prefab) end end -------------------------------------------------------------------------- --[[ crate_wooden ]] -------------------------------------------------------------------------- params.crate_wooden = { widget = { slotpos = {}, animbank = "ui_chest_5x12", animbuild = "ui_chest_5x12", pos = _G.Vector3(90, 220, 0), side_align_tip = 160, }, type = "chest", } for y = 4, 0, -1 do for x = 0, 11 do table.insert(params.crate_wooden.widget.slotpos, _G.Vector3(80 * x - 346 * 2 + 98, 80 * y - 100 * 2 + 42, 0)) end end function params.crate_wooden.itemtestfn(container, item, slot) if item.prefab == "chester_eyebone" then return false end return true end local containers = _G.require "containers" containers.MAXITEMSLOTS = math.max(containers.MAXITEMSLOTS, params.crate_wooden.widget.slotpos ~= nil and #params.crate_wooden.widget.slotpos or 0) local old_widgetsetup = containers.widgetsetup function containers.widgetsetup(container, prefab, data) local pref = prefab or container.inst.prefab if pref == "crate_wooden" then local t = params[pref] 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 return old_widgetsetup(container, prefab) end end Would it be possible to somehow put it in its own separate file, so that it doesn't take up space in the modmain.lua file? Maybe using modimport or something else? Also if you know of any way to shorten the code above so that it's more compact that would be appreciated. Thank you.
  7. It works perfect, thanks! I was afraid I would have to disable the staff completely.
  8. Hi all, I was wondering if it is better (in terms of performance or just overall) to change the way items work through modmain or by editing an entire items file? For example lets say I wanted to make the Top Hat have +10% speed. Would it be better to do it through modmain and add a AddPrefabPostInit or would it be better to just edit the file of the Top Hat (hats.lua)?
  9. Hi, I was wondering if anyone knows if its possible to make the deconstruction staff only work on items and not structures? I ask this because people on my server have been griefing with the deconstruction staff. I have the Ownership and Modify Ownership mod, but they don't protect against the deconstruction staff. What I want is for the staff to work only on items and not on structures. Maybe there is a way for it to not work on prefabs with the tag "structure"? I'm not sure how to go about this. If anyone can provide help it would be appreciated. Here is the Deconstruction staff code for reference. -------GREEN STAFF----------- local DESTSOUNDS = { { --magic soundpath = "dontstarve/common/destroy_magic", ing = { "nightmarefuel", "livinglog" }, }, { --cloth soundpath = "dontstarve/common/destroy_clothing", ing = { "silk", "beefalowool" }, }, { --tool soundpath = "dontstarve/common/destroy_tool", ing = { "twigs" }, }, { --gem soundpath = "dontstarve/common/gem_shatter", ing = { "redgem", "bluegem", "greengem", "purplegem", "yellowgem", "orangegem" }, }, { --wood soundpath = "dontstarve/common/destroy_wood", ing = { "log", "boards" }, }, { --stone soundpath = "dontstarve/common/destroy_stone", ing = { "rocks", "cutstone" }, }, { --straw soundpath = "dontstarve/common/destroy_straw", ing = { "cutgrass", "cutreeds" }, }, } local DESTSOUNDSMAP = {} for i, v in ipairs(DESTSOUNDS) do for i2, v2 in ipairs(v.ing) do DESTSOUNDSMAP[v2] = v.soundpath end end DESTSOUNDS = nil local function CheckSpawnedLoot(loot) if not ((loot.components.inventoryitem ~= nil and loot.components.inventoryitem:IsHeld()) or loot:IsOnValidGround()) then SpawnPrefab("splash_ocean").Transform:SetPosition(loot.Transform:GetWorldPosition()) if loot:HasTag("irreplaceable") then loot.Transform:SetPosition(FindSafeSpawnLocation(loot.Transform:GetWorldPosition())) else loot:Remove() end end end local function SpawnLootPrefab(inst, lootprefab) if lootprefab == nil then return end local loot = SpawnPrefab(lootprefab) if loot == nil then return end local x, y, z = inst.Transform:GetWorldPosition() if loot.Physics ~= nil then local angle = math.random() * 2 * PI loot.Physics:SetVel(2 * math.cos(angle), 10, 2 * math.sin(angle)) if inst.Physics ~= nil then local len = loot.Physics:GetRadius() + inst.Physics:GetRadius() x = x + math.cos(angle) * len z = z + math.sin(angle) * len end loot:DoTaskInTime(1, CheckSpawnedLoot) end loot.Transform:SetPosition(x, y, z) return loot end local function destroystructure(staff, target) local recipe = AllRecipes[target.prefab] if recipe == nil then --Action filters should prevent us from reaching here normally return end local ingredient_percent = ( (target.components.finiteuses ~= nil and target.components.finiteuses:GetPercent()) or (target.components.fueled ~= nil and target.components.inventoryitem ~= nil and target.components.fueled:GetPercent()) or (target.components.armor ~= nil and target.components.inventoryitem ~= nil and target.components.armor:GetPercent()) or 1 ) / recipe.numtogive --V2C: Can't play sounds on the staff, or nobody -- but the user and the host will hear them! local caster = staff.components.inventoryitem.owner for i, v in ipairs(recipe.ingredients) do if caster ~= nil and DESTSOUNDSMAP[v.type] ~= nil then caster.SoundEmitter:PlaySound(DESTSOUNDSMAP[v.type]) end if string.sub(v.type, -3) ~= "gem" or string.sub(v.type, -11, -4) == "precious" then --V2C: always at least one in case ingredient_percent is 0% local amt = math.max(1, math.ceil(v.amount * ingredient_percent)) for n = 1, amt do SpawnLootPrefab(target, v.type) end end end if caster ~= nil then caster.SoundEmitter:PlaySound("dontstarve/common/staff_dissassemble") if caster.components.sanity ~= nil then caster.components.sanity:DoDelta(-TUNING.SANITY_MEDLARGE) end end staff.components.finiteuses:Use(1) if target.components.inventory ~= nil then target.components.inventory:DropEverything() end if target.components.container ~= nil then target.components.container:DropEverything() end if target.components.spawner ~= nil and target.components.spawner:IsOccupied() then target.components.spawner:ReleaseChild() end if target.components.occupiable ~= nil and target.components.occupiable:IsOccupied() then local item = target.components.occupiable:Harvest() if item ~= nil then item.Transform:SetPosition(target.Transform:GetWorldPosition()) item.components.inventoryitem:OnDropped() end end if target.components.trap ~= nil then target.components.trap:Harvest() end if target.components.stackable ~= nil then --if it's stackable we only want to destroy one of them. target.components.stackable:Get():Remove() else target:Remove() end end local function HasRecipe(guy) return guy.prefab ~= nil and AllRecipes[guy.prefab] ~= nil end local function onhauntgreen(inst) if math.random() <= TUNING.HAUNT_CHANCE_RARE then local target = FindEntity(inst, 20, HasRecipe, nil, { "INLIMBO" }) if target ~= nil then destroystructure(inst, target) SpawnPrefab("collapse_small").Transform:SetPosition(target.Transform:GetWorldPosition()) inst.components.hauntable.hauntvalue = TUNING.HAUNT_LARGE return true end end return false end also this: local function green() local inst = commonfn("green", { "nopunch" }) if not TheWorld.ismastersim then return inst end inst.fxcolour = {51/255,153/255,51/255} inst:AddComponent("spellcaster") inst.components.spellcaster.canuseontargets = true inst.components.spellcaster.canonlyuseonrecipes = true inst.components.spellcaster:SetSpellFn(destroystructure) inst.components.finiteuses:SetMaxUses(TUNING.GREENSTAFF_USES) inst.components.finiteuses:SetUses(TUNING.GREENSTAFF_USES) MakeHauntableLaunch(inst) AddHauntableCustomReaction(inst, onhauntgreen, true, false, true) return inst end
  10. Updated my post to include a possible cause for the Loot Stash not opening.