Maybe my english is just to bad to fully understand how these commands work.
If theres is a good How To i would appreciate lining it to me or correct me if im wrong
aliases:
aliases are for my mod only they don`t enter the original aliases in the stonehearth manifest and are not referred to from the original code
correct ?
overrides:
overrides overwriite a whole file in the stonehearth.smod with the file i give in to it
correct ?
mixintos:
I thought mixintos add some command lines to an existing .json but IĀ“m not sure if i understood that correctly.
Example
(After i dropped the snowhare project, i thought of something āeasierā)
I`m trieing to add the āfineā crafted stone_chair
i copied the stone chair files,
changed every path into stone_chair_fine (same as in the castle_door example)
added an aliases in my manifest to refer to the furniture:stone_chair:fine (like the carpenter furniture names)
checked that there`s a chance of having āfineā craftet masonry work in mason_desription.json
tried to āmixintosā a command line in the original āstone_chair.jsonā to refer to my furniture:stone_chair:fine
but the only error i get is
there`s no aliases in furniture for stone_chair:fine
So please explain these commands to me and lead me out of the darkness i`m in
Aliases are for your mod only, so while a base game alias would be, for example, stonehearth:category:item, yours would be YourMod:category:item. They are entered in āmods/yourMod/manifest.jsonā
Correct! Overrides replace data from other jsons with whatever is in your json.
Mixintos mix your code into existing jsons. Itās recommended to use mixintos when modding, as overrides change the code in the base game. Basically a mixinto contains the parts of the json youād like to change with the values youād like to add/modify.
For your example, could you maybe post your mixinto and manifest code here?
I might not be able to help you, but its worth a look. The more apt coders here would definitely be able to help!
before i post my mod commands i got a new question about mixinto
How can i add the following single line into the stone_chair_recipe
"fine":āfurniture:stone_chair:fineā
this is the example from the comfy_chair
{
ātypeā:ārecipeā,
āwork_unitsā : 3,
ārecipe_nameā : āComfy Chairā,
ādescriptionā : āIts padded seat guarantees a 98% reducion in awkward splinters!ā,
āflavorā : āIf pillows are good for the head, surely theyāre even better for the butt and back!ā,
āportraitā : ā/stonehearth/entities/furniture/comfy_chair/comfy_chair.pngā,
ālevel_requirementā : 2,
āingredientsā: [
{
āuriā : āstonehearth:furniture:simple_wooden_chairā,
ācountā : 1
},
{
āmaterialā : ācloth resourceā,
ācountā : 1
}
],
āproducesā: [
{
āitemā:āstonehearth:furniture:comfy_chairā,
āfineā:āstonehearth:furniture:comfy_chair:fineā
}
]
}
the problem is, if i repeat a single line of the json a lua error occurs.
I tried it like this
{
āfineā:āfurniture:stone_chair:fineā
}
But no effect and no error.
@phector2004
about the manifest
im trieing a workaround with a mixinto into the original manifest with my aliases. Theres no error code in the log files maybe it works can`t tell by now
json is a markup language like html. When you want to mixinto a new tag:value pair, you have to nest it in the same way as you intend it to be nested in the final file. Your code is placing the information in the wrong place in the file.
When using an alias, you also need to include the name of your mod at the front. I wrote āyourmodhereā, but that should be whatever you named your mod. An alias always starts with the name of the mod it is in. This is why in the code from the comfy chair, it uses āstonehearth:furniture:comfy_chairā and not āfurniture:comfy_chairā.
@Tuhalu
that was my first thought and i tried it but you get this lua error in return
2015-Jun-21 17:55:46.723836 | client | 0 | lua.code | std::logic_error: 'data mode object 2being registered twice.'
because of the double āproducesā in the code
Hmm. I checked it out myself and there seems to be some kind of bug there. If you do it how I wrote before, you get the error you describe (and it wonāt load). If you use the following, it runs, but when you craft a stone chair, it produces two stone chairs a time (although sometimes youāll get a fine version on one of the chairs after level 3).
@Froggyās Stonehearth Cafe does almost the exact same thing with a mixinto to a āā : [] style command. He adds new crop types with it. It is really strange that it fails here.
the stonehearth cafe mod (which is great) is mostly stand alone (i read it for hours now) and is referencing 99% to itself so there are no problems
but the stone chair (and the rabbitā¦see my other topic) is referring to the stonehearth original code and often to the lua scripts
i just try to work it out and not using overrides
@Tuhalu
interesting normally it should produce a stone_chair after checking the chance of producing fine
(checking crafter_component.luac line103)
Ok adding my aliases to the stonehearth manifest isn`t working if i understand this right
(and the stone chair is always referring to the original manifest)
lua.code | ā Script Error (lua) Begin -------------------------------
2015-Jun-21 19:09:21.186328 | server | 0 | lua.code | std::exception: āāstonehearthā has no alias named āfurniture:stone_chair:fineā in the manifest.ā
and as often its the create_entity function in
radiant/models/entities.luac
but my lua knowledge is very little so i can`t figure it out why
I hope Iām understanding correctly: You shouldnāt be trying to mix your aliases into the āstonehearthā manifest. Your mod has its own manifest in its main folder. This will automatically be loaded when you run the game, and its where you should put all of your aliases.
The reason youāre getting that error is because āstonehearthā the gameās main āmodā doesnāt have your item in it. Youāll be better off adding your item to your modās manifest and leaving the base game files untouched.
Have your previous mods worked? As a suggestion, @honestabelink had put a nice tutorial up a few months ago. If you havenāt made a mod before, it can show you how to add a basic item, from which point you can tinker and find out how to make it a āfineā item:
Youāre having mostly problems when trying to mix your items with existing stonehearth items.
I tried the other day to add the critters (as I have ones) but I didnāt see them being trapped despite setting several trappers and lots of large trapping areas. After a couple of in-game days, some of my critters should have been trapped, but I only saw the current existing critters. Maybe thereās something wrong with the code.