-t-

  • Content Count

    157
  • Joined

  • Last visited

Community Reputation

111 Excellent

1 Follower

About -t-

  • Rank
    Member
...

Recent Profile Visitors

426 profile views
  1. The rim, background and the pointer for the clock is in hud.tex in data/databundles/images/images. Additionally you can find: Cave clock animations in data/anim/cave_clock.zip, The little moon clock in data/anim/moon_phases_clock.zip Clock transitions/animations from day to dusk, dusk to night etc. in data/anim/clock_transitions.zip
  2. @Yakuzashi Is checking whether it's summer every 60 seconds necessary? You could probably do it with world watchers instead. Add a WatchWorldState("season", summerspeed) to your character and make the function take 2 variables: local function summerspeed(inst, season) -- Added a 'season' variable if season == "summer" then -- Check the season inst.components.locomotor:SetExternalSpeedMultiplier(inst, "CHARACTERNAME_speed_mod", 1.65) -- summer speed else inst.components.locomotor:SetExternalSpeedMultiplier(inst, "CHARACTERNAME_speed_mod", 1.25) --normal speed end end This way the function will be called only when seasons are changing. Additionally run this function on initialization: local function OnInit(inst) -- Run this function in your master_postinit summerspeed(inst, TheWorld.state.season) end This function is needed to set the appropriate speed boost when the character is created (when you join a game), while the other only sets the value when the seasons change.
  3. Based on this function I'm assuming you're creating an armor that changes it's absorption percent when the wearer has low/high sanity. For that you can use the SetAbsorption function present in the 'armor' component. With this function the 'updateArmor' would have to look different: local function updateArmor(owner) local sanity_percent = owner.components.sanity and owner.components.sanity:GetPercent() or 0 -- This gets the current sanity percentage local absorptionRange = sanity_percent/(0.75/0.77) + 0.13 -- This is the absorption range (from 90% to 13%) local absorption = absorptionRange -- I added this just to change the name of the variable but you can delete it and use 'absorptionRange' instead if absorption > 0.9 then -- Don't allow a value higher than 90% absorption = 0.9 end inst.components.armor:SetAbsorption(absorption) -- Set the new absorption end This function smaller than yours but the math required for the range of the absorption is pretty specific if you want to change the range here is how you can do it: current_sanity_percent / (start_decreasing_absorption_percent / (maximum_absorption - minimum_absorption)) + minimum_absorption start_decreasing_absorption_percent is at what point the armor has to start losing absorption, so 0.75 would mean that at 75% sanity the armor will start decreasing it's absorption. Example: current_sanity / (0.75 / (0.8 - 0.2 ) ) + 0.2 The armor will start losing absorption at 75% sanity, starting from 80% absorption down to 20% absorption.
  4. What exactly happens? Does the game crash? If so, when does the game crash. If no, does your function not do anything?
  5. Animals that can be picked up and held in the inventory have the 'inventoryitem' component. This component has a function called 'IsHeld' which can be used to determine whether the animal is being held currently. So you can add this check to your function: local maxSanityRateBonusPerEntity = TUNING.SANITYAURA_SMALL local function sanityfn(inst) local delta = 0 local x, y, z = inst.Transform:GetWorldPosition() local max_rad = 10 local oneoftags = { "bee", "flower", "butterfly", "rabbit", "koalefant_summer", "koalefant_winter", "chester", "squid", "glommer", "hutch", "mole" } local ents = TheSim:FindEntities(x, y, z, max_rad, nil, nil, oneoftags) for i, v in ipairs(ents) do if v.components.inventoryitem and not v.components.inventoryitem:IsHeld() then -- If the entity is NOT held local isDead = v.components.health ~= nil and v.components.health:IsDead() or false local distsq = inst:GetDistanceSqToInst(v) - 9 delta = delta + maxSanityRateBonusPerEntity / math.max(1, distsq) * (isDead and -1 or 1) -- Add to the delta variable end if v.components.inventoryitem == nil then -- If the entity doesn't have the 'inventoryitem' component local isDead = v.components.health ~= nil and v.components.health:IsDead() or false local distsq = inst:GetDistanceSqToInst(v) - 9 delta = delta + maxSanityRateBonusPerEntity / math.max(1, distsq) * (isDead and -1 or 1) -- Add to the delta variable end end return delta end
  6. Happy it works for you. Btw, if the second table in 'SetDiet' is the same as the first one you can remove it.
  7. -------------- You've added the edible component to nightmare fuel correctly. To add this new food type to your characters diet you have to type in 'FOODTYPE.CURSE' instead of 'CURSE'. Also, FOODGROUP.OMNI is just the default diet set to most character so that they can eat basic foods, like meat, berries, crockpot foods etc. By setting the diet to 'FOODGROUP.OMNI' and 'FOODTYPE.CURSE' you allow your character to eat these basic foods + nightmare fuel.
  8. Try without GLOBAL in front of FOODGROUP.OMNI and FOODTYPE.VAMPFOOD. GLOBAL.FOODTYPE.VAMPFOOD = "VAMPFOOD" and AddPrefabPostInit("reviver", function(inst) if not GLOBAL.TheWorld.ismastersim then return inst end inst:AddComponent("edible") inst.components.edible.foodtype = GLOBAL.FOODTYPE.VAMPFOOD inst.components.edible.healthvalue = GLOBAL.TUNING.HEALING_HUGE inst.components.edible.hungervalue = GLOBAL.TUNING.CALORIES_HUGE inst.components.edible.sanityvalue = GLOBAL.TUNING.SANITY_HUGE end) need to go in modmain.lua.
  9. Yeah, it's the same thing as this. Most stuff from tuning.lua, constants.lua and strings.lua are just a bunch of global variables or tables and they all are easily editable.
  10. This is just a table, and it's a global one at that, which makes it easily editable. You can edit it like this: GLOBAL.TUNING.DROWNING_DAMAGE.MY_CHARACTER = { HEALTH_PENALTY = 0.25, HUNGER = 25, SANITY = 25, WETNESS = 100, } Just put in in your modmail.lua and if you have local TUNING = GLOBAL.TUNING then you don't need to put GLOBAL at the begging there.
  11. Drowning penalties differ for most characters, like WX who takes more damage and has a higher sanity penalty, Woodie who loses more hunger or Walter who loses less health and sanity. All of these values are in tuning.lua, specifically at line 3661 to 3713.
  12. I think the vignette you're trying to remove is in the PlayerHud widget. You can easily Kill() it to remove it however it's not created on creation of the widget but rather in a function called 'CreateOverlays' so you'd have to override that function to Kill() the vignette right after its creation. AddClassPostConstruct("screens/playerhud", function(self) -- Override the PlayerHud class local oldCreateOverlays = self.CreateOverlays -- Create a local 'oldCreateOverlays', because we don't want to completely override this function function self:CreateOverlays(owner) -- Override the 'CreateOverlays' function oldCreateOverlays(self, owner) -- Firstly do the original function self.vig:Kill() -- Then kill the 'vig' end end) This will Kill() the vignette on creation. Unfortunately this will also remove the veiny insanity effect since it's the same entity but with a different animation. If you want to remove only the vignette without removing insanity veins you would have to create a new animation file.
  13. Can you post the entire code for your character? And, do you get any messages when the game crashes when you spawn a telltale heart? Or does it just stop and disconnect you? I tested this exact code and it worked for me so I think the problem lies in how you implemented this.
  14. Ok, so I've found what was wrong. Apparently you have to add the new food type into the FOODTYPE table, you can't just type it in the diet. I don't really know why it works that way but at least it does. You'll have to add this new food type like this: GLOBAL.FOODTYPE.VAMPFOOD = "VAMPFOOD" And add a diet to your character: inst.components.eater:SetDiet({ GLOBAL.FOODGROUP.OMNI, GLOBAL.FOODTYPE.VAMPFOOD }) -- OMNI + your special food type And add the VAMPFOOD food type to the 'reviver', that's what the telltale hearts prefab is called: AddPrefabPostInit("reviver", function(inst) if not GLOBAL.TheWorld.ismastersim then return inst end inst:AddComponent("edible") inst.components.edible.foodtype = GLOBAL.FOODTYPE.VAMPFOOD inst.components.edible.healthvalue = GLOBAL.TUNING.HEALING_HUGE inst.components.edible.hungervalue = GLOBAL.TUNING.CALORIES_HUGE inst.components.edible.sanityvalue = GLOBAL.TUNING.SANITY_HUGE end)