Jump to content

(Need Help, personal power + audio)


Recommended Posts

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

gain increased effects based off what he eats

Have 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

@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

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

@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

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

@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

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.

×
  • Create New...