Lvl14Potato Posted January 16, 2017 Share Posted January 16, 2017 I need help coding traits for my custom character. I would like him to be able to: 1. As a sort of either or situation the player can make, have more movement speed if his health falls to 30 or below if he doesn't have a weapon wielded at the cost of sanity or if he has a weapon and can receive a damage boost when his health falls to 30 or below (with a small defense bonus if that's possible) 2. Do more damage to all boss monsters (not much more than normal, but just a bit more). The main problem is that I don't know the coding for any of these traits. Any help is appreciated. I had made a post about this a long time ago. I looked over what replies were there, but I still don't understand what to do. Link to comment Share on other sites More sharing options...
That_1Guy Posted January 18, 2017 Share Posted January 18, 2017 I'm not sure how to correctly conditionally trigger these traits, but to go faster you can paste this into your character's .lua inst.components.locomotor.walkspeed = 4 inst.components.locomotor.runspeed = 6 (default values), change as needed and for attack multiplier (although not specifically toward bosses) inst.components.combat.damagemultiplier = 1 (change value as needed) Link to comment Share on other sites More sharing options...
Lvl14Potato Posted January 18, 2017 Author Share Posted January 18, 2017 Thanks for the coding. Worst case scenario, I can just reword what the traits will do in the final product. Link to comment Share on other sites More sharing options...
Lvl14Potato Posted January 18, 2017 Author Share Posted January 18, 2017 Just as a side note, would you happen to know how to code in a starting item? I would like my character to start with a life-giving amulet. Link to comment Share on other sites More sharing options...
thefrostbite Posted January 18, 2017 Share Posted January 18, 2017 Do you want the amulet wearable? Link to comment Share on other sites More sharing options...
That_1Guy Posted January 18, 2017 Share Posted January 18, 2017 local start_inv = {"itemgoeshere",} Link to comment Share on other sites More sharing options...
Lvl14Potato Posted January 19, 2017 Author Share Posted January 19, 2017 I tried it, but my character didn't spawn with it. Also yes, I would like the amulet to be wearable and function like normal. Link to comment Share on other sites More sharing options...
Lvl14Potato Posted January 20, 2017 Author Share Posted January 20, 2017 Never mind. I got it to work. Thank you so much for your help. That was the last step for me to finish my mod! 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.