I've been trying to add LUA script to my scenery. However the final result is that the material is not visible.
Here's what I've done:
Then I've created another folder 'scripts' with 'texture' folder inside. I moved LUA and textures there that should be used by my object.!lua
local month = varget("E:ZULU MONTH OF YEAR", "Number")
local StringOld = varget("T:DiffuseTexture", "String")
local StringNew
if month > 9 then
StringNew=string.sub(StringOld,1,12) .. "_WI.DDS"
elseif month > 8 then
StringNew=string.sub(StringOld,1,12) .. "_FA.DDS"
elseif month > 5 then
StringNew=string.sub(StringOld,1,12) .. ".DDS"
else
StringNew=string.sub(StringOld,1,12) .. "_WI.DDS"
end
varset("T:DiffuseTexture","String",StringNew)
I want to keep the scripts in my project folder, I also added the entry to add-on.xml so it looks like this:
I also tried to put them into P3D main/Scripts folder to check however result remain the same - material is not visible, but BGL is loaded.<?xml version="1.0" encoding="utf-8"?>
<SimBase.Document Type="AddOnXml" version="4,0" id="add-on">
<AddOn.Name>Airport test</AddOn.Name>
<AddOn.Description>Airport</AddOn.Description>
<AddOn.Component>
<Category>Scripts</Category>
<Path>scripts</Path>
</AddOn.Component>
<AddOn.Component>
<Category>Effects</Category>
<Path>effects</Path>
</AddOn.Component>
<AddOn.Component>
<Category>Scenery</Category>
<Path>scenery</Path>
<Name>Airport scenery</Name>
</AddOn.Component>
<AddOn.Component>
<Category>Texture</Category>
<Path>texture</Path>
<Type>WORLD</Type>
</AddOn.Component>
<AddOn.Component>
<Category>Texture</Category>
<Path>scripts\texture</Path>
<Type>GLOBAL</Type>
</AddOn.Component>
</SimBase.Document>
I tried to follow the SDK here, however I can't find any other tips for this.
Kind regards,
Matt