LlamaDom

  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LlamaDom

  • Rank
    Junior Member
...
  1. Hi! I've been working on a custom character and I'm having trouble putting the item in game. I have all the files, but not sure why i'm getting this error message, can I get any help?
  2. Im having a bit of trouble putting this into code form, what could we do for that? also, would this still be compatible with ShowMe?
  3. Hey, I'm having trouble changing the actions of my character mod when they transform. I've tried to copy most of woodie's code since a good chunk of his code is similar to what I want but I can't seem to change the actions. I've gotten it to a point where if I right and left click anything, it does the animation, but it doesn't do anything. What I'm wanting is Leftclick to basic attack(similar to moose form for woodie), while Rightclick is eat what's on the floor(like old werebeaver and wood on the floor). Is this even possible? If not, please let me know. Since my code is really long, assuming that the rest of the code is good to run, what can I do here? local function ChangeLeftClickPicker(inst, target) return target ~= nil and target ~= inst and ( ( inst.replica.combat:CanTarget(target) and (not target:HasTag("player") or inst.components.playercontroller:IsControlPressed(CONTROL_FORCE_ATTACK)) and inst.components.playeractionpicker:SortActionList({ ACTIONS.ATTACK }, target, nil) ) or ( target:HasTag("walkingplank") and target:HasTag("interactable") and target:HasTag("plank_extended") and inst.components.playeractionpicker:SortActionList({ ACTIONS.MOUNT_PLANK }, target, nil) ) ) or nil end local function ChangeRightClickPicker(inst, target) return target ~= nil and target ~= inst and ( ( inst.replica.combat:CanTarget(target) and (not target:HasTag("player") or inst.components.playercontroller:IsControlPressed(CONTROL_FORCE_CONSUME)) and inst.components.playeractionpicker:SortActionList({ ACTIONS.CONSUME }, target, nil) ) or ( inst.components.playeractionpicker:SortActionList({ ACTIONS.MOUNT_PLANK }, target, nil) ) ) or nil end local function SetWereActions(inst, mode) if not isInSecondForm and not isInWereForm then inst.ActionStringOverride = nil if inst.components.playercontroller ~= nil then inst.components.playercontroller.actionbuttonoverride = nil end if inst.components.playeractionpicker ~= nil then inst.components.playeractionpicker.leftclickoverride = nil inst.components.playeractionpicker.rightclickoverride = nil inst.components.playeractionpicker.pointspecialactionsfn = nil end --EnableReticule(inst, false) elseif isInSecondForm and not isInWereForm then if inst.components.playeractionpicker ~= nil then inst.components.playeractionpicker.leftclickoverride = ChangeLeftClickPicker inst.components.playeractionpicker.rightclickoverride = ChangeRightClickPicker --inst.components.playeractionpicker.pointspecialactionsfn = nil end elseif not isInSecondForm and isInWereForm then inst.ActionStringOverride = nil if inst.components.playercontroller ~= nil then inst.components.playercontroller.actionbuttonoverride = Empty end if inst.components.playeractionpicker ~= nil then inst.components.playeractionpicker.leftclickoverride = ChangeLeftClickPicker inst.components.playeractionpicker.rightclickoverride = ChangeRightClickPicker --inst.components.playeractionpicker.pointspecialactionsfn = MoosePointSpecialActions end else --if mode == anything else inst.ActionStringOverride = nil if inst.components.playercontroller ~= nil then inst.components.playercontroller.actionbuttonoverride = nil end if inst.components.playeractionpicker ~= nil then inst.components.playeractionpicker.leftclickoverride = nil inst.components.playeractionpicker.rightclickoverride = nil inst.components.playeractionpicker.pointspecialactionsfn = nil end end end
  4. Hello! Im curerently making a character mod and am at a loss at how to impliment this one change. When giving pig king trinkets or items for gold, gain 15 sanity and chance of extra gold. Is this possible? Along with this, I have night vision on when I transform and its night time. it works when Im transformed and then it turns night, but when im in standard form and it turns night, even if I transform, i dont have nightvision. What could be the problem here?
  5. i just figured it out, but thanks! I ran into a slight issue of the general code of making it so you cant equipt hand,body, or head gearwhile transformed. Where would i find that? Along with this, I have night vision on when I transform and its night time. it works when Im transformed and then it turns night, but when im in standard form and it turns night, even if I transform, i dont have nightvision. What could be the problem here? Again, my code..not sure how to do the preview thing to make it smaller local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), Asset( "ANIM", "anim/wrigley.zip" ), Asset( "ANIM", "anim/werewrigley.zip" ), } -- Your character's stats TUNING.WRIGLEY_HEALTH = 175 TUNING.WRIGLEY_HUNGER = 200 TUNING.WRIGLEY_SANITY = 125 -- Custom starting inventory TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.WRIGLEY = { "berries","carrot","berries","carrot","berries","carrot","berries","carrot","berries","carrot" } local start_inv = {} for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do start_inv[string.lower(k)] = v.WRIGLEY end local prefabs = FlattenTree(start_inv, true) local isInSecondForm = false local isInWereForm = false --------------------------------------------------------------------------------------- local BEAVERVISION_COLOURCUBES = { day = "images/colour_cubes/beaver_vision_cc.tex", dusk = "images/colour_cubes/beaver_vision_cc.tex", night = "images/colour_cubes/beaver_vision_cc.tex", full_moon = "images/colour_cubes/beaver_vision_cc.tex", } local function UpdateNightVision(inst, phase) local enable = phase == "night" and inst.modnightvision:value() inst:DoTaskInTime(enable and 0 or 1, function(inst) inst.components.playervision:ForceNightVision(enable) inst.components.playervision:SetCustomCCTable(enable and BEAVERVISION_COLOURCUBES or nil) end) end local function OnInitNightVision(inst) if TheWorld.ismastersim or inst.HUD then inst:WatchWorldState("phase", UpdateNightVision) inst:ListenForEvent("modnightvisiondirty", UpdateNightVision) UpdateNightVision(inst, TheWorld.state.phase) end end ------------------------------------------------------------------------------------ local function TurnBackToNormal(inst) inst:RemoveTag("werewrigley") inst:RemoveTag("insomniac") inst:AddTag("scarytoprey") inst.modnightvision:set(false) inst.components.talker:Say("OINK!", 2.5,true) inst.SoundEmitter:PlaySound("dontstarve/pig/oink") local x, y, z = inst.Transform:GetWorldPosition() local fx = SpawnPrefab("maxwell_smoke") fx.Transform:SetPosition(x, y, z) SpawnPrefab("statue_transition").Transform:SetPosition(inst:GetPosition():Get()) inst.components.eater.ignoresspoilage = false inst.components.eater.strongstomach = false inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1) inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE inst.components.combat.damagemultiplier = 1 inst.components.sanity.dapperness = 0 inst.AnimState:SetBuild("wrigley") inst.modnightvision:set(false) isInSecondForm = false isInWereForm = false end local function TurnIntoSecondForm(inst) --inst.modnightvision:set(true) inst.SoundEmitter:PlaySound("dontstarve/creatures/werepig/grunt") inst:AddTag("werewrigley") inst:AddTag("insomniac") inst:AddTag("scarytoprey") inst.components.talker:Say("darkpig", 2.5,true) local x, y, z = inst.Transform:GetWorldPosition() local fx = SpawnPrefab("maxwell_smoke") fx.Transform:SetPosition(x, y, z) SpawnPrefab("statue_transition").Transform:SetPosition(inst:GetPosition():Get()) inst.components.combat:SetDefaultDamage(TUNING.WEREMOOSE_DAMAGE) inst.components.combat.bonusdamagefn = nil inst.components.pinnable.canbepinned = false inst.components.temperature.inherentinsulation = TUNING.INSULATION_LARGE inst.components.temperature.inherentsummerinsulation = TUNING.INSULATION_LARGE inst.components.moisture:SetInherentWaterproofness(TUNING.WATERPROOFNESS_LARGE) inst.components.catcher:SetEnabled(false) inst.components.eater.ignoresspoilage = false inst.components.eater.strongstomach = false inst.components.combat.damagemultiplier = 1 inst.components.hunger.hungerrate = 2 * TUNING.WILSON_HUNGER_RATE inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 2) inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE * (-1) inst.AnimState:SetBuild("werewrigley") isInSecondForm = true isInWereForm = false end local function TurnIntoWereForm(inst) --inst.modnightvision:set(true) inst.SoundEmitter:PlaySound("dontstarve/creatures/werepig/grunt") inst:AddTag("werewrigley") inst:AddTag("insomniac") inst:AddTag("scarytoprey") inst.components.talker:Say("werepig", 2.5,true) local x, y, z = inst.Transform:GetWorldPosition() local fx = SpawnPrefab("maxwell_smoke") fx.Transform:SetPosition(x, y, z) inst.components.combat:SetDefaultDamage(TUNING.WEREMOOSE_DAMAGE) inst.components.combat.bonusdamagefn = nil inst.components.pinnable.canbepinned = false inst.components.temperature.inherentinsulation = TUNING.INSULATION_LARGE inst.components.temperature.inherentsummerinsulation = TUNING.INSULATION_LARGE inst.components.moisture:SetInherentWaterproofness(TUNING.WATERPROOFNESS_LARGE) inst.components.catcher:SetEnabled(false) inst.components.eater.ignoresspoilage = false inst.components.eater.strongstomach = false inst.components.combat.damagemultiplier = 1 inst.components.hunger.hungerrate = 2 * TUNING.WILSON_HUNGER_RATE inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 2) inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE * (-1) inst.AnimState:SetBuild("werewrigley") isInSecondForm = false isInWereForm = true end ------------------------------------------------------------------------------------------ --for hunger drop changing and fullmoon too local function OnHungerDrop(inst, data) --Make sure not to react while the player is dead. if inst:HasTag("playerghost") or inst.components.health and inst.components.health:IsDead() then return end --if in pig form, and less than 25 hunger, turn into dark form if not isInSecondForm and not isInWereForm and inst.components.hunger.current < 25 then inst.modnightvision:set(true) TurnIntoSecondForm(inst) inst.modnightvision:set(true) -- if in darkform and hunger is greater than 50, turn into normal form elseif isInSecondForm and not isInWereForm and inst.components.hunger.current > 50 then TurnBackToNormal(inst) inst.modnightvision:set(false) end end local function OnPigMoon(inst, isfullmoon) if isfullmoon then TurnIntoWereForm(inst) else TurnBackToNormal(inst) end end ----------------------------------------------------------------------------------- -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when not a ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "wrigley_speed_mod", 1) end local function onbecamewerepig(inst) if inst:HasTag("playerghost") or inst.components.health and inst.components.health:IsDead() then return end inst.components.combat:SetDefaultDamage(TUNING.WEREMOOSE_DAMAGE) inst.components.combat.bonusdamagefn = nil inst.components.pinnable.canbepinned = false inst.components.temperature.inherentinsulation = TUNING.INSULATION_LARGE inst.components.temperature.inherentsummerinsulation = TUNING.INSULATION_LARGE inst.components.moisture:SetInherentWaterproofness(TUNING.WATERPROOFNESS_LARGE) inst.components.catcher:SetEnabled(false) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "wrigley_speed_mod") end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) 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( "wrigley.tex" ) inst.modnightvision = net_bool(inst.GUID, "player.modnightvision", "modnightvisiondirty") inst.modnightvision:set(false) inst:DoTaskInTime(0, OnInitNightVision) end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- Set starting inventory inst.starting_inventory = start_inv[TheNet:GetServerGameMode()] or start_inv.default -- choose which sounds this character will play inst.soundsname = "willow" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(TUNING.WRIGLEY_HEALTH) inst.components.hunger:SetMax(TUNING.WRIGLEY_HUNGER) inst.components.sanity:SetMax(TUNING.WRIGLEY_SANITY) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload --for hugner drop changing inst:ListenForEvent("hungerdelta", OnHungerDrop) --inst:ListenForEvent("hungerdelta", OnPigMoon) --for full moon inst:WatchWorldState("isfullmoon", OnPigMoon) --inst:WatchWorldState("isfullmoon", OnHungerDrop) OnPigMoon(inst, TheWorld.state.isfullmoon) --OnHungerDrop(inst, TheWorld.state.isfullmoon) end return MakePlayerCharacter("wrigley", prefabs, assets, common_postinit, master_postinit, prefabs)
  6. Hey! Im trying to make a character that changes form according to the full moon using this The gamestarts to load, then i just freeze at a white screen this is my code local MakePlayerCharacter = require "prefabs/player_common" local assets = { Asset("SCRIPT", "scripts/prefabs/player_common.lua"), Asset( "ANIM", "anim/wrigley.zip" ), Asset( "ANIM", "anim/werewrigley.zip" ), } -- Your character's stats TUNING.WRIGLEY_HEALTH = 175 TUNING.WRIGLEY_HUNGER = 200 TUNING.WRIGLEY_SANITY = 125 -- Custom starting inventory TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT.WRIGLEY = { "berries","carrot","berries","carrot","berries","carrot","berries","carrot","berries","carrot" } local start_inv = {} for k, v in pairs(TUNING.GAMEMODE_STARTING_ITEMS) do start_inv[string.lower(k)] = v.WRIGLEY end local prefabs = FlattenTree(start_inv, true) local isInSecondForm = false local function TurnBackToNormal(inst) inst:RemoveTag("werewrigley") inst:RemoveTag("insomniac") inst:AddTag("scarytoprey") inst.components.talker:Say("Oink!", 2.5,true) inst.SoundEmitter:PlaySound("dontstarve/pig/oink") local x, y, z = inst.Transform:GetWorldPosition() local fx = SpawnPrefab("maxwell_smoke") fx.Transform:SetPosition(x, y, z) SpawnPrefab("statue_transition").Transform:SetPosition(inst:GetPosition():Get()) inst.components.eater.ignoresspoilage = false inst.components.eater.strongstomach = false inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1) inst.components.hunger.hungerrate = 1.2 * TUNING.WILSON_HUNGER_RATE inst.components.combat.damagemultiplier = 1 inst.components.sanity.dapperness = 0 inst.AnimState:SetBuild("wrigley") isInSecondForm = false end local function TurnIntoSecondForm(inst) inst.SoundEmitter:PlaySound("dontstarve/creatures/werepig/grunt") inst:AddTag("werewrigley") inst:AddTag("insomniac") inst:AddTag("scarytoprey") local x, y, z = inst.Transform:GetWorldPosition() local fx = SpawnPrefab("maxwell_smoke") fx.Transform:SetPosition(x, y, z) SpawnPrefab("statue_transition").Transform:SetPosition(inst:GetPosition():Get()) inst.components.eater.ignoresspoilage = false inst.components.eater.strongstomach = false inst.components.combat.damagemultiplier = 2 inst.components.hunger.hungerrate = 2 * TUNING.WILSON_HUNGER_RATE inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 2) inst.components.sanity.dapperness = TUNING.DAPPERNESS_LARGE * (-1) inst.AnimState:SetBuild("werewrigley") isInSecondForm = true end local function OnPigMoon(inst, isfullmoon) if isfullmoon then TurnIntoSecondForm(inst) else TurnBackToNormal(inst) end end --for hunger drop changing local function OnHungerDrop(inst, data) --Make sure not to react while the player is dead. if inst:HasTag("playerghost") or inst.components.health and inst.components.health:IsDead() then return end if not isInSecondForm and inst.components.hunger.current < 25 then TurnIntoSecondForm(inst) -- Otherwise, if sanity gets back above 50, we become normal again. elseif isInSecondForm and inst.components.hunger.current > 50 then TurnBackToNormal(inst) end end -- When the character is revived from human local function onbecamehuman(inst) -- Set speed when not a ghost (optional) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "wrigley_speed_mod", 1) end local function onbecameghost(inst) -- Remove speed modifier when becoming a ghost inst.components.locomotor:RemoveExternalSpeedMultiplier(inst, "wrigley_speed_mod") end -- When loading or spawning the character local function onload(inst) inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman) inst:ListenForEvent("ms_becameghost", onbecameghost) if inst:HasTag("playerghost") then onbecameghost(inst) else onbecamehuman(inst) 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( "wrigley.tex" ) end -- This initializes for the server only. Components are added here. local master_postinit = function(inst) -- Set starting inventory inst.starting_inventory = start_inv[TheNet:GetServerGameMode()] or start_inv.default -- choose which sounds this character will play inst.soundsname = "willow" -- Uncomment if "wathgrithr"(Wigfrid) or "webber" voice is used --inst.talker_path_override = "dontstarve_DLC001/characters/" -- Stats inst.components.health:SetMaxHealth(TUNING.WRIGLEY_HEALTH) inst.components.hunger:SetMax(TUNING.WRIGLEY_HUNGER) inst.components.sanity:SetMax(TUNING.WRIGLEY_SANITY) -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1 -- Hunger rate (optional) inst.components.hunger.hungerrate = 1 * TUNING.WILSON_HUNGER_RATE inst.OnLoad = onload inst.OnNewSpawn = onload --for hugner drop changing inst:ListenForEvent("hungerdelta", OnHungerDrop) --for full moon inst:WatchWorldState("isfullmoon", OnPigMoon) OnPigMoon(inst, TheWorld.state.isfullmoon) end return MakePlayerCharacter("wrigley", prefabs, assets, common_postinit, master_postinit, prefabs)
  7. Hello! ive been trying to code for a custom character and theres a couple things I wanted to add but had troubling adding. if anyone could help with parts of this, thaht would be great! We're making a pig character. -chance of extra gold from pigking - 10 sanity from giving gift to pigking -werepigs dont aggro -lose more sanity at night/dusk -food is .75 effective Werepig form: -When hunger is less than or equal 30: -lose sanity twice as fast - lose hunger twice as fast -x2 speed -like werebeaver/weregoose/weremoose, no access to items, base attack is 65 -(idk if this is possible) -when hunger isgreater than 30: -falls asleep, for 10 seconds, after turning back to normal, gaining sanity(id kif this is possible Again, help on any of these would be great! thanks in advanced!