Mirrorrabbit Posted January 17, 2015 Share Posted January 17, 2015 Once again I return in seek of aid, and thankfully managed for bit. However now I'm facing a major issue. I've already figured out mostly, how to input powers as my character now has presets that gives him certain stats and effects. But now I can't figure out how to give him his actual power, which is to gain increased effects based off what he eats. I've tried to look into eater.lua or edible.lua to no avail. So unfortunately I've hit a brick wall so far. And as far as audio goes, I wanted to make a customized audio for my character. However since I don't have the actual instrument. I was wondering if it was acceptable to tailor the singular notes from videos of that instrument to sound like how Don't Starve characters speak. I'm not sure where else I could manage to get alternative sounds from that's why. Link to comment Share on other sites More sharing options...
Blueberrys Posted January 26, 2015 Share Posted January 26, 2015 gain increased effects based off what he eatsHave you looked into wx78's files? I believe his character is designed to upgrade when eating gears.Hint: Look at the functions oneat and applyupgrades in "..\scripts\prefabs\wx78.lua".And line 172:inst.components.eater:SetOnEatFn(oneat) I was wondering if it was acceptable to tailor the singular notes from videos of that instrument Notice on using other's work."Mods containing assets from other games or media are not allowed" But if you find media with the CC licence (or similar), with permission for derivatives, it probably won't be a problem.Remember to read the terms and provide attribution if required.Don't take my word for it though, I have no authority to provide permission in doing so, I'm only providing the information. Link to comment Share on other sites More sharing options...
Corrosive Posted January 26, 2015 Share Posted January 26, 2015 I may or may not be able to help you with the audio issue, if you show me some clips of what kind of sounds you're looking for. Link to comment Share on other sites More sharing options...
Mirrorrabbit Posted February 8, 2015 Author Share Posted February 8, 2015 @blueberrys Oh yes I get what you mean, but I think I worded it wrong sorry. I was looking for the effect of what he eats, as in gaining Health and Sanity from eating food in general. An attempt was made with fiddling with Wickerbottom's files, but I couldn't figure it out sadly.@Corrosive That'd be pretty cool! Although for now I'll have to hold onto the offer for another time. Although I already know I want to either make his voice an Accordion or Harmonica, I'm thinking of posting him first before anything else to get reviews on what I'm doing right and wrong. Link to comment Share on other sites More sharing options...
MidrealmDM Posted February 8, 2015 Share Posted February 8, 2015 And as far as audio goes, I wanted to make a customized audio for my character. However since I don't have the actual instrument. I was wondering if it was acceptable to tailor the singular notes from videos of that instrument to sound like how Don't Starve characters speak. I'm not sure where else I could manage to get alternative sounds from that's why.There are several web site that offer free sound samples. https://www.freesound.org/ Link to comment Share on other sites More sharing options...
Blueberrys Posted February 8, 2015 Share Posted February 8, 2015 @Mirrorrabbit, if you're looking to do anything special with eating, the OnEatFn will probably work for you. See the eater component ("..\scripts\components\eater.lua") for more information. Link to comment Share on other sites More sharing options...
Mirrorrabbit Posted February 8, 2015 Author Share Posted February 8, 2015 @blueberrys Sort of? I'm looking at it, and tried to tweak at it a bit more. Basically what I'm aiming for is to simply multiply the effect of food by two. So say carrots heal 1Health and restores 15Hunger. I want to make it so it'll be 2Health and restores 30Hunger instead. Perhaps I need to just make a new .lua file, since I dont see how I can do this without editing other main ones, but for the time being what I decided to shove in the 'powers sections' as my attempts are as following: Attempt1: -- inst.components.eater.oneatfn = VEGGIES[name].health*2 -- inst.components.eater.oneatfn = VEGGIES[name].hunger*2 -- inst.components.eater.oneatfn = VEGGIES[name].sanity*2 or 0 Attempt2:-- inst.components.edible.healthvalue = VEGGIES[name].health*2 -- inst.components.edible.hungervalue = VEGGIES[name].hunger*2 -- inst.components.edible.sanityvalue = VEGGIES[name].sanity*2 or 0 Current Attempt:-- inst.components.eater:SetOnEatFn(VEGGIES[name].hunger*2) I'm probably going about this all wrong, but I'll have to look at it with fresh eyes later. Link to comment Share on other sites More sharing options...
Blueberrys Posted February 8, 2015 Share Posted February 8, 2015 Basically what I'm aiming for is to simply multiply the effect of food by two.debugman18 did the exact same thing here. It only implements the hunger, but the concept is the same. You can add these for health and sanity too.inst.components.eater:SetOnEatFn(function(inst, food) local hunger = food.components.edible.hungervalue inst.components.hunger:DoDelta(hunger) local health = food.components.edible.healthvalue inst.components.health:DoDelta(health) local sanity = food.components.edible.sanityvalue inst.components.sanity:DoDelta(sanity)end)Theoretical code, untested. Link to comment Share on other sites More sharing options...
Mirrorrabbit Posted February 9, 2015 Author Share Posted February 9, 2015 @blueberrys Oh dang, well I guess it'll be unfortunate that our powers collide a bit :S. But thank you! It seems to work just like I needed to, so I can fix the speed issue. I guess I should be looking around more threads. Anywho I think that was the last of the coding issues, thanks so much for your help guys! Winsley'll finally be able to be up and running properly. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.