SenL Posted April 15, 2015 Share Posted April 15, 2015 (edited) I have a "stinger turret" mod (http://steamcommunity.com/sharedfiles/filedetails/?id=424742412) that's basically 90% copy of eyeturret but my turret crashes when the projectile reaches a bat. Hound is ok. Odd. Log:...mon/dont_starve/data/scripts/components/overseer.lua:533: attempt to index field 'teamleader' (a nil value)LUA ERROR stack traceback: F:/Steam/steamapps/common/dont_starve/data/scripts/components/overseer.lua(533,1) in function 'CheckTeam' F:/Steam/steamapps/common/dont_starve/data/scripts/components/overseer.lua(547,1) in function 'OnUpdate' F:/Steam/steamapps/common/dont_starve/data/scripts/update.lua(104,1)scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen How do I fix this? Thanks. Edit:I ported this from DST (also mine) but DST version doesn't crash when the turret attacks a bat. Edit:Oh darn, the overseer.lua is mostly commented out in DST. Edit:Ok found the culprit. Below.local function onattack_blue(inst, attacker, target, skipsanity) target:PushEvent("attacked", {attacker = attacker, damage = 0}) if attacker and attacker.components.sanity and not skipsanity then attacker.components.sanity:DoDelta(-TUNING.SANITY_SUPERTINY) end if target.components.freezable then target.components.freezable:AddColdness(1) target.components.freezable:SpawnShatterFX() end if target.components.sleeper and target.components.sleeper:IsAsleep() then target.components.sleeper:WakeUp() end if target.components.burnable and target.components.burnable:IsBurning() then target.components.burnable:Extinguish() end if target.components.combat then target.components.combat:SuggestTarget(attacker) if target.sg and not target.sg:HasStateTag("frozen") and target.sg.sg.states.hit and not target:HasTag("player") then target.sg:GoToState("hit") end endend That code is from DST... what could break it for DS:ROG? Hm... Edit:Found the real culpritIt's this codeif target.components.combat then target.components.combat:SuggestTarget(attacker) if target.sg and target.sg.sg.states.hit then target.sg:GoToState("hit") end end Edited April 15, 2015 by SenL Link to comment https://forums.kleientertainment.com/forums/topic/52880-crash-on-overseerlua/ Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now