Jump to content

[HELP] Need some help with character perks!


Recommended Posts

Hello there!

 

Before we begin this, let me be clear: I'm awful with coding, watched some tutorials but I just can't understand how lua works, I'm more of an artist rather than a programmer.

I have the basic standard character all setup, I really need help with the coding

 

So, what I'm trying to do is kind of simple:

 

More damage with the axe

Regenerate some sanity after killing (anything, from a butterfly to a tall bird)

When sanity lower than 30%, damage multiplier by x1.2
 

If anyone could tell me how to do those things, or try to teach me how to program them, I would really appreciate!

 

Thanks for reading!

Link to comment
Share on other sites

please excuse the fact that I'm not actually giving you any code I don't have Don't Starve or Don't Starve Together installed to my PC atm (just upgraded to Windows 10 which is an awesome operating system!) so I can't list off any of the events or functions that'd be used for this off the top of my head

 

"More damage with the axe"

there are 3 ways you can go about this!

1 make a postinit to all axes that detects the owner and changes based on that (which is rather messy and not the best way to go about it)

2 make it so that your character detects when they have any axe equipped and increase the damage based on that (which is still messy but better than the last suggestion)

3 make a brand new axe specific to your character that does more damage

 

"Regenerate some sanity after killing (anything, from a butterfly to a tall bird)"

there are 2 ways you can go about this

simple way: track for kills and add a random amount of sanity or different amount of sanity based on what you have killed

difficult way: set up a system that changes your character's dapperness values based on what they've recently killed

 

"When sanity lower than 30%, damage multiplier by x1.2"

this is the most simple of all of them!

inst.SanThreshBroke = falseinst:DoPeriodicTask(5, function()    if inst.components.sanity.current <= 50 and inst.SanThreshBroke == false then        inst.components.combat.damagemultiplier = 1.2        inst.SanThreshBroke = true    else        inst.components.combat.damagemultiplier = 1        inst.SanThreshBroke = false    endend)
Link to comment
Share on other sites

 

please excuse the fact that I'm not actually giving you any code I don't have Don't Starve or Don't Starve Together installed to my PC atm (just upgraded to Windows 10 which is an awesome operating system!) so I can't list off any of the events or functions that'd be used for this off the top of my head

 

"More damage with the axe"

there are 3 ways you can go about this!

1 make a postinit to all axes that detects the owner and changes based on that (which is rather messy and not the best way to go about it)

2 make it so that your character detects when they have any axe equipped and increase the damage based on that (which is still messy but better than the last suggestion)

3 make a brand new axe specific to your character that does more damage

 

"Regenerate some sanity after killing (anything, from a butterfly to a tall bird)"

there are 2 ways you can go about this

simple way: track for kills and add a random amount of sanity or different amount of sanity based on what you have killed

difficult way: set up a system that changes your character's dapperness values based on what they've recently killed

 

"When sanity lower than 30%, damage multiplier by x1.2"

this is the most simple of all of them!

inst.SanThreshBroke = falseinst:DoPeriodicTask(5, function()    if inst.components.sanity.current <= 50 and inst.SanThreshBroke == false then        inst.components.combat.damagemultiplier = 1.2        inst.SanThreshBroke = true    else        inst.components.combat.damagemultiplier = 1        inst.SanThreshBroke = false    endend)

 

Hey, thanks for answering so fast! 

 

About the axe, I guess we will take option 2, seems to be worth the trouble. We still gonna need some help programming that, but we will try something

 

About the sanity regeneration, we will take the easy way, we will research e little more about how making those things

 

And THANKS A LOT for writing all the script for us, really appreciated! 

We may still need to figure out where to put it, but still, thanks!

Link to comment
Share on other sites

  • Developer

Hey, thanks for answering so fast!

About the axe, I guess we will take option 2, seems to be worth the trouble. We still gonna need some help programming that, but we will try something

About the sanity regeneration, we will take the easy way, we will research e little more about how making those things

And THANKS A LOT for writing all the script for us, really appreciated!

We may still need to figure out where to put it, but still, thanks!

I'm bretty sure 3 goes in your character's prefab.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...