Jump to content

Custom Perks Help for Character


Recommended Posts

I'm working on my first few character mods and already completed the base steps for each character creation (used the ESC tutorials on youtube and other various sites and completed a dummy character). I'm just stuck on the custom perks as I don't know how to code anything.

 

These are the perks I'm trying to make for a few characters:

 

- Slower sanity loss rate, and no sanity loss when around another player

- Gain attack speed and movement speed when near a mob, mobs also less likely to target you

- Get 3x the amount of an item from chores (farming/picking, mining, chopping, etc.)

- Lose hunger slower

- Small health regen ability

- Weapons and tools degrade slower / weapons deal slightly more damage

- When health is below a certain number, sanity loss is increased

- Aura that grants nearby players sanity

- Own sanity increases when near another player

- Major sanity loss when alone for a certain amount of time

- Aura that heals nearby players

- Damage multiplier when surrounded by multiple mobs

- Damage multiplier when near another player

- Rain prevents hunger loss / rain has no effect on player

- Won't freeze or get cold in the winter

- Major hunger and sanity loss during the summer - umbrella lowers the loss rate

- Recover all stats at increased rate when sleeping and don't lose hunger when sleeping, decreased movement speed for 1 minute after waking up

- Cooked food lasts longer in inventory

- Picking up spoiled food restores its degradation

- Self healing when near another player

- Major sanity loss when in the darkness/nighttime

- When any stat gets below a certain threshold, immediately fall asleep until stats are back to a certain number

- Increased damage from all mobs

 

I know this is a lot to ask for, but any help would be appreciated! Thank you!

Link to comment
Share on other sites

This is A LOT of work. Some are simple, but some require more special behavior :confused:

Usually on the forum we deal with specific questions on how to do something funky, and I can only answer for myself here, but I don't like to code people's mods for them. It's a lot of time to invest into someone else's idea, because it's never as simple as it sounds when it comes to code. This would be many days of work and debugging :shock:

On another note, if you intend on putting the mods on the workshop, it will be best if you have some idea of what's going on, so you can fix bugs without having to wait for days for a reply on the forum. I strongly suggest that you take a look at my newcomer post and start learning how to code LUA. It's fun when you get into it, and you sound like you're already invested in making the mods :) There are thousands of character mods on the workshop to investigate, and many, many threads on this forum from which you can draw knowledge. Many of the things you want to do have been done before in other character mods, and some have been solved on this forum. It's either that, or finding some coder to actually join your project, or lucking out that there's a person on the forum who has nothing else to do.

I wish you godspeed and a lot of luck with your project. I'll help in any way I can, but not with a wall of tasks ;)

Link to comment
Share on other sites

5 hours ago, kyuuren said:

I'm working on my first few character mods and already completed the base steps for each character creation (used the ESC tutorials on youtube and other various sites and completed a dummy character). I'm just stuck on the custom perks as I don't know how to code anything.

 

These are the perks I'm trying to make for a few characters:

 

- Slower sanity loss rate, and no sanity loss when around another player

- Gain attack speed and movement speed when near a mob, mobs also less likely to target you

- Get 3x the amount of an item from chores (farming/picking, mining, chopping, etc.)

- Lose hunger slower

- Small health regen ability

- Weapons and tools degrade slower / weapons deal slightly more damage

- When health is below a certain number, sanity loss is increased

- Aura that grants nearby players sanity

- Own sanity increases when near another player

- Major sanity loss when alone for a certain amount of time

- Aura that heals nearby players

- Damage multiplier when surrounded by multiple mobs

- Damage multiplier when near another player

- Rain prevents hunger loss / rain has no effect on player

- Won't freeze or get cold in the winter

- Major hunger and sanity loss during the summer - umbrella lowers the loss rate

- Recover all stats at increased rate when sleeping and don't lose hunger when sleeping, decreased movement speed for 1 minute after waking up

- Cooked food lasts longer in inventory

- Picking up spoiled food restores its degradation

- Self healing when near another player

- Major sanity loss when in the darkness/nighttime

- When any stat gets below a certain threshold, immediately fall asleep until stats are back to a certain number

- Increased damage from all mobs

 

I know this is a lot to ask for, but any help would be appreciated! Thank you!

alot of these can be done with no knowledge. Just think what monster or player already has one of these effects.

Then go in scripts/prefabs/ and find the thing's LUA file and explore how its done

Link to comment
Share on other sites

2 hours ago, Ultroman said:

This is A LOT of work. Some are simple, but some require more special behavior :confused:

Usually on the forum we deal with specific questions on how to do something funky, and I can only answer for myself here, but I don't like to code people's mods for them. It's a lot of time to invest into someone else's idea, because it's never as simple as it sounds when it comes to code. This would be many days of work and debugging :shock:

