Charlotte's Questions and Weird Issues

Figured I’d make a general Q thread as I am sure I’ll keep having questions. Today’s weird issue… I made a sunflower and then decided to test it in game before working further on it. In the process I managed to make changes in the “wrong” folder and therefore used that to replace the folder I already had under mods. Which was stupid of course, as I saved a faulty version over a working version. When I had finally sorted out all my own errors I’m still stuck with a new problem: Neither of the two items in this mod folder can be placed on land - the game claims that something is in the way. Surprisingly I CAN place them in some places right along the waters edge.

So again, anyone got any clues as to what’s going on?

Not going to be a lot of help - sounds like in the moving around of files, something changed?

It sounds like an offset isn’t set right or a collider setting. Again it might be best to start again and go through and double check.

Also restarting the game and starting on a fresh game save can help at times.

Thanks Roo. Might be a collider setting, most of the other stuff should be relatively straight forward and worked before, but I might have changed that when I saved over the old file. As for restarting the game, I now tend to do that between every test… :stuck_out_tongue:

Edit: Tried reducing the size of the collider boxes and making sure the center is high enough, and now they work :slight_smile:

Today I went through the furniture.json file making notes of various parameters and stuff, to get a feel of what things can be done and how to do them. And some things I don’t know what they do or how they work, so, I’m going to try to put my confusion into some hopefully comprehensible questions…

  1. DimensionsX and dimensionsZ: As far as I can tell this determines where the centre of the object ends up in relation to the grid in game… So dimensionsX = 1, means a small item in the middle of the square, whereas 2 would mean a wider item where the middle ends up on the gridline between two squares. Not sure if it has any other significance? I’ve seen it set to both 0 and 3, but if the position is all that’s affected, 1 and 2 ought to be all you need (although using 3 for a very wide object or 0 for a narrow one, might feel logical).

  2. I previously mentioned working on a sunflower. Now I’m thinking it ought to be dead in winter. So I’ve looked at the seasonal stuff and growing plants and such. But there are several things I’m wondering about here.

  • For instance there seems to be things with multiple models that has a modelCount of 1. I think I saw one item with 2. What exactly is counted???
  • Then there’s objectsToConfigure. Am I correct in guessing that the object names are defined inside the blender file? So if I make a plant and call something leaf and something flower (in Blender), then those are the names I’ll give (in the .json) if I want to change the leaves or flowers during different seasons?
  • If I want to make something look snowy in winter (or match an existing in game item for that matter) is there a way to reference existing in game materials so that the mod asset bundle then works without having to duplicate (or just try to mimic) something that already exists?
  • Are there any naming conventions involved in making several models for an item? (I know there are for walls, but not so sure if there is for any item that say gets snowy in winter - I don’t think I saw anything to this effect when I went through that file, but it’s late and my head’s muddled now :stuck_out_tongue: )

I think that’ll have to do. Anything else, I’ll have to ask when I get to it. Or when my brain’s awake, or something. :slight_smile:

If anyone has the time to go through these questions and try to explain to me, I’m very grateful.

Sorry, been busy. Will post tomorrow if Daniel doesn’t catch up in-between.
Hopefully not holding you up too much :smiley:

  1. yes, dimensions are only important for the center. It’s meant to roughly correspond to collider size but in practice it only matters if it’s even or odd.
  2. ModelCount: Plants can have different variations, the models just have a number at the end in this case
  3. yup, object names in the blend file.
  4. yup, check furniture.json to see what materials are already referenced. You can’t reference ingame materials that were not meant to be used for seasonal stuff though
  5. the “seasonalMaterials” config describes everything fully, so there is no hidden convention for seasonal stuff. If you want to make objects disappear in a certain season, use an empty string "" as material name
1 Like

I’m not entirely sure I get the modelCount thing, but will look into it later today, hopefully.
Meanwhile, I’ve made at least some progress (I think):

