Electroflux Posted January 12, 2015 Share Posted January 12, 2015 http://pastebin.com/CwVWX5Wc Primarily the issue with this code is this: Character stats: 200 health150 hunger200 sanity Perk 1: Increase hp to 300 (max HP and his current health(therefore he's getting healed)) and increase his speed to 1.25 while below 30 sanity. This effect only lasts 15-20 seconds and can only happen in intervals of 5-10 minutes. Perk 2: Randomly emote /cry below 100 sanity every 30-60 seconds. Right now that code is basically saying: "When below Willows threshold of sanity, whatever it is (I thought it was 0.5 (50%) but it's been going off at like 150 sanity), increase speed and hp""When above willows threshold of sanity, reset to normal stats". There's no complexity, it's either on or off. The speed boost lasts eternal while under willows sanity threshold and never stops unless his sanity is high again. I'd prefer to get rid of Willow's threshold completely and just set it to below 30 sanity. Perk 1 is a pretty good buff, therefore it should only happen for a short time at long intervals while below 30 sanity. Perk 2 is just an annoyance for being below 100 sanity since he keeps crying all the time. The crying doesn't work either. He only appears to /cry once when he's low on sanity. I have yet to notice a second time. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/ Share on other sites More sharing options...
DarkCrafter Posted January 13, 2015 Share Posted January 13, 2015 How many topics have you made of this? I've seen a couple. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601135 Share on other sites More sharing options...
Electroflux Posted January 13, 2015 Author Share Posted January 13, 2015 This is the second one but I feel that people who may help by looking at the other thread either:1. Got intimidated by the thread size and just didn't bother2. Just don't know the answer3. Gave up helping for whatever reasonI'd like to believe 2 but since I still think this is a developing community, I've came to realize I either get a solution or don't at this point. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601397 Share on other sites More sharing options...
Ubiquitous Posted January 14, 2015 Share Posted January 14, 2015 Have you tried using DoPeriodicTask(time, function()? I am not completely sure on what can be done since I just started modding this game but you might be able to nest some periodic timers to trigger the desired results. An example of a periodic timer:-- When item is equipped the owner will gain 5 health every 10 secondslocal function onequip(inst, owner) --inst.task = inst:DoPeriodicTask(# of seconds, function() inst.task = inst:DoPeriodicTask(10, function() owner.components.health:DoDelta(5) -- How much health the owner will gain end)end Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601677 Share on other sites More sharing options...
DarkXero Posted January 14, 2015 Share Posted January 14, 2015 The two perks are beastbug and crybug.Firebug adapted.Isaac.zip Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601714 Share on other sites More sharing options...
Electroflux Posted January 14, 2015 Author Share Posted January 14, 2015 I haven't been home to test the code but I did look through it and it looks superb... I can't really explain how much I appreciate the help, though. I hate to sound like a pest on here but making Isaac for this game was an idea I just couldn't accept to not have polished the way I thought it of. Without getting too dramatic, I thank you for your help. The more time I spend staring at .lua, especially example code like yours (and others that have provided), the more likely I'm able to learn it as well. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601721 Share on other sites More sharing options...
DarkXero Posted January 14, 2015 Share Posted January 14, 2015 I tried it myself, I hope it works for you. I could have corrected Crazyfear but I feel separating the perks and keeping the firebug structure will help you understand. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601725 Share on other sites More sharing options...
Electroflux Posted January 14, 2015 Author Share Posted January 14, 2015 Okay, I just tested it, but my character has a major problem. He just stands there and shakes viciously. I can't move or do anything. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601853 Share on other sites More sharing options...
DarkXero Posted January 14, 2015 Share Posted January 14, 2015 (edited) Yeah, weird. That didn't happen to me. I will look into it. EDIT: Found the issue, download and replace. beastbug.lua Edited January 14, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601854 Share on other sites More sharing options...
Electroflux Posted January 14, 2015 Author Share Posted January 14, 2015 It works! Beastmode functions exactly like I expect it to. I might actually increase the sanity at which it goes off since the intervals are so long. Either way, I cannot thank you enough man. I added your name to the changelog. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-601857 Share on other sites More sharing options...
DarkXero Posted January 14, 2015 Share Posted January 14, 2015 No worries, I don't need my name anywhere, all code I post is free to abuse. Link to comment https://forums.kleientertainment.com/forums/topic/48994-perk-issues-mathematical-issues/#findComment-602012 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