On another note, if you intend on putting the mods on the workshop, it will be best if you have some idea of what's going on, so you can fix bugs without having to wait for days for a reply on the forum. I strongly suggest that you take a look at my newcomer post and start learning how to code LUA. It's fun when you get into it, and you sound like you're already invested in making the mods :) There are thousands of character mods on the workshop to investigate, and many, many threads on this forum from which you can draw knowledge. Many of the things you want to do have been done before in other character mods, and some have been solved on this forum. It's either that, or finding some coder to actually join your project, or lucking out that there's a person on the forum who has nothing else to do.

I wish you godspeed and a lot of luck with your project. I'll help in any way I can, but not with a wall of tasks ;)

Thanks for the response! Yeah I realized after I had posted that it's a very long list.

I was kinda hoping that someone out there compiled a list of a bunch of "already thought of" perk codes.

I will definitely be taking a look at your post, as I'm really excited to start making characters, and will be searching around the forum more thoroughly.

Edited by kyuuren
Link to comment
Share on other sites

8 minutes ago, kyuuren said:

Thanks for the response! Yeah I realized after I had posted that it's a very long list.

I was kinda hoping that someone out there compiled a list of a bunch of "already thought of" perk codes.

I will definitely be taking a look at your post, as I have I'm really excited to start making characters, and will be searching around the forum more thoroughly.

That's the spirit :D I really hoped you wouldn't be put down by my wording. It's difficult to write such things without sounding like a complete jackass. When you can't have intonation and facial expressions, those conversations can easily be misunderstood. It sounds like you got my true meaning, though. If you're really excited about your characters, I'm sure you can find the necessary pull to get you through the kind of initially steep learning curve of LUA. Just trust me on this when I say that there is light at the end of the tunnel, and the tunnel is shorter than it looks xD

As Hell-met said, many of your perks are easy enough to implement. Get yourself through the first LUA Crash Course, and take a look at the small example mods in my post. They don't do much, but they'll show you where things are supposed to be, and how the structure of things work. Try finding simple character mods and just see how they're built. I promise you, it will save you time. Code doesn't respond well to hammering along with no idea what you're doing. Take it slow. Get one simple thing to work first. Use the print-statements to ensure that your code is doing what you think it should be doing. Then do the next thing.

