BraveChicken

[Tutorial] Making basic character perks (DS, RoG, SW)

Recommended Posts

Siletrea    18

you my friend are a gem!

this is absolutely fantastic! I wish this was made a few years back honestly! but I'm just so happy its here now! I'm positive this will get oodles of views once hamlet comes out for all the new mods!

fantastic work!

  • Like 1

Share this post


Link to post
Share on other sites
axxel    281

Thanks :). But could you tidy up a bit? I mean you can use spoiler or create a table of contents for Ctrl-F navigation.

Share this post


Link to post
Share on other sites
BraveChicken    25
8 hours ago, axxel said:

you can use spoiler or create a table of contents for Ctrl-F navigation

I actually did try to do that due to the fact that this tutorial is soooo looong. ^-^; (I actually am new to klei forums .... and... forums in general, so I'm still kinda learning how these things work XD) But I'm guessing that maybe I did something wrong, because it didn't want to work the way it should  o,o;
I guess I can give it another try XD

And there is a table of contents at the very top.  (I guess I can try to simple it down a bit more  o,o)

Hopefully I'll manage to make it better. :p 
Thanks for the input though! ^-^

 

  • Thanks 1

Share this post


Link to post
Share on other sites
K1NGT1GER609    105

Nice work, a lot of code in the forums become lost overtime (I mean 226 pages? and the search engine is limited to 30+ second penalty per search!) and heck some of the code I post is lost even when I look at my profile for previous posts.

  • Like 1

Share this post


Link to post
Share on other sites
BraveChicken    25
Posted (edited)
13 hours ago, RudyAmericanHero said:

is there a way to use certain items like lucy or wes's balloons or abigail's flower?

Yes, there is. But if you want to give your character the ability to start/use those items then you would need to modify them in your mod, and remove from them the "characterspecific" component. (This component is used to make an item bounded only to 1 specified character)
If you want to do that, then you will need to look into the game's prefab files (in the main don't starve folder, go to data >> scripts >> prefabs) Then you will need to look for the prefab file that you want to modify and copy-paste it into your mod's folder. after you do that simply open the copy of the file that you just made and remove from it the lines:

     inst:AddComponent("characterspecific")
    inst.components.characterspecific:SetOwner("woodie")

or turn them off by simply placing a " -- " in front of them like that:

    --inst:AddComponent("characterspecific")
    --inst.components.characterspecific:SetOwner("woodie")

In Abigail's flower file you also will need to look for the line:

     if not GetPlayer() or GetPlayer().prefab ~= "wendy" then inst:Remove() end 

and for Wes's ballons the line:

     inst:DoTaskInTime(0, function() if not GetPlayer() or GetPlayer().prefab ~= "wes" then inst:Remove() end end)

and remove it/turn it off as this keeps an eye on the character's prefab file and removes the item if it isn't wendy/wes.

Then head to your modmain.lua and add your modified file to the PrefabFiles = { } section along with the prefab file of your character. So it should look something like that:

     PrefabFiles = { "YourCharacterHere", "lucy" }

Then of course you can either create a custom recipe to craft those items or simply make your character start with that item (You can find in the tutorial how to do both of those so you can pick whichever you like) :p 

Edited by BraveChicken

Share this post


Link to post
Share on other sites

sorry, I realized maybe this thread is for dont starve only, I found out in of the sections, where I wanna increase my character's ability at night, there's a GetClock() function that is not been recognized by the system. I figured it might have to do with the DS and DST. I wonder if I am right, if yes what is the correct function name to use in this example? Thanks!!

Share this post


Link to post
Share on other sites
BraveChicken    25
10 hours ago, ricky_loves_cat said:

there's a GetClock() function that is not been recognized by the system. I figured it might have to do with the DS and DST. I wonder if I am right, if yes what is the correct function name to use in this example? Thanks!

If you are working on a DST mod, then yes, there are differences in coding between the "normal" DS and the DST. I would gladly help you if I could, but sadly I do not have DST to even be aware of the coding differences that would need to be made there. However, you may want to ask for help in the DST mods and tools forum section, as I'm sure you'll manage to find someone to help you there. I'm sorry that I can't be of more help.

Edited by BraveChicken

Share this post


Link to post
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