Jump to content

Recommended Posts

Okay quick introduction: After having almost 200 hours into DST and playing around with some character mods, I came to the conclusion that it's hard to find a very balanced character mod with art that fits well with the DST environment. And instead of the assholes that harass the modders for making their own things that THEY like, i decided i want to learn how to make mods myself. If you want something done right do it yourself i guess. so for the last week or so i have been teaching myself how to read Lua, and some of the mods other people have already made, and what the in-game contents are. it's like playing Sudoku in hard mode, i know just enough information that given enough time i could figure out this puzzle. 

Now for some questions. I've been looking around in the prefab list and other season things. but i'm not sure what the Base character temperature is, or how it's affected. [iE Character mod White: by Lukasai and ShiroCAT, has "inst.components.temperature.mintemp = 5.1"] what's 5.1 in relation to? i was thinking of making a character with a perk/disadvantage of having a lower temperature so that winter is a bit harder, but summer is a bit easier. 

If anyone is willing to take some time and teach me a few thing or maybe even collab with me, i have some interesting ideas for some characters, if you're interested please let me know. 

Making a character prefab requires the function MakePlayerCharacter, from player_common.lua.

In this function, an entity is created and returned.

 

The base characteristics of any character are set up one at a time after a inst:AddComponent("x").

In temperature's case, inst:AddComponent("temperature").

 

AddComponent creates a new class temperature that is unique to the entity, that player.

If we go to components/temperature.lua, we can see the basic parameters on construction and the functions it has.

 

One parameter is mintemp.

The default value is in the tuning.lua file. It's -20.

 

If you trace the appearance of that mintemp, you will notice that when editing the current temperature value, that mintemp decides whether or not allow the temperature to go down that value.

 

How is this important? Well, reading more the code in general, you will notice that when setting the new temperature, if the new temperature goes below 0, then your character starts freezing.

 

-20 < 0, so we can have current temperatures below 0, we would freeze.

5.1 > 0, so we can't have temps below 0.

 

My advice: read mods, write simple stuff.

After noticing short links and interactions between code in one same file, you will be able to grow and track down relationships and events that go through 4 files. I smashed my head against the keyboard for 2 months before grasping anything.

@CtrlShiftZZ,

easiest template for making a character:

http://forums.kleientertainment.com/topic/46849-tutorial-using-extended-sample-character-template/

tutorial for a lot of stuff in DS, much of it also applies to DST.

http://forums.kleientertainment.com/topic/28021-getting-started-guides-tutorials-and-examples/

DST tutorials, much of it builds on the DS tutorials:

http://forums.kleientertainment.com/topic/47353-guide-getting-started-with-modding-dst-and-some-general-tips-for-ds-as-well/

really good general tutorial to understand programming:

https://www.khanacademy.org/computing/computer-programming/programming/drawing-basics/p/intro-to-drawing#

at least watch the introvideo of each section and then jump to the next section, or jump right to the later sections on functions and stuff, if u already got the basics

Edited by Seiai

@DarkXero, Thanks, i think some of it makes enough sense, or as time goes by i'll figure more out. my main question now that i have for you is that, where do i find these temp/component.Lua and tuning.lua files you're talking about that tells me about temperature and stuff? (sorry for newbie question)

@Seiai, Thanks, but i've already long read and used all of those the first day i got into this. trust me, i've already spent a good 20+ hours learning what i could from basic tutorials and templates that are lying around. when i get my mind into things i like to try my best i what i can do before i ask people for help. my questions and issues now are more specific, or in prefabs i don't know how to access to know what lines to write to get the necessary results i seek. 

 

Right now i'm trying to work on a Beekeeper model character, with a perk of getting sanity from being around bees, so i've been looking at the base Bee file in DST, the pigmen (since they give sanity auras), willow/willow fire (also for the sanity aura) as cross references to see what lines of code i should be using/editing to get the desired results. So again, i am doing what i can from what basic tutaorials have taught me so far, but now i'm knee deep in writing lua that i'm getting lost now XD Also wanted to add the perk of being able to build bee boxes at half teh cost, kidna like some of the current character mods that are more generalized, like Wilmore by SpicerXD & Taroso; and Christoph the Carpenter by Crito815. but they have a more general code for building cost .5 for everything, or for wood related items. so i'm not sure how to go about making a specific item like the beebox into the .5 cost only, and not everything else.

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