Jump to content

Recommended Posts

First of all... Hello! I'm making my very first mods. I apologize if I do anything wrong or ask things that where already answered.

I will try to ask as many things as I can and I invite others to ask stuff for their own mods. There are so many questions out there... all alone. Maybe by asking together we can help each other out?

:confused: Ok here I go.

1. How do you combine 2 mods in a single folder. (Character+Item)

2. How do I add a stack of something to a starting inventory?

I place ["fireflies", ] but it only gives 1 item. I want a full stack.

3.How do you code color?

inst.Light:SetColour(197/255,197/255,50/255) <- Like how do I change those numbers so it means blue?

4. I want to make a lamp. I truly have no idea how but I will try to learn by seeing how the ingame lamps work. So if you got any tips besides "[Tutorial] Creating a "handslot-equippable-item" from scratch" they are welcome.

5. Can someone share their DLC speech scripts with me? Or is it illegal or something? Like I want my mod to have quotes from RoG so it's compatible but I only own the main game. I can just rewrite them one by one, but I wanted to fill in stuff with quotes from others. But it's not that important.

Thank you for reading. :)

Edited by OpalKittens

I'm just as new to Don't Starve modding as you are, but I can help you with question 3.

You have 3 arguments in the function "SetColour". Those 3 arguments are Red, Green and Blue. 255 is the highest number, and 0 is the lowest. Thus the number you put in is something out of 255.

If you want a completely blue color you want Red and Green to be 0 and Blue to be 255.

inst.Light:SetColour(0/255, 0/255, 255/255)

You can read more about this way of coloring by looking up RGB coloring.

1. They don't have to be separate at all! I'm not sure what you mean, please elaborate.

2. One option would be to invent a prefab that is actually just a spawning script for what you want (Example to come).

3. Asked and answered. Arguments are, as FlawlessHair said, RGB.

4. The tutorial you referenced is (in my opinion) the best there is. Working with both it and the examples from the normal game, you should easily be able to accomplish this.

5. IDK. Ask @PeterA perhaps?

 

Example file for spawning your stuff:

local function fn()
	local inst = SpawnPrefab("fireflies")
	inst.components.stackable:SetStackSize(40)

	return inst
end

return Prefab("common/inventoryitems/fortyfireflies", fn)

Then just put that in a file ('scripts/prefabs/fortyfireflies.lua' for example) and add that file's name to the 'PrefabFiles' list in 'modmain.lua'. Using the prefab in your starting inventory should then give you the desired result.

1. Let's say I have a Character mod and an item mod and need them in the same mod pack. What is the proper file structure for both mods to exist together? I now have a small idea of what to do. Place all prefabs together. Place all images together.

It's like having a cat and dog. They are different but do you store their food in the same pantry and their toys in the same box? Or do I separate them?

You said they shouldn't be so I assume it's merging file structures. Do I make sense? In short words I think I get it. Just wanted to be really sure

2 & 4. I'm a very very slow and anxious learner. I'm sure my fear of messing up will make sure I can learn all these prefabs and coding. I better continue studying the game components. :)

Thanks for the sample!

5. I think I'll just write the thousand lines manually. It will be more painful but creative.

A character is created by defining a prefab for the character and then specifying that it is a character ('AddModCharacter()'). Any other prefab is created in pretty much the same way. Just add your definition file's name to 'PrefabFiles' and it will be added.

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