P3Dv4 Material Scripting

Christian Bahr

Resource contributor
#61
but on that topic, has anybody managed to get A2A's free windshield effect working for their own aircraft?
Originally, I once had the hope that you may also get raindrops on glass panes of the tower and buildings. Nothing has come of it. The offer of A2A I had also noticed, but have not done anything in this direction. It is another possibility.
 
#62
Originally, I once had the hope that you may also get raindrops on glass panes of the tower and buildings. Nothing has come of it. The offer of A2A I had also noticed, but have not done anything in this direction. It is another possibility.
Could someone managed to inject render-to-texture to MDL objects?
 

Christian Bahr

Resource contributor
#66
Hi!

I'm not sure, the link leads to the Lockheed Martin Support Forum. I am also not sure if the article is about the Windshild effect. There is talk of entries in the Panel.cfg related to the entry "texture00=CursorTexture".
This is also something of "ObjectWorldTransform". I do not quite look over there :scratchch
 

Christian Bahr

Resource contributor
#68
Thanks, now I understand it. The article is about animated textures intended to depict raindrops. Unfortunately, that's not what I'm looking for. I'm looking for the reguar windshild effect. As it is installed in many aircraft. Nevertheless, I will look at this later again. At the moment we are in the process of reinventing LUA material scripting.
 
#69
Hi!

Looks like the limitation of LUA scripts to simobjects hasn't been discussed here before, correct?
When I try to add Christian's LUA script sample to a MDL with a XML placement I'm not getting any material changes at all when it's raining and on P3D shutdown (error logging in P3D activated) I'm getting the following log:

[error.0]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.1]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.2]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.3]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.4]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.5]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.6]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.7]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.8]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.9]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.10]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.11]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.12]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.13]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.14]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.15]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.16]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.17]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.18]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.19]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.20]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.21]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.22]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.23]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.24]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.25]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.26]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.27]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.28]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.29]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.30]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.31]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.32]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.33]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.34]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.35]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.36]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.37]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.38]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.39]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.40]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.41]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.42]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.43]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.44]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.45]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.46]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.47]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.48]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.49]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.50]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.51]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.52]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.53]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.54]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.55]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.56]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.57]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.58]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.59]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.60]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.61]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.62]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.63]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.64]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.65]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.66]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.67]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.

[error.68]
error=Failed to execute material script "test.lua": Attempted to access SimObject based variable on a non-SimObject.
Which in essence says that LUA scripting in general works for simobjects only.

Has anyone got this to work with terrain models, buildings etc.?
From the PBR scenery announcements so far I have seen that the few of them that do rain variations are using the old fallback to SODE?

Bests,
Sascha
 

Christian Bahr

Resource contributor
#70
Which in essence says that LUA scripting in general works for simobjects only.
You can be sure that LUA scripts work for both Simobjects and BGL objects. It is however important to use the correct formatting of the variables.

It can very well be that a simobject does not have access to the path to the LUA script. It depends then on the method of how to add the simobject in the P3D. Usually, I register sceneries as add-on package in the Sim and reference the respective scene elements via the add-on.xml located in the installation directory. This works very well in the example of the Mercedes and it works perfectly for some of my scenes. You could try to put your LUA script in the directory "...\Prepar3D v4\Scripts", because there are also other LUA scripts needed by the P3D.
 
Top