tetrified Posted December 31, 2014 Share Posted December 31, 2014 We all know that finding these hidden gems is what really makes modding worth it. Share your favorite comments from Klei and where they're at, I'll kick it off with one of my personal favorites from util.lua Link to comment Share on other sites More sharing options...
Kzisor Posted December 31, 2014 Share Posted December 31, 2014 I stumbled across this the other day thought it was hilarious. --V2C: What is this for??function OnMessageReceived( username, message )--[[local player = ThePlayerif player ~= nil thenlocal hud = player.HUDif hud ~= nil and hud.controls ~= nil thenhud.controls:OnMessageReceived( username, message )endend]]end Link to comment Share on other sites More sharing options...
tetrified Posted December 31, 2014 Author Share Posted December 31, 2014 (edited) --V2C: What is this for??I think I've seen that before, I always wonder if they actually thought nobody would ever see these or if they left them in purely for our benefit. I know I can use a laugh sometimes when I'm digging for an obscure function/variable with an unintuitive name.ACTIONS.GOHOME.fn = function(act) --this is gross. make it better later. if act.target.components.spawner then return act.target.components.spawner:GoHome(act.doer) elseif act.target.components.childspawner then return act.target.components.childspawner:GoHome(act.doer) elseif act.pos then if act.target then act.target:PushEvent("onwenthome", {doer = act.doer}) end act.doer:Remove() return true endend Edited December 31, 2014 by tetrified Link to comment Share on other sites More sharing options...
legman111 Posted December 31, 2014 Share Posted December 31, 2014 I quite liked seeing this on line 594 in "player_common.lua".--we disabled health penalty for PAX. I think I prefer it. If we like it, do it properly.inst.components.health:RecalculatePenalty(true)-- inst:RemoveComponent("sanityaura")--inst:RemoveComponent("humanity")--inst:RemoveComponent("haunter")--don't ignore sanity any moreinst.components.sanity.ignore = false Link to comment Share on other sites More sharing options...
rezecib Posted December 31, 2014 Share Posted December 31, 2014 (edited) I remember I found a short conversation in one of the files... Ahh, gotta go look for it now. Will edit it in if I find it. Edit: Not the one I was looking for, but zing!function Inventory:DropEverythingWithTag(tag, keepcharacterspecific, exclude) -- Only allow one copy of a char specific item -- #srosen this does prevent you taking mult copies of books or other char's books, etc, which isn't great... -- #v2c books are not "irreplaceable" and can be crafted so we don't care who takes themA few amusing ones I found on the search (frograin):--V2C: FIXME: nobody calls this ever... c'mon...function self:StopTracking(inst) _frogs[inst] = nilendsaveindex (Vito doesn't know something!? this must've been before his ascension...):function SaveIndex:FixupServerData() -- V2C: THIS IS WRONG if it runs on clients -- however it looks like it's for deprecated stuff so.... -- I don't know =) ask charles. for idx, slot in ipairs(self.data.slots) doresurrector:--this is a bit presentationally-specific for component land but whatever.function Resurrector:Resurrect(dude)smallbird:local function OnAttacked(inst, data) --print("smallbird - OnAttacked !!!") if inst:HasTag("teenbird") and data.attacker ~= nil and (data.attacker == inst.components.follower.leader or data.attacker:HasTag("player")) then --print(" what did I ever do to you!?") -- well i was just annoyed, but now you done pissed me off! SetTeenAttackDefault(inst) endHmm... I didn't find the conversation I was looking for. I seem to remember it being between Kaj and Seth, but that's nowhere to be found, now. Guess it got cleared away Edited December 31, 2014 by rezecib Link to comment Share on other sites More sharing options...
tetrified Posted January 1, 2015 Author Share Posted January 1, 2015 (edited) Here's one from tuning overrideI don't know why, but for some reason them declaring that that function was hacked together with --HACK HACK HACK is really funny to me Edited January 1, 2015 by tetrified Link to comment Share on other sites More sharing options...
rezecib Posted January 1, 2015 Share Posted January 1, 2015 From frostbreath: emitter:AddRotatingParticleUV( lifetime, -- lifetime px, py, pz, -- position vx, vy, vz, -- velocity angle, -- rotation angular_velocity, -- angular_velocity 0, 0 -- uv offset ) Link to comment Share on other sites More sharing options...
rezecib Posted January 14, 2015 Share Posted January 14, 2015 There were some good ones in today's patch.player_common: --V2C: Unfortunately the sleeping bag code is incredibly garbage -- so we need all this extra cleanup to cover its edge casescontrolsscreen:function ControlsScreen:OnDestroy() --print("whatsthis") --itsgoodstuff Link to comment Share on other sites More sharing options...
Ubiquitous Posted January 14, 2015 Share Posted January 14, 2015 smallbird.lualocal function SetTeenAttackDefault(inst) --print("teenbird - Set phasers to 'KILL'") inst:RemoveTag("peck_attack") inst.components.combat:SetDefaultDamage(TUNING.TEENBIRD_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.TEENBIRD_ATTACK_PERIOD)end local function SetTeenAttackPeck(inst) --print("teenbird - Set phasers to 'PECK'") inst:AddTag("peck_attack") inst.components.combat:SetDefaultDamage(TUNING.TEENBIRD_DAMAGE_PECK) inst.components.combat:SetAttackPeriod(TUNING.TEENBIRD_PECK_PERIOD)endWonder how many will get the reference lol Link to comment 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