hey folks! as more and more of you are joining the modding ranks, it seemed fitting to provide a starting point to answer some of the more basic questions floating around…
below is an initial list comprised primarily of questions from @RepeatPan and @sdee… this is a first pass however, and the format may be adjusted a bit over time… we will of course supplement the FAQ as more material presents itself…
we’ll leave the thread open, so feel free to pose any suggestions you may have (in q&a format, of course )… please refrain from posing general modding questions here though…
Stonehearth Modding FAQ:
Q. Are there any “primers” on modding Stonehearth?
A. Yes. You can read this post which introduces the mixinto and override concepts, or this post which discusses the entity/component framework.
You can also try downloading the startermod_basic mod from the stonehearth github repository. Read the Readme and get started! GitHub - stonehearth/startermod_basic: A most basic starter mod to get you going!
Q. Where are my Stonehearth files located?
A. Steam: C:\Program Files (x86)\Steam\SteamApps\common\Stonehearth
A. Humble Bundle: C:\Program Files (x86)\Stonehearth
Q. How do I extract the .smod files?
A. They’re zip files. You can use any zipping program, such as 7z, WinRAR, etc.
Q. Can I work with my extracted mod folder?
A. Yes. Note that Stonehearth will prefer smod files over folders though - if you have a folder named my_mod
and an smod named my_mod.smod
, it will always load my_mod.smod
and ignore your folder!
Q. How can I create .smod files?
A. Simply zip them using any zip program and change their extension to “.smod”.
Q. What are luac files? How can I open them?
A. luac are compiled lua files. To convert them into readable lua again, you need something like unluac. This is fairly complex however, and there are tools to help this process [TODO: link to @Xavion’s tool, perhaps?]
Q. Where are my settings stored?
A. user_settings.json
.
Q. Can I view debugging information?
A. Yes. Set set enable_debug_keys
to true in your user_settings.json
file.
Q. How can I reduce my loading time? / How can I create a smaller world?
A: Try adding this to your user_settings.json:
"mods" : {
"stonehearth" : {
"world_generation" : {
"method" : "tiny"
}
}
},
Q: What exactly, is a mixinto?
A: A mixinto lets you inject additional content into an existing .json file. (.json data files hold almost all of Stonehearth’s mutable gameplay parameters) The easiest use for this is to replace values defined in existing json.
The more complicated (less documented, stable, and supported) use case is to add wholly new content to existing .json files. (This is dangerous because the format of those json files is not yet finalized, so the section you’ve modified may change or go missing.)
Q: What, exactly, is an override?
A: An override lets you replace any file in the game with another file. Use to replace assets with other assets. If you use this to replace code files with other code files, Team Radiant is not responsible for the results, or the mantainability of the edits going forward.
Q: Can you use mixintos to modify a .json array?
A: Yes. The modifications are added to the top of the array, though this may change in the future.
Q: How do I know what files are possible json targets for mixintos, and how do I reference them? Should I use their alias, or filename, or what?
A: See this post
Q: Will you replace the term “mixinto” with “extension”?
A: Maybe. If we do, it will just by a syntax change
Q: What does file(…) do?
A: file(…) is a shortcut that makes it “easier” to declare filepaths in json.
- First, it appends the mod directory to the path in the parenthesis. As @RepeatPan mentions,
file(/foo)
is equal to/my_mod/foo
- file() can also be used to append the path to the current directory:
file(mystuff.json)
is equivalent to/my_mod/path/path1/path2/mystuff.json
- Finally, if the path inside a file() statement ends with a folder, and not a file with an extension, it will automatically append a file of the similar name.json to the path. For example,
file(/stuff)
becomes/my_mod/stuff/stuff.json
Q: Can I get trees to drop wool?
A: Yes! The resource_node determines what is dropped by a tree or plan when it is permanently harvested. Change the inside a tree.json (like, oak_tree.json) change the resource from stonehearth:oak_log to stonehearth:wool_bundle:
"stonehearth:resource_node": {
"resource": "stonehearth:wool_bundle",
"durability": 20
}
Q: Can you use mixintos for html code?
A: No
Q: Can I mod in-progress features?
A: You are completely free to use our (Radiant’s) stuff, with one caveat. That is, you can use any item that is in the game, or any playable feature – but we ask that you not modify or otherwise use unreleased features or content. We know that in some cases code for an unreleased feature may be present in a given release, though in a dormant state. Please wait until something is official and playable before, um, playing with it. You don’t need to ask us for permission to use our stuff… but we’d appreciate a credit when you let your creation loose upon the world.