Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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?
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