Help to undertanding a lua script from P3D V4 SDK

Luis Vargas
Posts: 240
Joined: Wed Mar 28, 2012 5:52 am
Location: Rio de Janeiro, Brazil.
Contact:

Help to undertanding a lua script from P3D V4 SDK

Postby Luis Vargas » Tue Nov 20, 2018 9:11 am

I ask for help to understand how the P3D V4 SKD IRSceneryObject script works. I installed the script, the object appeared in the scenario as expected (Eglin AFB - KVPS), I think its working seems to have something to do with the time of day, but I do not know how produce the expected practical effect.

Image

BenBaron
Posts: 79
Joined: Fri Jan 16, 2015 7:51 am

Re: Help to undertanding a lua script from P3D V4 SDK

Postby BenBaron » Tue Nov 20, 2018 10:03 am

Hi Luis,

I don't understand what exactly you are asking for with the "expected practical effect". Yes, in the example

Code: Select all

local secondsPerDay = 60 * 60 * 24 local percentOfDay = varget("E:LOCAL TIME", "Number") / secondsPerDay
gives you the actual simulator time of day in percent and

Code: Select all

local temperatureScale = 1.0 if percentOfDay < 0.5 then temperatureScale = minimumScale + ((percentOfDay / 0.5) * (maximumScale - minimumScale)) else temperatureScale = minimumScale + (((1.0 - percentOfDay) / 0.5) * (maximumScale - minimumScale)) end
sets the temperatureScale depending on the time of day.

With

Code: Select all

varset("T:TemperatureScale", "Number", temperatureScale)
the temperatureScale is then written back to modify the material rendering of the object.

Greets, Benny

Luis Vargas
Posts: 240
Joined: Wed Mar 28, 2012 5:52 am
Location: Rio de Janeiro, Brazil.
Contact:

Re: Help to undertanding a lua script from P3D V4 SDK

Postby Luis Vargas » Tue Nov 20, 2018 1:30 pm

Hi, Benny. Thanks for your feedback.

I understood the question of temperature and time of day, but how do I see it working into the simulator? I used the time preview to vary the time but I did not notice any modification in material rendering. I saw only the shadows moving as the time going to forward / backward. Maybe the shadows had maked a confusion in my eyes. I will see again this time with double of attention.

Best regards.

User avatar
WarpD
Posts: 1453
Joined: Mon Feb 14, 2011 5:29 am

Re: Help to undertanding a lua script from P3D V4 SDK

Postby WarpD » Tue Nov 20, 2018 2:48 pm

Maybe I'm mistaken... but I think you're messing with an object's infrared image.
Ed Wilson
Senior Developer
Mindstar Aviation

Luis Vargas
Posts: 240
Joined: Wed Mar 28, 2012 5:52 am
Location: Rio de Janeiro, Brazil.
Contact:

Re: Help to undertanding a lua script from P3D V4 SDK

Postby Luis Vargas » Tue Nov 20, 2018 3:16 pm

Yes, it is about infrared. I am trying to understand how It Works.

JB3DG
Posts: 472
Joined: Mon Jan 09, 2012 6:44 pm

Re: Help to undertanding a lua script from P3D V4 SDK

Postby JB3DG » Tue Nov 20, 2018 3:46 pm

You need to be in an IR camera mode to see the difference.
Jonathan Bleeker
Milviz systems dev

Formerly known as Naruto-kun

Luis Vargas
Posts: 240
Joined: Wed Mar 28, 2012 5:52 am
Location: Rio de Janeiro, Brazil.
Contact:

Re: Help to undertanding a lua script from P3D V4 SDK

Postby Luis Vargas » Tue Nov 20, 2018 7:14 pm

Thanks, JB3DG. Only working in NVG (Night Vision Google).

First two in NVG BLACK HOT with time offset from 00:00 to 12:00.

Image

Image

Last two in NVG WHITE HOT with time offset from 00:00 to 12:00.

Image

Image

Luis Vargas
Posts: 240
Joined: Wed Mar 28, 2012 5:52 am
Location: Rio de Janeiro, Brazil.
Contact:

Re: Help to undertanding a lua script from P3D V4 SDK

Postby Luis Vargas » Tue Nov 20, 2018 9:02 pm

As shown in the screenshots above at 12 o'clock the texture modified by the script for the object under study differs (from light to dark) from the others objects in scenery. At 00:00 o'clock the textures light or dark are equal for all objects.


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 6 guests