When you get to it, I think you should look at these perks first:

  • Lose hunger slower
  • When health is below a certain number, sanity loss is increased
  • Major sanity loss when alone for a certain amount of time
  • Major sanity loss when in the darkness/nighttime
  • Increased damage from all mobs
  • Self healing when near another player
  • Own sanity increases when near another player (look at this post; it gives a sanity boost when close to bees; just change "bee" to "player" and "INLIMBO" to "INLIMBO", "playerghost", and change the code to add health instead of sanity (just ask me when you've given it a try))
  • Aura that heals nearby players (the reverse of the above, but you can use the same foundation)
Link to comment
Share on other sites

12 minutes ago, Ultroman said:

That's the spirit :D I really hoped you wouldn't be put down by my wording. It's difficult to write such things without sounding like a complete jackass. When you can't have intonation and facial expressions, those conversations can easily be misunderstood. It sounds like you got my true meaning, though. If you're really excited about your characters, I'm sure you can find the necessary pull to get you through the kind of initially steep learning curve of LUA. Just trust me on this when I say that there is light at the end of the tunnel, and the tunnel is shorter than it looks xD

As Hell-met said, many of your perks are easy enough to implement. Get yourself through the first LUA Crash Course, and take a look at the small example mods in my post. They don't do much, but they'll show you where things are supposed to be, and how the structure of things work. Try finding simple character mods and just see how they're built. I promise you, it will save you time. Code doesn't respond well to hammering along with no idea what you're doing. Take it slow. Get one simple thing to work first. Use the print-statements to ensure that your code is doing what you think it should be doing. Then do the next thing.

When you get to it, I think you should look at these perks first:

  • Lose hunger slower
  • When health is below a certain number, sanity loss is increased
  • Major sanity loss when alone for a certain amount of time
  • Major sanity loss when in the darkness/nighttime
  • Increased damage from all mobs
  • Self healing when near another player
  • Own sanity increases when near another player (look at this post; it gives a sanity boost when close to bees; just change "bee" to "player" and "INLIMBO" to "INLIMBO", "playerghost", and change the code to add health instead of sanity (just ask me when you've given it a try))
  • Aura that heals nearby players (the reverse of the above, but you can use the same foundation)

You're fine. I got what you were saying before :D.

This is my first time doing anything like this and my vision is shooting passed my knowledge at the moment. I've tried taking a look at a bunch of the custom characters in the Steam workshop, but only found a few with perks that I really want.

Of the list, it's made up of 4 characters, so I want to start with my first character, which would have these perks (I also don't know if it's possible to add multiple strings to one perk, like having one perk do multiple things - but that would be great if it can):

  • Calm Presence
    • Aura that grants sanity to nearby players
    • Own sanity increases when near other players (I saw your link and I will take a look at that)
  • Healing Factor
    • Passive self healing
  • Strategist
    • Bonus damage when near another player
    • Double bonus damage when alone
  • Winter Lover
    • Won't get cold or freeze

Weaknesses:

  • Overheat
    • Double sanity and hunger loss in the summer
    • Umbrella can be used to slow the loss
  • Loneliness
    • Double sanity loss when alone for a certain amount of time

 

I guess I'd like to start here if these are possible. I will eventually continue and finish the other perks as well that you have suggested.

Link to comment
Share on other sites

1 hour ago, kyuuren said:

Loneliness

  • Double sanity loss when alone for a certain amount of time

 

I’ve honestly been searching for the opposite of this xDD I’m making an antisocial character who loses sanity when there’s more than 2 players around aside from her and the character she’s crushing on, but gains sanity when around said character without many people.

 

... I’m too ashamed that my mind thought up that last bit up to even say who it is. Either way, I’ll try to reverse the code when it’s revealed and go through from what I’ve seen in forums with sanity drains to tinker around! It might not work since I’m really new to this, but if it does, I’ll put up the recipe for an introvert that has to have as little group contact as possible or else she’ll have a nervous breakdown and be mauled by invisible shadow aberrations. 

Edited by MetaGiga
A word
Link to comment
Share on other sites

2 hours ago, kyuuren said:
  • Strategist
    • Bonus damage when near another player
    • Double bonus damage when alone
  • Overheat
    • Umbrella can be used to slow the loss

I would do these last. They require a bit of knowledge about how damage works, or how to hook up custom functions to the inventory system.

The basics of damage multipliers are: the player has a base-damage used when no weapon is equipped. When dealing damage with a weapon, the weapon knows how much damage it does, and can be multiplied by modifiers on the player. There is a damage multiplier, but I think the one that's a variable might be modified by some things in the game, so messing with that directly is probably not good. There is, however, an "external damage modifier" system with which you can add and remove labelled multipliers at will. You should take a look at that. I know I've helped others with something similar on the forum, so when you've done the other ones, search for external damage modifiers and you should find something.

We've also done the cannot freeze thing not too long ago. That has to do with insulation.

Passive self healing is super easy.

All the ones where something has to happen with all players within a range and the ones depending on how many players are within range, can be done using a single FindEntities call (like with the bees) and then count the players, do whatever you want with them (@MetaGiga: or identify their prefab names to do your love-thing). Assuming the radius for these effects are the same. For each radius, you'll need a separate FindEntities call (or use the widest one and manually check distances).

You don't have to look for characters to investigate that actually do exactly what you want. The reason why I said to find some simple ones, was so you could see how a simple one with some simple perks was set up. It gets complicated and confusing really fast if you don't know the syntax well and are not used to coding. Like this or this or this or this.

Link to comment
Share on other sites

6 hours ago, Ultroman said:

All the ones where something has to happen with all players within a range and the ones depending on how many players are within range, can be done using a single FindEntities call (like with the bees) and then count the players, do whatever you want with them (@MetaGiga: or identify their prefab names to do your love-thing)

This is a huge help, but I’m still ashamed of my cringe decision. Thanks!

Link to comment
Share on other sites

13 hours ago, Ultroman said:
  • Own sanity increases when near another player (look at this post; it gives a sanity boost when close to bees; just change "bee" to "player" and "INLIMBO" to "INLIMBO", "playerghost", and change the code to add health instead of sanity (just ask me when you've given it a try))

So I've taken a look at this link, and I think I'm starting to understand it more.

Questiosn:

When a line is built like this:

-- *Sentence or instruction

This doesn't actually affect the coding right? It's just instructions or a description? And then everything below it would be the actual coding?

 

-- *Sentence

    value = (value)

The "value" would be the actual functionality for the code?

 

-- *Sentence

    Value = (value)

    end

     -- *Sentence

          Value = (value)

     -- *Sentence

         Value = (value)

end)

When there's multiple indents within a code, is that like adding multiple functions to one perk?

 

In theory, the "description" type sentences used after "--" are not required and you can write a code like this?:

Value = (value)

    value = (value)

    end

   Value = (value)

end)

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...