AstonishingAlex Posted August 6, 2015 Share Posted August 6, 2015 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 axeRegenerate 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 More sharing options...
Fidooop Posted August 7, 2015 Share Posted August 7, 2015 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 thissimple way: track for kills and add a random amount of sanity or different amount of sanity based on what you have killeddifficult 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 More sharing options...
AstonishingAlex Posted August 7, 2015 Author Share Posted August 7, 2015 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 thissimple way: track for kills and add a random amount of sanity or different amount of sanity based on what you have killeddifficult 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 More sharing options...
Developer ImDaMisterL Posted August 7, 2015 Developer Share Posted August 7, 2015 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 somethingAbout the sanity regeneration, we will take the easy way, we will research e little more about how making those thingsAnd 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 More sharing options...
AstonishingAlex Posted August 7, 2015 Author Share Posted August 7, 2015 I'm bretty sure 3 goes in your character's prefab. Hmm yes, but for some reason, it ain't working... Link to comment Share on other sites More sharing options...
AstonishingAlex Posted August 7, 2015 Author Share Posted August 7, 2015 Hmm yes, but for some reason, it ain't working... Nvm guys, I got it working, so, again, THANKS A LOT!!! Link to comment 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