jimmosio

  • Content Count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jimmosio

  • Rank
    Junior Member
...
  1. I used the code you handed me for 2 weeks or so, with the one I wrote I tried to "optimize space", but I realised that crashes my game if I try to craft anything other than armor. I'll try to explain my problem more clearly. The code works perfectly in DS, but if I put the same code in DST, the crafted armor starts at 100% durability rather than 135%. I suspect that I have to use a different instance rather than "data". A bit like GetWorld() in DS and TheWorld in DST, hopefully you get the comparison.
  2. I need to bump this post again. I want to do the same thing, but in DST. Should be easy enough to write down, but what variable should I use to identify the item? This is the code in its actual state: local function ab(inst,data) if data.item.prefab == "armorwood" or "armormarble" or "armorruins" or "ruinshat" or "armordragonfly" or "footballhat" or "armorgrass" or "armor_sanity" or "beehat" then data.item.components.armor:SetPercent(1.35) endend
  3. The night vision thing works and all, but I can't get the increased armor working, it always stays 100%, and it doesn't seem to have more HP either (a hound always removes 4% of armor). This is what I'm using: if data.item == "armorwood" then --armor_inst.components.armor:SetPercent(1.35) armor_inst.maxcondition = 135 armor_inst.components.armor:InitCondition(TUNING.ARMORWOOD * 1.35, TUNING.ARMORWOOD_ABSORPTION) end end)I noticed how the max durability is capped at 100 in armor.lua, so I tried to increase it, but still nothing. I crave help.
  4. local fn = function(inst) -- choose which sounds this character will play inst.soundsname = "s1mon" -- Minimap icon inst.MiniMapEntity:SetIcon( "s1mon.tex" ) -- Stats inst.components.health:SetMaxHealth(165) inst.components.hunger:SetMax(130) inst.components.hunger:SetRate(0.9*TUNING.WILSON_HUNGER_RATE) inst.components.sanity:SetMax(140) local lightradius=3 local lightfalloff=.7 local lightintensity=.5 local currenthunger=inst.components.hunger.current inst:ListenForEvent( "nighttime", function() if currenthunger>=104 then inst.entity:AddLight() inst.Light:Enable(true) inst.Light:SetRadius(lightradius) inst.Light:SetFalloff(lightfalloff) inst.Light:SetIntensity(lightintensity) inst.Light:SetColour(65/65,160/160,40/40) else inst.entity:AddLight() inst.Light:Enable(false) inst.Light:SetRadius(lightradius) inst.Light:SetFalloff(lightfalloff) inst.Light:SetIntensity(lightintensity) inst.Light:SetColour(65/65,160/160,40/40) end end, GetWorld() ) inst:ListenForEvent( "daytime", function() inst.entity:AddLight() inst.Light:Enable(false) inst.Light:SetRadius(lightradius) inst.Light:SetFalloff(lightfalloff) inst.Light:SetIntensity(lightintensity) inst.Light:SetColour(65/65,160/160,40/40) inst.components.hunger:SetRate(0.75*TUNING.WILSON_HUNGER_RATE) --slower hunger rate during the day end, GetWorld() )endThis is my character's code. Focus from line 56 to 85. It basically emits light during the night if the hunger value is higher than 104, the problem is that the hunger check is ran only once, when night starts. I want to make it that the night vision appears/disappears mid-night if the hunger value is enough/not enough. Another question, is it possible to craft armor with higher durability than usual? For example, crafting a Log Suit with 35% more HP, giving it 607 rather than 450 (not really necessary, but maybe display 135% in the inventory?Even though it's probably going to be consequential). Thanks in advance.