STEAM GROUP
Forest Village Modding LiF:FVM
STEAM GROUP
Forest Village Modding LiF:FVM
8
IN-GAME
87
ONLINE
Founded
5 December, 2016
Language
English
Hourless 1 May, 2018 @ 5:03am
Simple reconfig
I have small problem. Wall's building area is dump.
So, maybe i should change it, i thought...simple line of code

So i started with 1 simple line for testing:
fv.core.Castle_wall.config.lengthCells = 2

It throws error and crashes the game...why?
< >
Showing 1-3 of 3 comments
cstoneburner 1 May, 2018 @ 9:01am 
Did you change it for all the upgraded versions too? They must be the same. Otherwise you are hitting the same issue with new parking algorithms that caused me to take my smaller building footprints mod to friends only.
Hourless 2 May, 2018 @ 7:46am 
It's working! Thanks :)
I thought that upgraded building's config include only new prefab + reconfig, so I never crossed the idea to check it :D

I have 2 more questions:

1. now i have:
fv.core.Castle_wall.config.lengthCells = 2
fv.core.Castle_wall.config.widthCells = 2
It works fine, but i dont like when something is doubled, so i tried:
fv.core.Castle_wall.config =
{
lengthCells = 2,
widthCells = 2}

Offcourse, crash etc. Is it possible to write it this way or the 1st way is the only one?

2. I was thinking about rotated 45degrees walls (already rotated, separate building)
I guess it should be done with matrix(), is there any simple example from game scripts? or some link to well written article?
MEGADORI 10 May, 2018 @ 7:54am 
For 1:
You can also do it with
fv.core.Castle_wall.config = {}
But then you have to write the whole table, not just the two lines, otherwise you are overwriting the complete building configuration to only contain the footprint size.
As this is not what you want to do - you want to only change the two values - you'll need to either stick to the first method (changing the two lines individually) or include the full config table. I would not recommend this because it's bound to cause problems when there are mods in the game that alter any other data in the config.

2. It's done by shearing on the x and z axis:

matrix for a model in its original size and no rotation:
1 0 0 0 1 0 0 0 1 x y z

matrix for a model in its original size and rotated 90 degrees:
0 0 1 0 1 0 -1 0 0 x y z

matrix for a model in its original size and rotated -90 degrees:
0 0 -1 0 1 0 1 0 0 x y z

But if you just want to rotate, and not change the size, why not use

self:createDecorOnGroundRotate(ROT-ANGLE, "PREFAB-PATH", x, y, z)
or
self:createDecorOnAirTurn(ROT-ANGLE, "PREFAB-PATH", x, y, z)

for example
self:createDecorOnGroundRotate(45, "models/house/furniture/table3.prefab", 0.0, 0.0, 0.0)
for a 45° rotated model.
Don't use negative rotation values, if you want to rotate -45°, you put 315
Last edited by MEGADORI; 10 May, 2018 @ 7:56am
< >
Showing 1-3 of 3 comments
Per page: 1530 50