Not making much progress anymore, I’m afraid.
For one thing, I still don’t get the modelCount thingy (soil for tomatoes for instance has a modelCount of 1 but at least three different modelNames (Seed, Grown, Dead).

For another, inEarth obviously does not mean what I thought it did. I expected it to basically be an opposite to onlyInRoom, that is, for items that had to be placed outside. But no, I can still plant sunflowers on the floors. And hedges it turns out. Not a big issue, just confusing. I now have no idea what the “point” of inEarth is.

And finally, since it seemed easier to use the invisible texture trick, I combined my living sunflowers model with my dead sunflowers model and called one object group/collection living and the other one dead. Both appear in game. I then looked at example files in the modKit and figured maybe it’s the materials I need to name, rather than the items. So after much hassle with that (in spite of things being linked in Blender it seemed some bits and pieces were very reluctant to update and also it turned out that when I appened the dead model I somehow appended it both as a whole and as individual pieces which then had to be removed individually or everything went poof. I swear Blender has ghosts in it.) I could see the material names in Unity and apply the correct textures. But, both versions still show at the same time in game.

Not sure if the problem is with the naming in Blender or the .json file…

Including the bit from the json file in case that can help anyone help me with this… :roll_eyes:

“sunflowersChA”: {
“buildPanelSection”: “decoration”,
“requiredTech”: [“gardening”],
“costResources”: [“wood”],
“costCounts”: [5],
“wealth”: 0,
“beauty”: 3,
“inEarth”: true,
“seasonalDescription”: {
“objectsToConfigure”: [“living”, “dead”],
“springMaterials”: [“sunflower”, “”],
“summerMaterials”: [“sunflower”, “”],
“autumnMaterials”: [“sunflower”, “”],
“winterMaterials”: ["", “sunflowerDead”]
},
“needsUpdate”: true,
“collider”: {
“boxes”: [{
“center”: [0, 0.9, 0],
“size”: [0.8, 1.6, 0.8],
}],
“doesCharacterCollide”: false
},
“buildHeight”: 0,
//“constructionType”: “digging”,
“interactionTransforms”: [{“pos”:[-0.5,0.0,-0.5],“rot”:45.0},{“pos”:[0.5,0.0,0.5],“rot”:225.0},{“pos”:[0.0,0.0,-0.66],“rot”:0.0},{“pos”:[0.66,0.0,0.0],“rot”:-90.0},{“pos”:[-0.66,0.0,0.0],“rot”:90.0},{“pos”:[-0.5,0.0,0.5],“rot”:135},{“pos”:[0.0,0.0,0.66],“rot”:180.0},{“pos”:[0.5,0.0,-0.5],“rot”:-45}],
“modules”: {
“destroyable”: {
“maxHealth”: 5.0
},
},
},

I see.

  1. if I remember correctly, you can do something like setting the modelName to “sunflowerBlendFile”, modelCount to 2 and the game will look for the blend files “sunflowerBlendFile0” and “sunflowerBlendFile1”
  2. in order to make it not buildable on floors, you should modify it’s collision box to go below earth level. When you set inEarth: true, the game will let you place the objects even though it collides with the terrain
  3. the way you have configured it now, you have to objects in your blend file, one is called “living”, and the other is called “dead”. The “living model” will have the “sunflower” material during spring, summer, and fall, and the "dead model will have the “sunflowerDead” material during winter.

Maybe it’s useful to first try getting it to work with materials that are already ingame. The game might have trouble loading new seasonal materials, not sure.

1 Like
  1. Good to know. I still wouldn’t know how to link that to seasons, so I guess I’ll keep trying with the one model and seasonal textures.

  2. Oooh of course. So I wasn’t entirely wrong (and not entirely right :stuck_out_tongue: )

  3. I’ll try using the snow material and see if that changes anything. But if I want to share a mod that uses seasonal textures it’s going to be a bummer if everyone would encounter this issue just because the game doesn’t like new seasonal things :thinking:

I’ve tried using the snow material on the dead sunflowers and it displays fine - but as before, all year around :stuck_out_tongue: I suspect it’s something to do with the naming inside Blender but it beats me what it could be. I’ve tried various versions (using the name of separate meshes, like “leaf”, or the whole group, like Flower or “Living”, but nothing makes a difference and I’m not versed enough in the terminology to be able to google it, either…

So, I have left that behind for the moment. I started another plant and realised it would need to work in the same way… so I decided to try something entirely different. Would it be possible to make a ladder, taking up only one square in the room? YES. I surprised myself by making it work straight away. Just needed a wee bit of adjustment of the Blender model (placement - but I think I’ll make the model look sturdier too). The only issue is that we can’t place things in the category “stairs”… and there’s not really any other category in which it fits, either. :thinking:

(That said, I was planning to make a decorative only ladder to place on or against walls (lying down) so I guess it can be placed with them, in the decorations category after all…)

New problems! :grinning_face_with_smiling_eyes:

I have made three versions of yesterday’s ladder. I’m having some issues with placements, though. At first the collider boxes were too big (or oriented along the wrong axis…) but once I fixed that, they seem to overlap and still… not be in the way. It’s not like there’s no collider at all, just that they apparently can overlap when they shouldn’t. I guess I can fiddle with that on my own, though. (C)

However, my other issue is that the items’ placement need to be adjusted a bit. The ladder on the ground is too close to the wall and the ladder on the wall isn’t centred. The problem is that I have adjusted these things in Blender, let Unity read in the changes, made new asset bundles, moved them to the mod folder and restarted the game, several times, and nothing. They keep loading in the exact same spot as before. (A and B on the image)

Does anyone understand why, because I sure don’t…?
(I’ve had issues with having to adjust things in Blender before and while I’ve needed to move things backwards for them to end up farther forward in the game, at least they have moved…)

EDIT: Turns out that doesCharacterCollide was set to false on both the horisontal ladders… :woman_facepalming: - I thought I hadn’t changed that and the items definitely collided earlier, but I guess I must have changed it at some point… So, being unable to re-position items in Blender, remains…

So, while making a door, I realised that for any “name calling” to work, that item needs to be a single mesh and not a collection of meshes… So, I reduced my sunflowers to one mesh called living and one called dead and I can now make them disappear (with no texture), but instead of showing the correct texture when they ARE visible, they turn magenta.

Any clues as to what I’m doing wrong now?
And I still don’t know why the ladders won’t end up in the correct positions…

Magenta probably means the game can’t find the material. There’s a good chance an error is also in the log. Maybe the material hasn’t been baked with the model? Is it in the same folder?

Hm, about the repositioning I’m not sure. Make sure all transforms in blender are always applied. Besides that you can try not saving over the old asset, but deleting and recreating it, just in case.

Thanks for your reply.
For the sunflowers I have no fiddled with as many things as I can think of. I’ve made sure the materials in the Blender file are the same names as the materials later used in Unity but the only result I’m getting is this:
If I have the correct mesh names, the “invisible texture” will indeed be invisible and the one that should be visible will be magenta.
If I have the wrong mesh names the materials/textures display perfectly, but of course both meshes show at the same time.

And for the ladder, I tried applying transforms, I made it one single mesh (which usually doesn’t seem to be an issue for simple objects) and applied transforms again, and eventually I resaved it under a new name. The ladder with the new name was centred in game. I deleted the old save but changed the name back (I have three ladders and named them ladder01-03 respectively so I don’t really want them called 04 and 05 instead) and it is in the wrong place, again.

:frowning:

EDIT: I did not try baking the (sunflower) material yet - or rather, I haven’t finished trying. I’ve never needed it before and I’m having some trouble understanding the guides I’m finding on the subject…

Still haven’t figured how to go about baking the sunflowers…so I moved on to the next type of item and got stuck again…

Today I made my first wall. I looked at the tutorial, named accordingly, copied the code in the example json files and nothing’s working right.

First issue is a yellow error log message:

BoxColliders does not support negative scale or size.
The effective box size has been forced positive and is likely to give unexpected collision geometry.
If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path “GhostWall/GhostWallObject”
(Filename: Line: 0)

Even though “GhostWall” isn’t my object (I presume it has to do with the bluish unbuilt walls) I’ve been through ALL of my mods folders for any possible negative collider box sizes and there aren’t any. If this is a bug in the game code I have no idea why it’s only there when I try my wall out…

Second, is a red error message saying it cannot find model#. I had named my wall modelname0 (and 0Door, 0Window) and then the game complained it couldn’t find model1. So I changed the modelname to 1 instead of 0 and now it complains it cannot find modelname0. I’m pretty sure I’m not supposed to save three versions of every number in existence but I don’t know why it keeps looking for a different model number.

Also, when “building” this wall, I have finally managed to build ONE section. It takes the resources needed to build walls when I try, but nothing shows up (I guess because it can’t find it?). The only good thing today is that it actually worked to put a window on that one piece of wall. (Oh and I found the read/write enable check box on the model in Unity which seems to be needed for walls but nothing else so far?)

Oh and while I’m whining… I modelled my three bits of wall after the wall in the examples folder, as the models in old graphics are only the full walls and not the door and window versions. And it seems the wall used in the tutorial/example is the wrong proportions… Which means I have to make quite a few changes to my wall and the texture and possibly the UV mapping, and I sorely regret I didn’t just make it a simple box. I’ve not been having the best couple of days - hopefully I’ll manage to solve some of these issues soon or I fear I might just give up.

Ah, I can definitely help you with that!

  • the ghost wall error doesn’t matter. It’s Unity complaining, but there is no bug.

  • the “couldn’t find model#” is the actual issue here. if useNumberRepetition is true, the game expects wallModel0 and wallModel1 and will place both models after each other when making a wall. That’s useful for variety. usySymmetryRepetition only uses one wall model. The game will rotate every second wall by 180°.

  • floors always need floor0, floor1, floor2, and floor3. If they are the same model, just copy it, there is almost no performance impact. The reason is that many floors tile over 2 meters to make the tiling less apparent.

  • true, the read/write checkbox is necessary so the game can put holes in the walls for windows and doors.

  • hm, not sure about the proportions issue. However it’s always best to test the pipeline with a simple thing like a box or so and see if there are any issues.

@Montee on Discord has been doing quite a lot of modding. Not sure if she’s looked into seasonal materials and walls as well, but she might have some experience, too.

Thanks Daniel. I’m still hoping to not need Discord. I’m not sure why, but I don’t like it much.
You’ve sorted out yesterday’s issues, though. Ironically the “back side” of my wall is already a 180 degrees rotated version of the front side so it being rotated would make no difference… (Just a little bit in some of the texturing) - but knowing this I can make two similar models instead. I think. :stuck_out_tongue:

The example wall for a door goes from 1.75 to 2.3 meters but it seems in game doors and windows go to around 1.9 meters, so basically the lower part of the door model showed in the door opening.

Forget that last bit about the example door… I think there must have been something gone wrong somehow - I haven’t fixed the above mentioned issue but today everything looks fine. Somehow the wall must have hiccupped first time I managed to get one to be built and tested a door…

Also, while working on it, I just set the useNumberRepetition to false (and add the number into the name in the localization and construction files) and that works too (when turning the wall doesn’t make a difference). But the wall does look very repetitive so I definitely need to make a second one… :stuck_out_tongue:

Oh the joys of learning something new… :roll_eyes:

The wall was working, I managed to build one with several pieces, and then I added a second model, made all pieces read/write enabled, changed the names in the json files to not have a number at the end (like the example wall), set useNumberRepetition to true, and now it can’t find them. Again.

Where’s the pulling-my-hair emoji? Or one banging it’s head against a wall. That would do, too. :thinking: