Gorevus Posted October 18, 2015 Share Posted October 18, 2015 I've been working on a character mod for DST. I have the art and dialogue all finished, and it seems to work well. I want to add a few perks though, and I just can't figure out how to code it. I tried looking at a few coding tutorials and referencing other lines of code, but I just can't get anything to work. I want her to lose 10 health when she eats a veggie, and I want her speed and damage to increase to 1.25 when her sanity goes lower than 0.2. This seems so simple to me, but I just can't get anything to work. Can anyone help me out? Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/ Share on other sites More sharing options...
Gorevus Posted October 18, 2015 Author Share Posted October 18, 2015 I should include my most recent attempt. Does my code need some tweaks, or is it completely wrong? Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681062 Share on other sites More sharing options...
xTheFallenOnesx Posted October 18, 2015 Share Posted October 18, 2015 I don't really know anything about modding and all that, need help with my own mod and such. But from what I'm reading, Maybe it doesn't like the > Sign. I don't know really just what it seems like to me. Hope you get help soon! Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681074 Share on other sites More sharing options...
Gorevus Posted October 18, 2015 Author Share Posted October 18, 2015 Thanks, and good luck with yours. Hm, that's strange. I've seen it work in other peoples mods, so I guess I just didn't do it right. One other problem I have, is with the hat mod ive been making. I thought it was finally finished, but I get this error Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681085 Share on other sites More sharing options...
Blueberrys Posted October 18, 2015 Share Posted October 18, 2015 (edited) @Gorevus It's the colon.Incorrect:inst.components.sanity:current > 20Correct:inst.components.sanity.current > 20Edit: Also, check out your log, it's quite useful. Edited October 18, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681089 Share on other sites More sharing options...
Gorevus Posted October 18, 2015 Author Share Posted October 18, 2015 Thanks Blue! That helped a lot. I was eventually able to get that item working in the game I even got the food thing working. There's still one problem, the low sanity doesn't seem to be doing anything. It doesn't crash the game at least. How I was able to get the food thing to work, is I added this,Now I assume I could copy that, change 'eater' to sanityfn, maybe 'oneat' could be changed to 'inst'. But what do I change 'SetOnEatfn' to? Or am I going in the wrong direction? Thanks again for your help! Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681276 Share on other sites More sharing options...
xTheFallenOnesx Posted October 18, 2015 Share Posted October 18, 2015 (edited) I had an issue with the movement speed before as well, Is there another thing like this? (Maybe this counts for sanity stuff as well?) --Revived from human/Movement Speed base: 4,6local function onbecamehuman(inst) -- Set speed when loading or reviving from ghost (optional) inst.components.locomotor.walkspeed = 7.5 inst.components.locomotor.runspeed = 7.5endThere might be another code interferring with your movement speed stuff so it takes priority over one and not the other. This one is just when the characters loads, into the world or into a cave or something. I think i removed the other code i tried adding in and now i move faster. Edited October 18, 2015 by xTheFallenOnesx Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681289 Share on other sites More sharing options...
Gorevus Posted October 19, 2015 Author Share Posted October 19, 2015 Thanks for the suggestion. I did have that, but I didn't notice a difference after I removed it. My damage multiplier also doesn't seem to be working either. Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681313 Share on other sites More sharing options...
xTheFallenOnesx Posted October 19, 2015 Share Posted October 19, 2015 I just went in and edited the default combat multiplier to 50, The code looks the same and i could two shot a beefalo with my fists. It looks fine to me, perhaps there is something in the code you created that is making the entire thing null and void? Wish i was of more help x3This is in my character.lua under the master_postinit-- Damage multiplier (optional) inst.components.combat.damagemultiplier = 50 --TUNING.WENDY_DAMAGE_MULT Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681324 Share on other sites More sharing options...
Gorevus Posted October 19, 2015 Author Share Posted October 19, 2015 I got it working! Thank you for all the help! Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681341 Share on other sites More sharing options...
xTheFallenOnesx Posted October 19, 2015 Share Posted October 19, 2015 Oh i helped? : o maybe. congrats and stuffles. Link to comment https://forums.kleientertainment.com/forums/topic/58567-need-help-coding-a-few-simple-perks/#findComment-681351 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