Jump to content

My modding questions thread-where I will put my questions.


Recommended Posts

Alright.

I decided that it would be a good idea to keep my questions in one thread, so I don't lose them.

This thread is not just for my benefit, I intend for other modders to draw inspiration from it as well.

 

So, now for the questions.

 

A) Is it possible to implement an additional background stat similar to naughtiness? What about one that decreases/increases over time?

 

B) Can I call an event such as: monster spawning, change of season, lightning strike, naughtiness/background stat increase when something is crafted?

 

C) Can pig strings be changed if a certain event happens?

 

D) Is there a way to make the character become paralyzed temporarily?

 

E) How to make my custom character a carnivore?(ANSWERED)

LINK TO POST

 

F) How to add the spider hat effect to a custom character without a spiderhat?(ANSWERED)

LINK TO POST   Note: In this post, I fumbled around with the concept of using tags to make spiders not hostile to me. There is a useful bit of code which I used to tweak a prefab at some point in the mod's development that may be useful to others.

 

G) How to make a character not be slowed down by webs? AKA how to make a character run on webs?

Nots: This stumped me, as I looked at turfs.lua, locomotor.lua, spider.lua, and several other prefabs and stuff and did not figure out anything. When I asked a question on the "Modders, Your Friend At Klei" thread, I was suggested to change move speed, but....that would make the character faster when not on a web...

 

E) How can I change prefabs of existing game files without overwriting?

 

 

When answering, please state the letters of the questions you are answering.

For ease of use, I will occasionally select the best answer(s) to a question and put it in a spoiler or just add a link to the post.

 

Best answers (so far) by Squeek:

 

Why not study game files?

A) see components/kramped.lua
B) see components/builder.lua's DoBuild function. You can listen for the "builditem" or "buildstructure" event on the player, or, if it's a custom item that's being crafted, you can use the OnBuilt function of the prefab.
C) STRINGS.PIG_TALK_FOLLOWWILSON = {"Changed strings"}
D) see stategraphs/SGwilson.lua's "frozen" state

 
Link to comment
Share on other sites

Okay...thank you for the insightful explanation. Any mods that do something like the described behaviors that I can study?

Why not study game files?

A) see components/kramped.lua

B) see components/builder.lua's DoBuild function. You can listen for the "builditem" or "buildstructure" event on the player, or, if it's a custom item that's being crafted, you can use the OnBuilt function of the prefab.

C) STRINGS.PIG_TALK_FOLLOWWILSON = {"Changed strings"}

D) see stategraphs/SGwilson.lua's "frozen" state

Link to comment
Share on other sites

G) See LocoMotor:UpdateGroundSpeedMultiplier in components/locomotor.lua. Changing the player's locomotor component's slowmultiplier variable to 1 should remove the slowness on creep (webs).

E) AddPrefabPostInit. See the API Examples mod.

Link to comment
Share on other sites

Yeah, look, the rules around here are 'ask few and to-the-point questions if you want anything answered' and 'respect those who answer them since no one is obliged to educate others - particularly those who aren't exhausting the resources in the sticky'd threads first to find the answers'.

 

It's not that it's personal or anything, it's that the mod-forum rules specify as much and it's iterated in the forum guidelines that inundating others with inquiries is unconstructive since 1) most of the time the information will only be situationally helpful which will lead to more inquiries, and 2) the experts around here are few and fair, and are almost-all working on their own projects that they are doing on the side of whatever their busy lives encompass.

 

I understand how alienating modding is in Don't Starve, but you really do have to put in the time and effort if you want to make anything. I'm currently in this position, so I know how it feels. I always do as much research as I can into questions I'm going to ask so that people like squeek can give me fast and easy answers that don't make them regret ever participating.

 

squeek is a particularly generous person so, for everyone's sake here, please don't stretch their patience. ;p

Link to comment
Share on other sites

Yeah, look, the rules around here are 'ask few and to-the-point questions if you want anything answered' and 'respect those who answer them since no one is obliged to educate others - particularly those who aren't exhausting the resources in the sticky'd threads first to find the answers'.

 

It's not that it's personal or anything, it's that the mod-forum rules specify as much and it's iterated in the forum guidelines that inundating others with inquiries is unconstructive since 1) most of the time the information will only be situationally helpful which will lead to more inquiries, and 2) the experts around here are few and fair, and are almost-all working on their own projects that they are doing on the side of whatever their busy lives encompass.

 

I understand how alienating modding is in Don't Starve, but you really do have to put in the time and effort if you want to make anything. I'm currently in this position, so I know how it feels. I always do as much research as I can into questions I'm going to ask so that people like squeek can give me fast and easy answers that don't make them regret ever participating.

 

squeek is a particularly generous person so, for everyone's sake here, please don't stretch their patience. ;p

Now that you point that out, this does seem kinda...douchey? I dunno.

I went back to studying the game code and other mods, so from now on, this thread will be for just stuff that I HAVE NO CLUE about. Squeek has been helpful. But anyway, some of these questions are kinda just reiterations of some old ones where the answers given to me were not clear. And I know that bugging for attention to a question in multiple threads is not gonna make me any new friends.

Link to comment
Share on other sites

That's the spirit. I only ask questions when I literally have no means to find the answer or the answer is a single, tiny bit of code that I know the experienced here can come up with in under 10 seconds. Anything else and it's just me being lazy. ^_^

 

Good luck with your mod, by the way. Looking forward to it. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...