Korvus17 Posted September 20, 2022 Share Posted September 20, 2022 I need help making an custom item that will resurrect you like a tell tale heart. The idea is that I'm making a necromancer character. Among other things, he is able to resurrect players with ease compared to the other survivors. The only problem is that I have no idea where to find the code to make a Item that resurrects players and I don't see anything when I searched for it. I'm probably missing something simple but I am also a little new to LUA so I don't entirely know how everything works. any help is GREATLY appreciated. Thanks for reading. Link to comment https://forums.kleientertainment.com/forums/topic/143319-need-help-creating-resurrecting-item/ Share on other sites More sharing options...
Somnei Posted September 20, 2022 Share Posted September 20, 2022 3 hours ago, Korvus17 said: I need help making an custom item that will resurrect you like a tell tale heart. The idea is that I'm making a necromancer character. Among other things, he is able to resurrect players with ease compared to the other survivors. The only problem is that I have no idea where to find the code to make a Item that resurrects players and I don't see anything when I searched for it. I'm probably missing something simple but I am also a little new to LUA so I don't entirely know how everything works. any help is GREATLY appreciated. Thanks for reading. Hi! I did some searching for you and found some functions and files that may be of interest. The telltale heart in-game is called "reviver". In scripts/componentactions.lua (around row 1067) they insert the "givetoplayer" action into the table of possible actions (search for "reviver" in case you can't find it). This is one of the things that enables you to use the heart on a ghost in the first place. There are several functions in scripts/components/playercontroller.lua that may be interesting, search for revive and reviver here. Scripts/components/revivablecorpse.lua may also be of interest. In case you want to implement your feature in the same way as the telltale heart (by giving an item) I think you need to look at what items can be accepted by the ghost as well (scripts/prefabs/ghost.lua). There is also a ShouldAcceotItem within scripts/prefabs/player_common.lua that specifically accepts the reviver. The DoActualRez function within scripts/prefabs/player_common_extensions.lua looks like it has a lot of great things as well. Would def look at this. What I did to find this information was simply look up the prefab name of the item in question on the wiki and then did a search through all the files in the scripts folder for the prefab name. I am using Visual Code, which enables you to search through the files in the currently opened folder. I don't know much about Don't Starve Together modding, but thought I'd at least give a hand with finding relevant files since you said you couldn't find anything about resurrection in the code. Hope it helps, and good luck! 1 Link to comment https://forums.kleientertainment.com/forums/topic/143319-need-help-creating-resurrecting-item/#findComment-1598999 Share on other sites More sharing options...
Korvus17 Posted September 20, 2022 Author Share Posted September 20, 2022 4 hours ago, Somnei said: Hi! I did some searching for you and found some functions and files that may be of interest. The telltale heart in-game is called "reviver". In scripts/componentactions.lua (around row 1067) they insert the "givetoplayer" action into the table of possible actions (search for "reviver" in case you can't find it). This is one of the things that enables you to use the heart on a ghost in the first place. There are several functions in scripts/components/playercontroller.lua that may be interesting, search for revive and reviver here. Scripts/components/revivablecorpse.lua may also be of interest. In case you want to implement your feature in the same way as the telltale heart (by giving an item) I think you need to look at what items can be accepted by the ghost as well (scripts/prefabs/ghost.lua). There is also a ShouldAcceotItem within scripts/prefabs/player_common.lua that specifically accepts the reviver. The DoActualRez function within scripts/prefabs/player_common_extensions.lua looks like it has a lot of great things as well. Would def look at this. What I did to find this information was simply look up the prefab name of the item in question on the wiki and then did a search through all the files in the scripts folder for the prefab name. I am using Visual Code, which enables you to search through the files in the currently opened folder. I don't know much about Don't Starve Together modding, but thought I'd at least give a hand with finding relevant files since you said you couldn't find anything about resurrection in the code. Hope it helps, and good luck! Thank you so much for this!, Actual legend! Link to comment https://forums.kleientertainment.com/forums/topic/143319-need-help-creating-resurrecting-item/#findComment-1599033 Share on other sites More sharing options...
Somnei Posted September 20, 2022 Share Posted September 20, 2022 44 minutes ago, Korvus17 said: Thank you so much for this!, Actual legend! No worries! Good luck with the modding Link to comment https://forums.kleientertainment.com/forums/topic/143319-need-help-creating-resurrecting-item/#findComment-1599037 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