Community Forum

Map lighting error

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created06.12.2020 15:04


Tomasz Sam (Scarvarg) 06.12.2020 15:04
I have started expiriencing this error in the log file:
Any one would be able to help me please?

2020-12-06 10:51 dataS/scripts/environment/Lighting.lua (198) : setLightScatteringDirection
2020-12-06 10:51 dataS/scripts/environment/Environment.lua (244) : update
2020-12-06 10:51 dataS/scripts/BaseMission.lua (1590) : update
2020-12-06 10:51 dataS/scripts/FSBaseMission.lua (1979) : update
2020-12-06 10:51 dataS/scripts/missions/mission00.lua (469) : update
2020-12-06 10:51 dataS/scripts/main.lua (1944) : update
2020-12-06 10:51 Warning (script): 'setLightColor': Argument 1 has wrong type. Expected: Int. Actual: Nil
2020-12-06 10:51 ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (882): expectedType == Value::VoidType || expectedType == Value::ClassType
2020-12-06 10:51 LUA call stack:
2020-12-06 10:51 dataS/scripts/environment/Lighting.lua (237) : setLightColor
2020-12-06 10:51 dataS/scripts/environment/Environment.lua (244) : update
2020-12-06 10:51 dataS/scripts/BaseMission.lua (1590) : update
2020-12-06 10:51 dataS/scripts/FSBaseMission.lua (1979) : update
2020-12-06 10:51 dataS/scripts/missions/mission00.lua (469) : update
2020-12-06 10:51 dataS/scripts/main.lua (1944) : update
2020-12-06 10:51 Warning (script): 'setLightScatteringColor': Argument 1 has wrong type. Expected: Int. Actual: Nil
2020-12-06 10:51 ..\..\..\src\base\scripting\lua\LuaScriptSystem.cpp (882): expectedType == Value::VoidType || expectedType == Value::ClassType
2020-12-06 10:51 LUA call stack:
2020-12-06 10:51 dataS/scripts/environment/Lighting.lua (238) : setLightScatteringColor
2020-12-06 10:51 dataS/scripts/environment/Environment.lua (244) : update
2020-12-06 10:51 dataS/scripts/BaseMission.lua (1590) : update
2020-12-06 10:51 dataS/scripts/FSBaseMission.lua (1979) : update
2020-12-06 10:51 dataS/scripts/missions/mission00.lua (469) : update
2020-12-06 10:51 dataS/scripts/main.lua (1944) : update

Bilbo Beutlin (BBeutlin) 06.12.2020 17:27
Should be self-explanatory: missing or faulty environment files.
Begin with default files. Change stepwise only and check each time the log for errors.
Maybe also syntax errors in your xml files. Check eg. with Notepad++ plugin "XML Tools".

Tomasz Sam (Scarvarg) 06.12.2020 18:03
The lighting works on other maps whilst using the same environment.xml file. I have noticed that on this map the shadows are not moving. So there can be 2:00am and the sun is still on the sky. While on other maps it is working perfectly fine.

I have also checked for errors using XML Tools, and it didn't detect any errors.

Bilbo Beutlin (BBeutlin) 06.12.2020 19:17
Didn't you notice the messages
- 'setLightColor': Argument 1 has wrong type. Expected: Int. Actual: Nil
- 'setLightScatteringColor': Argument 1 has wrong type. Expected: Int. Actual: Nil

There are some more files than only the "environment.xml". You must also check the colorGrading files.
Same for the files in folder "envMaps", usually in subfolder of "maps". No sun move, no shadows indicate partial or complete missing of these files.

Tomasz Sam (Scarvarg) 06.12.2020 20:42
Well I have edited my self the "environment.xml"as well as "colorGrading.xml" files. But like I said, they work perfectly fine on any other map. It must be some thing to do with the map it self.I am not sure where should I start looking for it. I have dug down to the "sun" in the map.XML, but there wasnt anything abnormal.

I have also checked other maps "map" folder and none of them actually had "envMaps.xml". I am assuming all of them are using the "built in" version provided by the FS.

Bilbo Beutlin (BBeutlin) 06.12.2020 20:56
The envMaps are not XML files, but gfx files (DDS).
See for reference the defaults in $data/maps/mapDE/envMaps.
These are linked from the environment.xml <envMap basePath="$data/maps/mapDE/envMaps/">

Tomasz Sam (Scarvarg) 06.12.2020 22:23
Yep you are right that envMaps is a folder - "envMaps.dir", it was a typo.

And I have checked the reference and it it is as follows:

<envMap basePath="$data/maps/mapDE/envMaps/">

There are no other mods in the "mods" folder, so it must be something to do with the map.xml.

<colorGrading filename="$data/maps/mapDE_colorGrading.xml" />
<environment filename="$data/maps/mapDE_environment.xml" />

As you see, they point to the game files, and those are working fine on other maps that have the same reference (using the same files).
Is there any other lighting - sun - options insideo of the map.i3d that I would have to investigate/change/fix?

Tomasz Sam (Scarvarg) 06.12.2020 22:41


Bilbo Beutlin (BBeutlin) 07.12.2020 00:26
If all other files are ok, should be then the sun itself.
Compare your modmap's sun properties and settings carefully with a sun in default map, espec. in the tab "Light".

Tomasz Sam (Scarvarg) 07.12.2020 09:43
I have comparet them both, and they are the same. My maps sun property:

<Light name="sun" translation="6.10352e-05 400 6.10352e-05" rotation="-35.393 51.396 20.8053" objectMask="67043328" nodeId="3376" type="directional" color="1 1 1" emitDiffuse="true" emitSpecular="true" castShadowMap="true" depthMapBias="0.001" depthMapSlopeScaleBias="2" depthMapSlopeClamp="0.001" depthMapResolution="2048" shadowFarDistance="400" shadowExtrusionDistance="320" shadowPerspective="false" numShadowMapSplits="3" shadowMapSplitDistance0="30" shadowMapSplitDistance1="80" shadowMapSplitDistance2="400" shadowMapSplitDistance3="400" decayRate="1" range="10000" scattering="true"/>

I am hopeless :/



Bilbo Beutlin (BBeutlin) 07.12.2020 12:14
Just to go sure: does your sun have the right user attribute "onCreate: Environment.onCreateSunLight" ?

Tomasz Sam (Scarvarg) 07.12.2020 15:41
@Bilbo Beutlin (BBeutlin) - You are the man! That's it! Thank you so much. Didn't know that this object requires a property. It was empty, there were no properties assigned to it.

Cheers man!

~~SOLVED~~


Note: Log in to post. Create a new account here.