Jump to content

Recommended Posts

as the title says, i want to start modding DST, and as part of that, adding a character into DST, who would be able to craft his own item, which would essentially be a telltale heart, being able to revive survivors, with drawbacks.

checking out the telltale_heart lua file, i dont really understand it, and was thinking of just copying the code to said custom item, or would that mess something up? or would it make me harder to make my own drawbacks to using said custom item? would making my own code be much easier?

9 hours ago, helobirb said:

as the title says, i want to start modding DST, and as part of that, adding a character into DST, who would be able to craft his own item, which would essentially be a telltale heart, being able to revive survivors, with drawbacks.

checking out the telltale_heart lua file, i dont really understand it, and was thinking of just copying the code to said custom item, or would that mess something up? or would it make me harder to make my own drawbacks to using said custom item? would making my own code be much easier?

It depends on what you want it to do. If you want it to work similarly to what's already in the game, meaning someone has to give it to you to revive you, then it would be wise to copy the code as long as you know what each thing does. If it's an item that you drop upon death and can be revived by possessing it, I think it's better to create it from scratch because I don't think you'll need many lines of code for that. Finally, if you want to make something similar to the Minecraft totem, it would be best to create it from scratch since there are many things you must control. If your idea is the latter, let me tell you that, from what I've seen in the code, it's not as simple as the other two, but I think it may be possible. Likewise, before opting for the latter, you should have a little more experience making mods, since starting out can be a reckless undertaking.

13 hours ago, FerniFrenito said:

It depends on what you want it to do. If you want it to work similarly to what's already in the game, meaning someone has to give it to you to revive you, then it would be wise to copy the code as long as you know what each thing does. If it's an item that you drop upon death and can be revived by possessing it, I think it's better to create it from scratch because I don't think you'll need many lines of code for that. Finally, if you want to make something similar to the Minecraft totem, it would be best to create it from scratch since there are many things you must control. If your idea is the latter, let me tell you that, from what I've seen in the code, it's not as simple as the other two, but I think it may be possible. Likewise, before opting for the latter, you should have a little more experience making mods, since starting out can be a reckless undertaking.

im thinking something like the telltale heart, however instead of the draw back being a percentage of your hp locked away, it would take about 10 HP before taking 10 more hp about every few minutes? like a poisoned mechanic, would that be much more simpler to code in? along with it's own antidote to go with it

1 hour ago, helobirb said:

im thinking something like the telltale heart, however instead of the draw back being a percentage of your hp locked away, it would take about 10 HP before taking 10 more hp about every few minutes? like a poisoned mechanic, would that be much more simpler to code in? along with it's own antidote to go with it

It's not difficult to program; in fact, it's quite simple. I recommend checking out the mod code Campfire Respawn to learn how to revive by haunting objects. Additionally, to set the 10hp damage, you can use the DoPeriodicTask(time, fn, initialdelay) function. This applies to EntityScript, and the character itself is one, so you can apply it.

If you get stuck on something or want me to give you the code directly, just let me know, but I think it would be better if you tried it yourself.

Edited by FerniFrenito

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
×
  • Create New...