Yagenius

  • Content Count

    57
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Yagenius

  1. @DarkXero Ok , And here is another error. it's say in my components / tigerness . here is my components : local Tigerness = Class(function(self, inst) --V2C: Recommended to explicitly add tag to prefab pristine state inst:AddTag("tigerness") self.inst = inst self.max = 100 self.current = 0 self.is_tiger = falseend)function Tigerness:IsTiger() return self.is_tigerendfunction Tigerness:OnSave() return { current = self.current, is_tiger = self.is_tiger }endfunction Tigerness:OnLoad(data) if data then if data.current then self.current = data.current end if data.is_tiger then self.is_tiger = data.is_tiger end end if self.is_tiger then if self.maketiger then self.maketiger(self.inst) end else if self.makeperson then self.makeperson(self.inst) end endendlocal function OnTimeEffectTick(inst, self, delta, dt) self:DoDelta(delta * self.time_effect_multiplier, true) --Tigerness hitting 0 does starving damage if self.current <= 0 then inst.components.health:DoDelta(-inst.components.hunger.hurtrate * dt, false, "hunger") endendfunction Tigerness:StartTimeEffect(dt, delta_b) if self.task ~= nil then self.task:Cancel() end self.task = self.inst:DoPeriodicTask(dt, OnTimeEffectTick, nil, self, delta_b, dt)endfunction Tigerness:StopTimeEffect() if self.task ~= nil then self.task:Cancel() self.task = nil endendfunction Tigerness:SetTimeEffectMultiplier(multiplier) self.time_effect_multiplier = multiplier or 1endfunction Tigerness:DoDelta(delta, overtime) local oldpercent = self.current/self.max self.current = self.current + delta if self.current < 0 then self.current = 0 end if self.current > self.max then self.current = self.max end self.inst:PushEvent("tigernessdelta", {oldpercent = oldpercent, newpercent = self.current/self.max, overtime = overtime}) if self.is_tiger then if self.current > 50 then GetWorld().components.colourcubemanager:SetOverrideColourCube(nil) elseif self.current > 50 then GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_5_cc.tex") elseif self.current > 40 then GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_4_cc.tex") elseif self.current > 30 then GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_3_cc.tex") elseif self.current > 20 then GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_2_cc.tex") elseif self.current > 10 then GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_1_cc.tex") else GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_cc.tex") end end --if delta ~= 0 then if self.is_tiger and self.current <= 0 then self.is_tiger = false if self.onbecomeperson then self.onbecomeperson(self.inst) self.inst:PushEvent("tigerend") end elseif not self.is_tiger and self.current >= self.max then self.is_tiger = true if self.onbecometiger then self.onbecometiger(self.inst) self.inst:PushEvent("tigerstart") end end --endendfunction Tigerness:GetPercent() return self.current / self.maxendfunction Tigerness:GetDebugString() return string.format("%2.2f / %2.2f", self.current, self.max)endfunction Tigerness:SetPercent(percent) self.current = self.max*percent self:DoDelta(0)endreturn Tigerness
  2. Ok I try to understand it . I have an another error it say : Variable is not declared. when i look at My Line . local function OnTigerModeDirty(inst) if inst.HUD ~= nil and not inst:HasTag("playerghost") then SetTigerMode(inst, inst.istigermode:value()) endend " inst.istigermode:value() " Mean this ? inst.istigermode = net_bool(inst.GUID, "aikawa.istigermode", "istigermodedirty")or just " SetTigerMode " ? local function SetTigerMode(inst, istiger) if istiger then inst.HUD.controls.status:SetTigerMode(true) if inst.HUD.tigerOL ~= nil then inst.HUD.tigerOL:Show() end if not TheWorld.ismastersim then inst.CanExamine = CannotExamine SetTigerActions(inst, true) SetTigerVision(inst, true) if inst.components.locomotor ~= nil then inst.components.locomotor.walkspeed = 7 inst.components.locomotor.runspeed = 8 end end else inst.HUD.controls.status:SetTigerMode(false) if inst.HUD.tigerOL ~= nil then inst.HUD.tigerOL:Hide() end if not TheWorld.ismastersim then inst.CanExamine = inst.istigermode:value() and CannotExamine or nil SetTigerActions(inst, false) SetTigerVision(inst, false) if inst.components.locomotor ~= nil then inst.components.locomotor.walkspeed = 9 inst.components.locomotor.runspeed = 10 end end endendI'm not sure what i'm going to do. because I try to remove " inst.istigermode:value() " and " inst.istigermode = net_bool " but the game say Unknown.
  3. @DarkXero Ok more error ... Oh , I have a question!! What's different between " attempt to index field " and " attempt to call method " ?
  4. @DarkXero Ok , Here is the code I used. ---------------------------------------------------------------------------- require "stategraphs/SGweretiger"local Badge = require "widgets/badge"local easing = require "easing"local MakePlayerCharacter = require "prefabs/player_common"local start_inv = { "fish", "rabbit", "fish", "fish", "carrot",}local assets ={ Asset( "ANIM", "anim/player_basic.zip" ), Asset( "ANIM", "anim/player_idles_shiver.zip" ), Asset( "ANIM", "anim/player_actions.zip" ), Asset( "ANIM", "anim/player_actions_axe.zip" ), Asset( "ANIM", "anim/player_actions_pickaxe.zip" ), Asset( "ANIM", "anim/player_actions_shovel.zip" ), Asset( "ANIM", "anim/player_actions_blowdart.zip" ), Asset( "ANIM", "anim/player_actions_eat.zip" ), Asset( "ANIM", "anim/player_actions_item.zip" ), Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ), Asset( "ANIM", "anim/player_actions_bugnet.zip" ), Asset( "ANIM", "anim/player_actions_fishing.zip" ), Asset( "ANIM", "anim/player_actions_boomerang.zip" ), Asset( "ANIM", "anim/player_bush_hat.zip" ), Asset( "ANIM", "anim/player_attacks.zip" ), Asset( "ANIM", "anim/player_idles.zip" ), Asset( "ANIM", "anim/player_rebirth.zip" ), Asset( "ANIM", "anim/player_jump.zip" ), Asset( "ANIM", "anim/player_amulet_resurrect.zip" ), Asset( "ANIM", "anim/player_teleport.zip" ), Asset( "ANIM", "anim/wilson_fx.zip" ), Asset( "ANIM", "anim/player_one_man_band.zip" ), Asset( "ANIM", "anim/shadow_hands.zip" ), Asset( "ANIM", "anim/player_woodie.zip"), Asset( "ANIM", "anim/woodie.zip"), Asset( "ANIM", "anim/player_wolfgang.zip"), Asset( "ANIM", "anim/aikawa.zip" ), Asset( "ANIM", "anim/ghost_aikawa_build.zip" ), Asset( "ANIM", "anim/tiger_meter.zip"), Asset("ANIM", "anim/weretiger_build.zip"), Asset( "IMAGE", "images/colour_cubes/tiger_vision_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_1_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_2_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_3_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_4_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_5_cc.tex" ), Asset( "IMAGE", "images/colour_cubes/tiger_vision_6_cc.tex" ), Asset("ATLAS", "images/woodie.xml"), Asset("IMAGE", "images/woodie.tex"),}local prefabs = {}local TIGER_DIET ={ FOODTYPE.MEAT,}-- WERETIGER FUNCTIONS --local function tigeractionstring(inst, action) return "Chomp"endlocal function TigerActionButton(inst) local action_target = FindEntity(inst, 6, function(guy) return (guy.components.edible and inst.components.eater:CanEat(guy)) or (guy.components.workable and inst.components.worker:CanDoAction(guy.components.workable.action)) end) if not inst.sg:HasStateTag("busy") and action_target then if (action_target.components.edible and inst.components.eater:CanEat(action_target)) then return BufferedAction(inst, action_target, ACTIONS.EAT) else return BufferedAction(inst, action_target, action_target.components.workable.action) end endendlocal function LeftClickPicker(inst, target_ent, pos) if inst.components.combat:CanTarget(target_ent) then return inst.components.playeractionpicker:SortActionList({ACTIONS.ATTACK}, target_ent, nil) end if target_ent and target_ent.components.edible and inst.components.eater:CanEat(target_ent) then return inst.components.playeractionpicker:SortActionList({ACTIONS.EAT}, target_ent, nil) end if target_ent and target_ent.components.workable and inst.components.worker:CanDoAction(target_ent.components.workable.action) then return inst.components.playeractionpicker:SortActionList({target_ent.components.workable.action}, target_ent, nil) endendlocal function RightClickPicker(inst, target_ent, pos) return {}end-------------------- CHANGE BADGE --------------------local TigerBadge = Class(Badge, function(self, owner) Badge._ctor(self, "tiger_meter", owner)end)---------------------- CHANGE TO MEAT ----------------------local function ontigerdeat(inst, data) if data.food and data.food.components.edible.ismeat and inst.components.tigerness:IsTiger() then if data.food.components.edible.hungervalue == TUNING.CALORIES_TINY then inst.components.tigerness:DoDelta(1) elseif data.food.components.edible.hungervalue == TUNING.CALORIES_SMALL then inst.components.tigerness:DoDelta(3) elseif data.food.components.edible.hungervalue == TUNING.CALORIES_MEDSMALL then inst.components.tigerness:DoDelta(6) elseif data.food.components.edible.hungervalue == TUNING.CALORIES_MED then inst.components.tigerness:DoDelta(10) else inst.components.tigerness:DoDelta(15) end endendlocal function onaikawaeat(inst, food) if inst:HasTag("beaver") then return end -- 1 Delta is 1% -- Tigerness 70 if food.name == 'Meaty Stew' or food.name == 'Monster Meat' then inst.components.tigerness:DoDelta(70) -- Tigerness 40 elseif food.name == 'Meat' or food.name == 'Monster Lasagna' then inst.components.tigerness:DoDelta(40) -- Tigerness 35 elseif food.name == 'Bacon and Eggs' or food.name == 'Turkey Dinner' then inst.components.tigerness:DoDelta(35) -- Tigerness 30 elseif food.name == 'Morsel' or food.name == 'Batilisk Wing' then inst.components.tigerness:DoDelta(30) -- Tigerness 20 elseif food.name == 'Frog Legs' or food.name == 'Fishsticks' then inst.components.tigerness:DoDelta(20) -- Tigerness 12 elseif food.name == 'Jerky' then inst.components.tigerness:DoDelta(12) -- Tigerness 10 elseif food.name == 'Cooked Meat' or food.name == 'Cooked Frog Legs' then inst.components.tigerness:DoDelta(10) -- Tigerness 8 elseif food.name == 'Fried Drumstick' or food.name == 'Small Jerky' then inst.components.tigerness:DoDelta(7) -- Tigerness 7 elseif food.name == 'Fried Drumstick' or food.name == 'Fish' then inst.components.tigerness:DoDelta(7) -- Tigerness 5 elseif food.name == 'Cooked Morsel' or food.name == 'Cooked Fish' then inst.components.tigerness:DoDelta(5) end if inst.components.tigerness:GetPercent() > .8 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_HIGHEST")) elseif inst.components.tigerness:GetPercent() > .65 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_HIGHER")) elseif inst.components.tigerness:GetPercent() > .5 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_AVERAGE")) elseif inst.components.tigerness:GetPercent() > .3 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_LOW")) elseif inst.components.tigerness:GetPercent() > .2 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_LOWER")) elseif inst.components.tigerness:GetPercent() > .1 then inst.components.talker:Say(GetString("aikawa", "ANNOUNCE_TIGERNESS_LOWEST")) end print ('tigerness', inst.components.tigerness:GetPercent()) endlocal function tigerhurt(inst, delta) if delta < 0 then inst.sg:PushEvent("attacked") inst.components.tigerness:DoDelta(delta*.25) TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/health_down") inst.HUD.controls.tigerbadge:PulseRed() if inst.HUD.bloodover then inst.HUD.bloodover:Flash() end endendlocal function OnIsFullmoon(inst, isfullmoon) if isfullmoon then if inst.components.tigerness:GetPercent() > .25 then inst.components.tigerness:SetPercent(.25) end inst.components.tigerness:SetTimeEffectMultiplier(TUNING.BEAVER_FULLMOON_DRAIN_MULTIPLIER*0.2) else inst.components.tigerness:SetTimeEffectMultiplier(1) endendlocal function ontigernesschange(inst) if inst.sg:HasStateTag("nomorph") or inst.sg:HasStateTag("silentmorph") or inst:HasTag("playerghost") or inst.components.health:IsDead() or not inst.entity:IsVisible() then return end if inst.istigermode:value() then if inst.components.tigerness:GetPercent() > TUNING.WOODIE_TRANSFORM_TO_HUMAN then inst:PushEvent("transform_person") end elseif inst.components.tigerness:GetPercent() <= TUNING.WOODIE_TRANSFORM_TO_BEAVER then inst:PushEvent("transform_weretiger") endendlocal function onnewstate(inst) if inst._wasnomorph ~= (inst.sg:HasStateTag("nomorph") or inst.sg:HasStateTag("silentmorph")) then inst._wasnomorph = not inst._wasnomorph if not inst._wasnomorph then ontigernesschange(inst) end endendlocal function TransformTiger(inst, istiger) if istiger then onbecametiger(inst) else onbecamehuman(inst) endendlocal function SetHUDState(inst) if inst.HUD then if inst.components.tigerness:IsTiger() and not inst.HUD.controls.tigerbadge then inst.HUD.controls.tigerbadge = GetPlayer().HUD.controls.sidepanel:AddChild(TigerBadge(inst)) inst.HUD.controls.tigerbadge:SetPosition(0,-100,0) inst.HUD.controls.tigerbadge:SetPercent(1) inst.HUD.controls.tigerbadge.inst:ListenForEvent("tigernessdelta", function(_, data) inst.HUD.controls.tigerbadge:SetPercent(inst.components.tigerness:GetPercent(), inst.components.tigerness.max) if not data.overtime then if data.newpercent > data.oldpercent then inst.HUD.controls.tigerbadge:PulseGreen() TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/health_up") elseif data.newpercent < data.oldpercent then TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/health_down") inst.HUD.controls.tigerbadge:PulseRed() end end end, inst) end endendlocal function SetGhostMode(inst, isghost) if isghost then SetTigerMode(inst, false) inst._SetTigerMode(inst, true) else inst._SetGhostMode(inst, false) SetTigerMode(inst, inst.istigermode:value()) endendlocal function OnTigerModeDirty(inst) if inst.HUD ~= nil and not inst:HasTag("playerghost") then SetTigerMode(inst, inst.istigermode:value()) endendlocal function OnPlayerDeactivated(inst) inst:RemoveEventCallback("onremove", OnPlayerDeactivated) if not TheWorld.ismastersim then inst:RemoveEventCallback("istigermodedirty", OnTigerModeDirty)endendlocal function OnPlayerActivated(inst) if inst.HUD.tigerOL == nil then inst.HUD.tigerOL = inst.HUD.under_root:AddChild(Image(resolvefilepath "images/woodie.xml", "beaver_vision_OL.tex")) inst.HUD.tigerOL:SetVRegPoint(ANCHOR_MIDDLE) inst.HUD.tigerOL:SetHRegPoint(ANCHOR_MIDDLE) inst.HUD.tigerOL:SetVAnchor(ANCHOR_MIDDLE) inst.HUD.tigerOL:SetHAnchor(ANCHOR_MIDDLE) inst.HUD.tigerOL:SetScaleMode(SCALEMODE_FILLSCREEN) inst.HUD.tigerOL:SetClickable(false) end inst:ListenForEvent("onremove", OnPlayerDeactivated) if not TheWorld.ismastersim then inst:ListenForEvent("istigermodedirty", OnTigerModeDirty) end OnTigerModeDirty(inst)endlocal function SetTigerMode(inst, istiger) if istiger then inst.HUD.controls.status:SetTigerMode(true) if inst.HUD.tigerOL ~= nil then inst.HUD.tigerOL:Show() end if not TheWorld.ismastersim then inst.CanExamine = CannotExamine SetTigerActions(inst, true) SetTigerVision(inst, true) if inst.components.locomotor ~= nil then inst.components.locomotor.walkspeed = 7 inst.components.locomotor.runspeed = 8 end end else inst.HUD.controls.status:SetTigerMode(false) if inst.HUD.tigerOL ~= nil then inst.HUD.tigerOL:Hide() end if not TheWorld.ismastersim then inst.CanExamine = inst.istigermode:value() and CannotExamine or nil SetTigerActions(inst, false) SetTigerVision(inst, false) if inst.components.locomotor ~= nil then inst.components.locomotor.walkspeed = 9 inst.components.locomotor.runspeed = 10 end end endendlocal function onbecamehuman(inst) inst.Transform:SetScale(1, 1, 1, 1) inst.tiger = false inst.ActionStringOverride = nil inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild("aikawa") inst:RemoveTag("beaver") inst:RemoveComponent("worker") inst.components.locomotor.walkspeed = 7 inst.components.locomotor.runspeed = 8 inst.components.talker:StopIgnoringAll() inst.components.eater:SetOmnivore() inst.components.temperature.inherentinsulation = 0 inst.components.temperature.inherentsummerinsulation = 0 inst.components.moisture:SetInherentWaterproofness(0) inst.components.pinnable.canbepinned = true inst.components.talker:StopIgnoringAll("becametiger") inst.components.catcher:SetEnabled(true) inst.CanExamine = nil if inst.components.playercontroller ~= nil then inst.components.playercontroller:SetCanUseMap(true) end inst.components.playercontroller.actionbuttonoverride = nil inst.components.playeractionpicker.leftclickoverride = nil inst.components.playeractionpicker.rightclickoverride = nil inst.components.eater:SetOmnivore() inst.components.eater.strongstomach = false inst.components.hunger:Resume() inst.components.sanity.ignore = false inst.components.health.redirect = nil inst.components.tigerness:StartTimeEffect(2, -0.185) inst:RemoveEventCallback("oneatsomething", ontigereat) inst.Light:Enable(false) inst.components.dynamicmusic:Enable() inst.SoundEmitter:KillSound("danger") GetWorld().components.colourcubemanager:SetOverrideColourCube(nil) inst:DoTaskInTime(0, function() SetHUDState(inst) end)endlocal function onbecametiger(inst) inst.tiger = true inst.Transform:SetScale(1.6, 1.6, 1.6, 1.6) inst.components.eater:SetCarnivore(true) inst.ActionStringOverride = tigeractionstring inst:AddTag("beaver") inst.AnimState:SetBuild("weretiger_build") inst.AnimState:SetBank("weretiger") inst:SetStateGraph("SGweretiger") inst.components.talker:IgnoreAll() inst.components.locomotor.walkspeed = 6 inst.components.locomotor.runspeed = 7 inst.components.combat:SetDefaultDamage(TUNING.BEAVER_DAMAGE*2) inst.components.health:SetAbsorptionAmount(TUNING.BEAVER_ABSORPTION*1.5) inst.components.inventory:DropEverything() inst.components.playercontroller.actionbuttonoverride = TigerActionButton inst.components.playeractionpicker.leftclickoverride = LeftClickPicker inst.components.playeractionpicker.rightclickoverride = RightClickPicker --inst.components.eater:SetBeaver() inst:AddComponent("worker") inst.components.worker:SetAction(ACTIONS.DIG, 4) --inst.components.worker:SetAction(ACTIONS.CHOP, 4) --inst.components.worker:SetAction(ACTIONS.MINE, 4) inst.components.worker:SetAction(ACTIONS.HAMMER, 4) --inst:RemoveEventCallback("oneatsomething", onaieat) inst:ListenForEvent("oneatsomething", ontigereat) inst.components.sanity:SetPercent(1) inst.components.health:SetPercent(1) inst.components.hunger:SetPercent(1) inst.components.hunger:Pause() inst.components.sanity.ignore = true inst.components.health.redirect = tigerhurt inst.components.health.redirect_percent = .25 inst.components.eater.strongstomach = true inst.components.eater.monsterimmune = true inst.CanExamine = CannotExamine if inst.components.playercontroller ~= nil then inst.components.playercontroller:SetCanUseMap(false) end local dt = 3 local BEAVER_DRAIN_TIME = 120 inst.components.tigerness:StartTimeEffect(dt, (-100/BEAVER_DRAIN_TIME)*dt) inst.Light:Enable(true) inst.components.dynamicmusic:Disable() inst.SoundEmitter:KillSound("eating") inst.SoundEmitter:PlaySound("dontstarve/music/music_epicfight_winter", "danger") --GetWorld().components.colourcubemanager:SetOverrideColourCube(resolvefilepath "images/colour_cubes/tiger_vision_3_cc.tex") inst:DoTaskInTime(0, function() SetHUDState(inst) end)endlocal function onbecameghost(inst) if inst.istigermode:value() then inst.AnimState:SetBuild("ghost_aikawa_build") endend----------------------------------------------------------------------------Re-enter idle state right after loading because--idle animations are determined by beaver state.local function onentityreplicated(inst) if inst.sg ~= nil and inst:HasTag("beaver") then inst.sg:GoToState("idle") endendlocal function onpreload(inst, data) if data ~= nil and data.istiger then onbecametiger(inst) inst.sg:GoToState("idle") endendlocal function onload(inst) if inst.istigermode:value() and not inst:HasTag("playerghost") then inst.components.inventory:Close() endendlocal function onsave(inst, data) data.istiger = inst.istigermode:value() or nilendlocal function onsetskin(inst) if inst.istigermode:value() and not inst:HasTag("playerghost") then inst.AnimState:SetBuild("weretiger_build") endend--------------------------------------------------------------------------local function oncollide(inst, other) if other == GetPlayer() or not inst:HasTag("beaver") then return end inst:DoTaskInTime(2*FRAMES, function() if other and other.components.workable and other.components.workable.workleft > 0 then SpawnPrefab("collapse_small").Transform:SetPosition(other:GetPosition():Get()) other.components.workable:Destroy(inst) TheCamera:Shake("SIDE", 0.5, 0.05, 0.1) end end)endlocal master_postinit = function(inst)inst.components.health:SetMaxHealth(250) inst.components.hunger:SetMax(100) inst.components.sanity:SetMax(100) inst.components.sanity.night_drain_mult = 0 inst.components.sanity.neg_aura_mult = 0 inst.components.temperature.maxtemp = 40 inst.components.health.fire_damage_scale = 5 inst.MiniMapEntity:SetIcon( "aikawa.tex" ) -- Custom Sound inst.soundsname = "willow" inst.components.talker.colour = Vector3(255/255, 255/255, 255/255) inst.MiniMapEntity:SetIcon( "aikawa.tex" ) -- Custom Sound inst.soundsname = "willow" inst.components.talker.colour = Vector3(255/255, 255/255, 255/255) -- Stats -- Damage multiplier (optional) inst.components.combat.damagemultiplier = 1.8 -- Hunger rate (optional) inst.components.hunger.hungerrate = 0.8 * TUNING.WILSON_HUNGER_RATEend-- WERETIGER FUNCTIONS END --local function common_postinit(inst) inst:AddTag("woodcutter") inst:AddTag("polite") inst:AddTag("ghostwithhat") --beaverness (from beaverness component) added to pristine state for optimization inst:AddTag("tigerness") inst.istigermode = net_bool(inst.GUID, "aikawa.istigermode", "istigermodedirty") inst:ListenForEvent("playeractivated", OnPlayerActivated) inst:ListenForEvent("playerdeactivated", OnPlayerDeactivated) if inst.ghostenabled then inst._SetGhostMode = inst.SetGhostMode inst.SetGhostMode = SetGhostMode end if not TheWorld.ismastersim then inst.OnEntityReplicated = onentityreplicated endendlocal function master_postinit(inst) inst:AddComponent("tigerness") inst._wasnomorph = nil inst.TransformTiger = TransformTiger inst:ListenForEvent("ms_becameghost", onbecameghost) inst.entity:AddLight() inst.Light:Enable(false) inst.Light:SetRadius(15) inst.Light:SetFalloff(.5) inst.Light:SetIntensity(.6) inst.Light:SetColour(255/255,0/255,0/255) -- WERETIGER -- inst:AddComponent("tigerness") inst.components.tigerness.makeperson = onbecamehuman inst.components.tigerness.maketiger = onbecametiger inst.components.tigerness.onbecomeperson = function() inst:PushEvent("transform_person") end inst.components.tigerness.onbecometiger = function() inst:PushEvent("transform_weretiger") end onbecamehuman(inst) inst.components.eater:SetOnEatFn(onaikawaeat) -- WERETIGER END -- inst.Physics:SetCollisionCallback(oncollide) inst.OnSave = onsave inst.OnLoad = onload inst.OnPreLoad = onpreload inst.OnSetSkin = onsetskinendreturn MakePlayerCharacter("aikawa", prefabs, assets, master_postinit, start_inv)------------------------------------------------------------- This is my another error. after I try to fix it. http://upic.me/show/56578030
  5. @DarkXero: Thank you very much for reading it. and sorry for disturbing you . And This script can be turn into DST version? (because I want to play with my friends.) The latest script , I use Woodie is script The game run nicely ... but when I wait to Full Moon Day , My game is crashing.... [ and this is my little kitty. ] http://upic.me/show/56569218
  6. In game it say : attempt to index "locomote" (a nil value) (It happen , after I choose my Character.) -------------------------------------------------------- (Sorry for my dumb , I'm Just a beginner.) -------------------------------------------------------- Here this is a code (stategraph , SGai.lua ) I use in game . (I try to understand the Code from " Wicked The Merm " ) Please Help. Thank you.
  7. I following your tutorial but my game is not load ; ^ ; Can you help me? it always freeze... (after I choose my character , and the game is going Freeze.)