• Content Count

  • Joined

  • Last visited

Community Reputation

8 Neutral

About Gigadroid

  • Rank
    Junior Member

Recent Profile Visitors

716 profile views
  1. @kiopho Ooops! Your mod works fine hahaha Just a regen mod not checking the character's death/alive state and so it regens-die-regen-die. Once again, great mod kiopho!
  2. Dear kiopho, I really enjoyed your mod. Especially the Neat version. However, I discovered a resurrection incompatibility (that can be resolved but I don't know how) with Resurrection Shelter. The only thing I changed in that resurrection mod was to add a GLOBAL.RECIPE_GAME_TYPE.COMMON if the game mode is SW-compatible. The resurrection works when your mod is turned off and sometimes, if there are two or more resurrection shelters built, when the character dies it will die->die->die->resurrect->resurrect->Game Over with a crash of last_death_position is a nil value. I tried to fix it myself but I'm not proficient enough. Could you help me with it?
  3. What this mod does: Increases the max augment limit to 8 (HUD cannot see past 8 augments). Install up to 8 augments slots at an augment machine. Mainly for Endless runs. How to install this mod: Locate Invisible Inc/ Backup Unzip Locate sim/abilities file Replace useAugmentMachine.lua (attached below) Rezip scripts file. Majority of credits goes to x43x61x69 for his cheat which I then modified to make it more balanced. (His cheat lets you install augments immediately without checking for augment slots) Working Version: 136032 It could still be working for the updated versions. How to check your version: Press F1 when in Invisible Inc. EDIT: I noticed that this mod may have conflicts with other mods modifying useAugmentMachine.lua so perform the steps below (does not require download) to make it compatible with other mods. Using a simple text editor, find: and replace it entirely with: useAugmentMachine.lua
  4. Ahh I see. Why is there a need for "GLOBAL." and when is it needed? "By editing Use(), you make it so using the tool as a tool, and the tool as a weapon don't consume durability. You don't want that, you just want to nullify the effects of Use() when attackwear is being passed." What I understood from that is: Use() is whenever the tool is well.....used, whether attacking or chopping or mining. I don't want to replace Use() with attackwear because Use() will still decrease the durability? So I need both either way?
  5. Oh yup! I knew that! Yay! Oh I was wondering how would it be possible to make spiderhats repairable from sewing kits. I found out that they have their own fueltype of FUELTYPE.SPIDERHAT and I wish to change it to FUELTYPE.USAGE so that sewing kits can repair them. Is that the right way? However, a problem I face is that I can't find spiderhat.lua and only found hats.lua. How would I make this modification using a new modmain.lua? Also after you showed me attackwear above, isn't it much simpler to just use that instead of inst.components.finiteuses:Use()? By using attackwear, you can know the final increase in durability (maybe some tools have different attackwear so your Use(onepercent) could be way off).
  6. Interesting. Thank you very much DarkXero for teaching me these things. I attempted to apply it below and got hunger drain working! Code: local function hungerdrain(inst, owner, target) local halfpercenthunger = owner.components.hunger.max*0.01*0.5 if owner.components.hunger and owner.components.hunger:GetPercent() < 1 and not target:HasTag("wall") then owner.components.hunger:DoDelta(halfpercenthunger) endendlocal function hungeronattack(inst) if inst.components.weapon and inst.components.finiteuses then local attack = inst.components.weapon.onattack inst.components.weapon.onattack = function(inst, owner, target) hungerdrain(inst, owner, target) if attack then attack(inst, owner, target) end end endendAddPrefabPostInit("tentaclespike", hungeronattack)Do let me know if anything can be improved. Also, I noticed that the multitool doesn't restore 1% on EVERY hit. On every 4th or 5th hit, it doesn't restore 1%. Could the 1% be a decimal value that is causing this? Or is it still not implemented properly? Am I supposed to insert this: -- Added Tools Durability Regenerationlocal function GiveOnePercentOnAttack(weapon, attacker, target) if target then local onepercent = / 100 if (weapon.components.finiteuses.current + onepercent) <= then weapon.components.finiteuses:Use(-onepercent) end endend local function GiveUsesOnAttack(inst) if inst.components.weapon and inst.components.finiteuses then local old = inst.components.weapon.onattack inst.components.weapon.onattack = function(weapon, attacker, target) GiveOnePercentOnAttack(weapon, attacker, target) if old then old(weapon, attacker, target) end end endend--Enter list of tools belowAddPrefabPostInit("multitool_axe_pickaxe", GiveUsesOnAttack) into this: or does it not matter even if I put them at the very end of the whole modmain.lua? I believe I tried changing local function GiveOnePercentOnAttack(weapon, attacker, target) to local function GiveOnePercentOnAttack(inst, attacker, target) (not only this line but also the others accordingly) so that it is the same thing from TweakThoseTools but it still doesn't restore 1% every hit.
  7. there a way to only affect one weapon? If final damage dealt is not possible, then what other forms of damage is possible? Pure weapon damage? So if I put the code above into Mod1/modmain.lua, it will use from Mod2/modmain.lua? Also, I wish to understand why is GiveUsesOnAttack needed at all. Why not just input inst.components.weapon.onattack anywhere in GiveOnePercent? How does it work actually? local function GiveUsesOnAttack(inst) if inst.components.weapon and inst.components.finiteuses then local old = inst.components.weapon.onattack inst.components.weapon.onattack = function(weapon, attacker, target) GiveOnePercentOnAttack(weapon, attacker, target) if old then old(weapon, attacker, target) end end endendMore specifically, could you explain the part of: local old = inst.components.weapon.onattack inst.components.weapon.onattack = function(weapon, attacker, target) GiveOnePercentOnAttack(weapon, attacker, target) if old then old(weapon, attacker, target) 1. Why do you need to local old? 2. How does setting up inst.components.weapon.onattack = function(weapon, attacker, targer) work? 3. if old then old(weapon, attacker, target) is the same as if inst.components.weapon.onattack = GiveOnePercentOnAttack(weapon, attacker, target) then GiveOnePercentOnAttack(weapon, attacker, target)?
  8. The final calculated damage that is dealt. So I'm assuming the calculation will include: Weapon Damage Character Damage Multiplier Monster/Player Damage Reduction
  9. 1. For the durability gain perk, is it possible to separate TweakToolDurability lua and onattack lua onto different files while onattack will still call the modified Because in this case, any tools that use TweakToolDurability will gain the perk. Long way to do it would be to have a TweakToolDurability and TweakToolDurability2 to separate the functions for different tools but I'm wondering if there's a better and smarter way to do this. 2. For lifesteal, I tried attacker.components.combat.onhitotherfn as the value but that sounded silly of me. HAHAHAA How would I code to get the value of the final damage dealt? THANK YOU DarkXero
  10. However, will I have to put the function TweakToolDurability in the same file? Or may I do this onepercent thing in another file? If for example I put this onattack function into the modmain of TweakToolDurability (to make use of the , how would I link the function to the axe_pickaxe prefab in the main game folder? Only the PrefabFiles {} in the beginning will do? Also, how would one code a feature of lifesteal based on damage instead of a fixed amount like BatBat?
  11. LOL Damn it. I thought it was inst.components.finiteuses or something with inst. Ugh, okay thanks again DarkXero! You've been sooooo helpful all this while! Hmmm, to make this more versatile and more compatible (not that there are any compatibility issues now), how would it be possible to create a formula that adds 1% even with Tweak Those Tools mod which modifiy your and weapon.components.finiteuses.current as seen below: function TweakToolDurability(inst) if inst.components.finiteuses then = ( * TOOL_DURABILITY) inst.components.finiteuses.current = (inst.components.finiteuses.current * TOOL_DURABILITY) end if inst.components.fueled then inst.components.fueled.maxfuel = (inst.components.fueled.maxfuel * TOOL_DURABILITY) inst.components.fueled.currentfuel = (inst.components.fueled.currentfuel * TOOL_DURABILITY) inst.components.fueled.bonusmult = (inst.components.fueled.bonusmult * TOOL_DURABILITY) end end AddPrefabPostInit("multitool_axe_pickaxe", TweakToolDurability) THANK YOU!!
  12. Helloooooo Klei forums! I've been enjoying DST a lot and I came across a mod called Tungsten mod by Mr.Gentleman and outseeker and I'm intrigued by their regeneration on tools (by attacking). Their mod codes are shown below: local function onattack(weapon, attacker, target) if target ~= nil then weapon.components.finiteuses:Use(-1.5) endendlocal function fn(Sim) local inst = CreateEntity() local trans = inst.entity:AddTransform() local anim = inst.entity:AddAnimState() MakeInventoryPhysics(inst) anim:SetBank("axe") anim:SetBuild("tungsten_axe") anim:PlayAnimation("idle") inst.entity:AddNetwork() if not TheWorld.ismastersim then return inst end MakeHauntableLaunchAndSmash(inst) inst:AddTag("sharp") inst:AddComponent("weapon") inst.components.weapon:SetDamage(TUNING.TUNGSTEN_AXE_DAMAGE) inst.components.weapon:SetAttackCallback(onattack) ------- inst:AddComponent("finiteuses") inst.components.finiteuses:SetMaxUses(TUNING.TUNGSTEN_AXE_USES) inst.components.finiteuses:SetUses(TUNING.TUNGSTEN_AXE_USES) inst.components.finiteuses:SetOnFinished( onfinished ) I replicated this to my own tools instead of their tungsten tools, however, I noticed that the durability can go over 100%. Is there a way to prevent this? Help is much appreciated!! Thank you!!
  13. @DarkXero OMG YES you're right it worked! Separating applymightiness and regen worked! I don't know why it's an error but it is. Alright now for the final challenge: Whenever there is regen, there should be increased hunger. Combine this with Wolfgang's mighty hunger rate, I wish to get a might regen hunger rate. For example, looking at the code below: local function applymightiness(inst) local percent = inst.components.hunger:GetPercent() local damage_mult = TUNING.WOLFGANG_ATTACKMULT_NORMAL local hunger_rate = TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL local regen_hunger_rate = 1.5*TUNING.WILSON_HUNGER_RATE -- Multiple for regen hunger rate local health_max = TUNING.WOLFGANG_HEALTH_NORMAL local scale = 1.25 --Previously 1 local mighty_scale = 1.75 --Previously 1.25 local wimpy_scale = 1 --Previously .9 if inst.strength == "mighty" then local mighty_start = (TUNING.WOLFGANG_START_MIGHTY_THRESH/TUNING.WOLFGANG_HUNGER) local mighty_percent = math.max(0, (percent - mighty_start) / (1 - mighty_start)) damage_mult = easing.linear(mighty_percent, TUNING.WOLFGANG_ATTACKMULT_MIGHTY_MIN, TUNING.WOLFGANG_ATTACKMULT_MIGHTY_MAX - TUNING.WOLFGANG_ATTACKMULT_MIGHTY_MIN, 1) health_max = easing.linear(mighty_percent, TUNING.WOLFGANG_HEALTH_NORMAL, TUNING.WOLFGANG_HEALTH_MIGHTY - TUNING.WOLFGANG_HEALTH_NORMAL, 1) hunger_rate = easing.linear(mighty_percent, TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL, TUNING.WOLFGANG_HUNGER_RATE_MULT_MIGHTY - TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL, 1) scale = easing.linear(mighty_percent, 1, mighty_scale - 1, 1) elseif inst.strength == "wimpy" then local wimpy_start = (TUNING.WOLFGANG_START_WIMPY_THRESH/TUNING.WOLFGANG_HUNGER) local wimpy_percent = math.min(1, percent/wimpy_start ) damage_mult = easing.linear(wimpy_percent, TUNING.WOLFGANG_ATTACKMULT_WIMPY_MIN, TUNING.WOLFGANG_ATTACKMULT_WIMPY_MAX - TUNING.WOLFGANG_ATTACKMULT_WIMPY_MIN, 1) health_max = easing.linear(wimpy_percent, TUNING.WOLFGANG_HEALTH_WIMPY, TUNING.WOLFGANG_HEALTH_NORMAL - TUNING.WOLFGANG_HEALTH_WIMPY, 1) hunger_rate = easing.linear(wimpy_percent, TUNING.WOLFGANG_HUNGER_RATE_MULT_WIMPY, TUNING.WOLFGANG_HUNGER_RATE_MULT_NORMAL - TUNING.WOLFGANG_HUNGER_RATE_MULT_WIMPY, 1) scale = easing.linear(wimpy_percent, wimpy_scale, 1 - wimpy_scale, 1) end inst:ApplyScale("mightiness", scale) inst.components.hunger:SetRate(hunger_rate*TUNING.WILSON_HUNGER_RATE + regen_hunger_rate) inst.components.combat.damagemultiplier = damage_mult local health_percent =, true)endI wish to ask that if I have another function outside and below the code above, what would hunger_rate be? How does local work? And the hunger_rate formula in applymightiness only stays in applymightiness? If I have another function that is something like: local function updatestats(inst) if inst.regen == "minregen" then inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 0 + TUNING.WILSON_HUNGER_RATE*hunger_rate), 1) inst.components.sanity.dapperness = (0) local Temperature = Class(function(self, inst) self.inherentinsulation = 0 end) endendWhich hunger_rate would it use? THANK YOU SO FAR!!!
  14. @DarkXero Oh cool! But I'm still wondering how I did wrong. Don't get me wrong I really appreciate your help but I prefer to be spoonfed less, though that requires people reading my wall of code. D: For example, in this context, how is it that I use the same function as Heather on Wolfgang but the regen method now fails? Also, I just tested it and it appears that since it is a periodic task instead of a startregen, wolfgang keeps saying It tickles or Ahh, it feels great every time he heals by the inst.healingfactor amount. Perhaps startregen would be more appropriate in this context? How would that be possible?
  15. Interesting. Testing it right after I ask this question. Thanks!! If that is the case, why is it that heather.lua (attached below) does not require this method of regen? EDIT: Or its modmain.lua as well for that matter. heather.lua modmain.lua