Jump to content

[HELP] Perk creation request.


Recommended Posts

Hello DST modders,

 

I have a character mod that I have been working on for a while now, and I have gotten to a point where I am almost ready to release it to the public. I've compiled all of my assets together, completely customized the default speech file, and the voice I gave to my mod is almost set to be completed.

 

However, I am not a coder. As far as making perks goes, I can only rework VERY simple things like modifying the base stats and modifying the values of simple things such as speed or attack. The only perks that I have been able to create for my character so far is giving out some starting items and a resistance to damage caused by freezing.

 

Because I know diddly-squat about coding in general, I was hoping if someone could help me in creating a custom perk that I hope I can add to my character. I don't really like asking for help much, and I usually don't until I have exhausted all the ways I could get something to function, but I feel like this is a situation where asking the modding community will be faster than trying to spend some days learning Lua and fiddling with the code until I get something to function.

 

If you're willing to lend me a hand, the perk I had in mind for my character is something along the lines of:

 

-1.5 damage multiplier when character is taking freeze damage

-1.2 speed multiplier when character is taking freeze damage

 

I'm still playtesting my mod with a couple of friends to see if I could balance out any stats, which goes along with the buffs my character will get when freezing.

 

Also, I was wondering if it is simple enough to make it so that any followers a character recruits (pigmen are the only mob I can think off the top of my head) could have more health and do more damage than the typical recruitee from any other character. I also had a charismatic perk idea in the back of my mind, but like my request, I wouldn't know how to get that to work either.

 

Anyways, I appreciate any and all help I recieve, and thank you for taking the time to listen to my requests!

Link to comment
Share on other sites

-1.5 damage multiplier when character is taking freeze damage

-1.2 speed multiplier when character is taking freeze damage

 In your character's master_postinit:
local function frozenBuff(inst, enable)    inst.components.combat.damagemultiplier = enable and 1.5 or 1    inst.components.locomotor:SetExternalSpeedMultiplier(inst, "frozenbuff", enable and 1.2 or 1)endinst:ListenForEvent("startfreezing", function() frozenBuff(inst, true) end)inst:ListenForEvent("stopfreezing", function() frozenBuff(inst, false) end)
Also, I was wondering if it is simple enough to make it so that any followers a character recruits (pigmen are the only mob I can think off the top of my head) could have more health and do more damage than the typical recruitee from any other character.
Hmm... Again in the master_postinit:
local OldAddFollower = inst.components.leader.AddFollowerinst.components.leader.AddFollower = function(self, follower, ...)    OldAddFollower(self, follower, ...)    if follower.components.combat then        follower.components.combat.damagemultiplier = 1.25    end    if follower.components.health then        --if you're using vanilla instead of RoG, use SetAbsorbAmount instead        follower.components.health:SetAbsorptionAmount(0.25)     endendlocal OldRemoveFollower = inst.components.leader.RemoveFollowerinst.components.leader.RemoveFollower = function(self, follower, ...)    OldRemoveFollower(self, follower, ...)    if follower.components.combat then        follower.components.combat.damagemultiplier = 1    end    if follower.components.health then        --if you're using vanilla instead of RoG, use SetAbsorbAmount instead        follower.components.health:SetAbsorptionAmount(0)     endend
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...