• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

This works... but...

Messages
135
Country
us-kentucky
I'm wondering what the "straight" C version of this would be:

bool Time::IsDay()
{
SINT32 timeOfDay;

execute_calculator_code("(E:TIME OF DAY,Enum)", NULL, &timeOfDay, NULL);

if (timeOfDay == 1)
{
return true;
}
else
{
return false;
}
}

In other words not using the XML stuff, but just a gauge var. I'm thinking there has to be a faster more efficient way to determine it is day or not day. =)

Patrick
 
The next time I see a working "pure C example" will be the first... :rolleyes:

Note that even though ACES defined the constants for time of day in gauges.h file, there's no actual token variable provided:

// time_of_day constants
#define TIME_OF_DAY_DAY BIT0
#define TIME_OF_DAY_DAWN BIT1
#define TIME_OF_DAY_DUSK BIT1
#define TIME_OF_DAY_NIGHT BIT2

Okay, I'll bite (pun intended), BITn of WHAT precisely? :eek:
 
{snip}
// time_of_day constants
#define TIME_OF_DAY_DAY BIT0
#define TIME_OF_DAY_DAWN BIT1
#define TIME_OF_DAY_DUSK BIT1
#define TIME_OF_DAY_NIGHT BIT2

Okay, I'll bite (pun intended), BITn of WHAT precisely? :eek:

BIT0, BIT1, and BIT2 are themselves #defined (as 0, 1, 2)

The straight answer to Patrick's question is, sadly, "No."

Doug
 
BIT0, BIT1, and BIT2 are themselves #defined (as 0, 1, 2)

The straight answer to Patrick's question is, sadly, "No."

Doug

As I said, the next time I see a "pure C solution" will be the first.

I seem to recall that the FS98 gauges.h actually had a TIME_OF_DAY variable, but no one was ever able to get it to work - at all, which would explain why it's been depecrated.

OTOH, even the XML token bears little synchronicity with the actual environmental time of day, as the dawn and dusk flags seem to be tied to absolute time rather than seasonal time.

IOW, the dawn flag may not be set until long after dawn has actually occured, or long before dawn has actually occured! :eek:
 
Back
Top