Registered Users
  • Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Tirimiru

  • Rank
    Junior Member

Recent Profile Visitors

651 profile views
  1. I've been stuck on this issue for a long time and so I hope someone could enlighten me with a solution. In a prefab called 'spell_projectile' I initialized a global variable as such: spell_animname = nil And in a function called "OnHit" I declare a new value for spell_animname: spell_animname = special_attack[math.random(#special_attack)] And then the fx animation is spawned like this: local impactfx = SpawnPrefab("spell_fx") impactfx.Transform:SetPosition(x, y, z) The prefab file for spell_fx: local assets = { Asset("ANIM", "anim/royalmagicwand.zip"), } local function PlayImpactAnim(proxy) local inst = CreateEntity() inst:AddTag("FX") --[[Non-networked entity]] inst.entity:SetCanSleep(false) inst.persists = false inst.entity:AddTransform() inst.entity:AddAnimState() inst.Transform:SetFromProxy(proxy.GUID) inst.AnimState:SetBank("spell_fx") inst.AnimState:SetBuild("royalmagicwand") if not TheWorld.ismastersim then return end inst.AnimState:PlayAnimation(spell_animname) inst:ListenForEvent("animover", inst.Remove) end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddNetwork() --Dedicated server does not need to spawn the local fx if not TheNet:IsDedicated() then --Delay one frame so that we are positioned properly before starting the effect --or in case we are about to be removed inst:DoTaskInTime(0, PlayImpactAnim) end inst.Transform:SetTwoFaced() inst.entity:SetPristine() inst.persists = false inst:DoTaskInTime(0.5, inst.Remove) return inst end return Prefab("common/fx/spell_fx", fn, assets) So this works as a host, but not as a client and I get a nil value error. The re-defined value for spell_animname is not being stored, and the client reads the first declared variable at the top of the prefab in 'spell_projectile.lua' which is initially nil. How do I get the new value for spell_animname from inside the function? Thank you in advance
  2. Apparently that line is for players that aren't the host of the server to have the widget set up for the custom backpack. Okay so, without adding caves to the world, the mod works completely fine and works using the line inst.components.inventory:Equip(SpawnPrefab("greenbackpack")) The greenbackpack gets equipped onto the mod character on new spawn. When I add caves to the world, it crashes with that line and gives me the widget error. So I remove the line completely - works fine. It also works fine when I use the console log in-game to spawn the greenbackpack and pick it up and equip it. But if I write the script to spawn the greenbackpack, e.g. SpawnPrefab("greenbackpack") it does spawn in-game, but when i pick it up, it disconnects the game. The only way it doesn't get issues is if I don't spawn the greenbackpack within the script itself, and that's a problem. Sorry if that's confusing for you, hope you understand better now
  3. It's a prefab created with the mod. Reminder that the mod works fine without caves - it's also strange that if I don't spawn the prefab inside the mod scripts itself and use the console log to spawn the greenbackpack in game, it works completely fine as it should be. (this is with caves) Here's the code for the greenbackpack local assets = { Asset("ANIM", "anim/greenbackpack.zip"), Asset("ANIM", "anim/swap_greenbackpack.zip"), Asset("ATLAS", "images/inventoryimages/greenbackpack.xml"), Asset("IMAGE", "images/inventoryimages/greenbackpack.tex") } local function OnBlocked(owner) owner.SoundEmitter:PlaySound("dontstarve/wilson/hit_armour") end local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "swap_greenbackpack", "swap_body") inst:ListenForEvent("blocked", OnBlocked, owner) if inst.components.container ~= nil then inst.components.container:Open(owner) end end local function onunequip(inst, owner) owner.AnimState:ClearOverrideSymbol("swap_body") inst:RemoveEventCallback("blocked", OnBlocked, owner) if inst.components.container ~= nil then inst.components.container:Close(owner) end end local function onopen(inst) inst.SoundEmitter:PlaySound("dontstarve/wilson/backpack_open", "open") end local function onclose(inst) inst.SoundEmitter:PlaySound("dontstarve/wilson/backpack_close", "open") end local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddMiniMapEntity() inst.entity:AddNetwork() inst.AnimState:SetBank("backpack1") inst.AnimState:SetBuild("swap_greenbackpack") inst.AnimState:PlayAnimation("anim") MakeInventoryPhysics(inst) inst:AddTag("backpack") --inst:AddTag("irreplaceable") local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon("greenbackpack.png") inst.foleysound = "dontstarve/movement/foley/backpack" if not TheWorld.ismastersim then inst:DoTaskInTime(0.314, function() inst.replica.container:WidgetSetup("piggyback") end) return inst end inst.entity:SetPristine() inst:AddComponent("characterspecific") inst:AddComponent("inspectable") inst:AddComponent("armor") inst.components.armor:InitCondition(TUNING.ARMORWOOD, TUNING.ARMORWOOD_ABSORPTION) inst:AddComponent("insulator") inst.components.insulator:SetInsulation(TUNING.INSULATION_TINY) inst:AddComponent("container") inst.components.container:WidgetSetup("piggyback") inst:AddComponent("inventoryitem") inst.components.inventoryitem.cangoincontainer = false inst.components.inventoryitem.imagename = "greenbackpack" inst.components.inventoryitem.atlasname = "images/inventoryimages/greenbackpack.xml" inst:AddComponent("inspectable") inst.components.container.onopenfn = onopen inst.components.container.onclosefn = onclose inst:AddComponent("equippable") inst.components.equippable.equipslot = EQUIPSLOTS.BODY if EQUIPSLOTS["PACK"] then inst.components.equippable.equipslot = EQUIPSLOTS.PACK else inst.components.equippable.equipslot = EQUIPSLOTS.BODY end inst.components.equippable:SetOnEquip(onequip) inst.components.equippable:SetOnUnequip(onunequip) inst.components.equippable.walkspeedmult = 1.0 MakeHauntableLaunchAndDropFirstItem(inst) return inst end return Prefab( "common/inventory/greenbackpack", fn, assets)
  4. [00:12:01]: [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) old_container_open (Lua) <24-132> ../mods/workshop-365119238/modmain_segments/containerwidgetfunction.lua:21 in (method) Open (Lua) <20-60> scripts/screens/playerhud.lua:236 in (upvalue) OpenContainerWidget (Lua) <233-238> scripts/screens/playerhud.lua:246 in (method) OpenContainer (Lua) <240-248> scripts/components/container_replica.lua:277 in (method) Open (Lua) <263-284> scripts/components/container_replica.lua:89 in (field) fn (Lua) <87-91> scripts/scheduler.lua:177 in (method) OnTick (Lua) <155-207> scripts/scheduler.lua:371 in (global) RunScheduler (Lua) <369-377> scripts/update.lua:170 in () ? (Lua) <149-228> For some reason I get this error only when I add caves into the world. It works fine without. Here's the code: local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset( "ANIM", "anim/finnthehuman.zip" ), Asset( "ANIM", "anim/ghost_finnthehuman_build.zip" ), } local prefabs = {} -- Custom starting items local start_inv = { "demonbloodsword" } -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when loading or reviving from ghost (optional) inst.components.locomotor.walkspeed = 4 inst.components.locomotor.runspeed = 6 end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) if not inst:HasTag("playerghost") then onbecamehuman(inst) end if inst.OnNewSpawn then inst.components.inventory:Equip(SpawnPrefab("greenbackpack")) end end -- This initializes for both the server and client. Tags can be added here. local common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "finnthehuman.tex" ) inst:AddTag("demonbloodsword_builder") end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "willow" inst:RemoveTag("scarytoprey") inst:ListenForEvent("equip", function() inst.AnimState:ClearOverrideSymbol("swap_hat") inst.AnimState:Show("hair") end) -- Stats inst.components.health:SetMaxHealth(150) inst.components.hunger:SetMax(100) inst.components.sanity:SetMax(150) -- Hunger rate (optional) inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload end return MakePlayerCharacter("finnthehuman", prefabs, assets, common_postinit, master_postinit, start_inv) I know it's failing at this line: inst.components.inventory:Equip(SpawnPrefab("greenbackpack")) I've tried other things like, spawning the backpack in the world - but when I pick it up, it disconnects the game. Please advise on this, I'm so stumped..
  5. Hi, So I've already done a lot of research - I know that changing the z-orders in Spriter or re-positioning will not affect how it's shown in game. I used the hair section to get her long hair to show at the back. But I'm not understanding why her left arm is showing behind her hair in game. I'd like to know where the layer ordering is even initialized to affect it in-game. Even remaking the whole scml project does not work as intended and has major underlying issues. Please advise on this, I can't find any clear solution from past threads. Thank you in advance
  6. Not intending to make it compatible with DS or RoG as I don't have the game
  7. Sorry guys - forgot to upload the updated version on klei. I'm at work right now so unable to upload. The updated one is on steam though! Please get it from there until then - the link is at the end of the description. Thanks!
  8. Yes, it's only DST compatible.
  9. Great to hear I will be tweeking the mod soon and balance him out a bit. Will also be fixing the art!
  10. Version 2.2.17


    Black☆Rock Shooter! [23/08/2015] we've just implemented the Insane Black Rock Shooter as of today! It was a highly ambitious project and it was totally worth the while! v2.2.9 Update - Added configuration to turn ON/OFF custom sound and animation for critical impact. Here are the stats; EDITED: 23/08/2015 Health 180 Sanity 120 Hunger 150 Character trait - Starts with Black Blade - Able to craft her own special set of weapons - Sanity drains faster during night time - Transforms into Insane Black Rock Shooter when Sanity is low - Insane Black Rock Shooter makes everyone else go crazy Basic Information Black☆Rock Shooter - Has a 10% speed boost - 10% more sanity loss than other characters during night time - Transform into Insane Black☆Rock Shooter when sanity drops below 40. (NEW) Insane Black☆Rock Shooter - Becomes a 'Monster' when transformed - Has a 30% speed boost - 20% more sanity loss than other characrters during night time - Other players around Insane Black☆Rock Shooter loses more sanity the closer they are to her. - Deals 25% more damage - Reverts back to normal upon reaching 80 sanity. Black Blade - Craftable from the science machine in the fight tab with; 1 crow feather, 1 cut stone, 1 flint - Melee weapon dealing 32 damage - 15% chance to critical strike dealing 2x damage - Limited durability, 100 uses. Rock Cannon - Craftable from the science machine in the fight tab with; 8 rocks, 1 electrical doodad, 3 gunpowder - Ranged weapon dealing 30 damage and 25 damage AOE. (55 total damage to the main target). - Requires 'Energy Bullet' as a source of ammo - Can be reloaded to a maximum of 10 times - Unlimited durability - When out of ammo, Rock Cannon becomes melee, dealing 20 damage Energy Bullet - Craftable from the science machine in the refine tab with; 2 Spirit Particles, 1 Charcoal - Crafting Energy Bullet yields 2 bullets Spirit Particles - Is a material that can be found from mobs and through harvesting resources. (NEW) Insane Blade Claw - Craftable from the Shadow Manipulator with; 1 giant soul, 1 purple gem, 3 flint - Melee weapon dealing 38 damage - 30% chance to critical strike dealing 2x damage - Limited durability, 200 uses. (NEW) Insane Cannon Lance - Craftable from the Shadow Manipulator in the magic tab with; 1 giant soul, 1 purple gem, 3 nightmare fuel - Ranged weapon dealing 60 damage - Applies Electrical damage. (1.5x damage when raining) - Requires 'Energy Bullet' as a source of ammo - Can be reloaded to a maximum of 10 times - Unlimited durability - When out of ammo, Insane Cannon Lance becomes melee, dealing 20 damage (NEW) Giant Soul - A new item added from killing Giants - Used to craft higher tier weapons Extra information - Rock Cannon/Cannon Lance has 0 bullets upon crafting - Rock Cannon does no AOE on bosses. (only 30 damage) - Killing giants now has a chance to drop 1 to 4 Spirit Particles Future Updates - Custom speech and sound will be added - further configurations will be added if needed Thanks to all who posted comments on what they've thought about our mod! If there are any more bugs to report to comments about our mod, please feel free to post to us! Thank you all, and Enjoy! Get it on Steam! http://steamcommunity.com/sharedfiles/filedetails/?id=502031011
  11. @Zackreaver: That's good to hear on my end Cheers to you for getting to the bottom of it
  12. @DarkXero: Hah, well I just uploaded the mod on Steam recently so my friend hosting the server got that version today -- and so 'magically' the backpack works for both host and client. I guess he somehow had an outdated version after all.. even though he claimed to have deleted the mod folder and extracted the new one I gave him Sorry your testing was for naught Thanks again!