Jump to content
Feint

BIS_fnc_sunriseSunsetTime not reflecting observed sunrise/sunset times

Recommended Posts

Unless I'm using this function incorrectly, the results of the BIS_fnc_sunriseSunsetTime function do not match up with the observed sunrise and sunset times.  It seems to work in January, but not in summer months like June (on Altis).
 

STEPS TO REPRODUCE:

1) Open Altis in 3Den

2) Place any unit

3) Set date and time to 2016, January 4th.

4) Preview mission

5) Hit Esc and in the code window, type: hint format ["%1",[] call BIS_fnc_sunriseSunsetTime];
6) Compare results to observed sunrise and sunset times using the in-game camera and changing the times

RESULTS: The results from BIS_fnc_sunriseSunsetTime are accurate.

7) Return to 3den editor

8) Change date to 2016, July 4th.

9) Preview mission

10) Hit Esc and rerun the above code

11) Compare the results to observed sunrise and sunset times using camera to change the time

RESULTS: The results from BIS_fnc_sunriseSunsetTime are around 2 hours off for both sunrise and sunset.

 

I have not tested every month nor have I tested other maps.  

 

PC version of the game.

 

I hope this helps.

Share this post


Link to post
Share on other sites

Unless I'm using this function incorrectly

 

That would be it. Try

 

date call BIS_fnc_sunriseSunsetTime

But yes, basically it can be improved to avoid confusion. Thank you for reporting it.

Share this post


Link to post
Share on other sites

Oh cool.  OK, thanks for the instructions! 

Share this post


Link to post
Share on other sites
On 2016-05-04 at 6:16 AM, killzone_kid said:

 

That would be it. Try

 


date call BIS_fnc_sunriseSunsetTime

But yes, basically it can be improved to avoid confusion. Thank you for reporting it.

How do I go about doing this?

hint format ["%1",[] date call BIS_fnc_sunriseSunsetTime];

I tried the above and it just throws an error. It says I need a closing square bracket right before date, which makes absolutely no sense.

Share this post


Link to post
Share on other sites
6 minutes ago, Drift_91 said:

I tried the above and it just throws an error. It says I need a closing square bracket right before date, which makes absolutely no sense.


Why wouldn't it? The syntax is all wrong. You either use
 

hint format ["%1", [] call BIS_fnc_sunriseSunsetTime];

or 
 

hint format ["%1", date call BIS_fnc_sunriseSunsetTime];


but not both at the same time

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, killzone_kid said:


Why wouldn't it? The syntax is all wrong. You either use

 


hint format ["%1",[] call BIS_fnc_sunriseSunsetTime];

or 
 


hint format ["%1", date call BIS_fnc_sunriseSunsetTime];

bot not both at the same time

What do you mean by both at the same time?

Btw thank you, the second one worked. I don't see why the first option has square brackets and the second one doesn't.

Share this post


Link to post
Share on other sites

 

1 minute ago, Drift_91 said:

What do you mean by both at the same time?


Really?
 

12 minutes ago, Drift_91 said:

hint format ["%1",[] date call BIS_fnc_sunriseSunsetTime];

Share this post


Link to post
Share on other sites

the second one works as well because date command returns an array, so when you call another function it sees the brackets are there and takes whatever the date command returned as arguments. If you weren't familiar with the date command returning an array and other commands being able to accept that array directly then it becomes easy to see how somebody might get confused.

 

e.g

 

myDate = date; //--->[6,3,2,2,2];

myDate call BIS_fnc_sunriseSunsetTime;

if you were to replace the myDate infront of the call with the date command itself, the same thing would be passed into the function directly, saving space/time/memory

 

perhaps explaining what is actually wrong with the code would be more helpful than just saying "Really?".

  • Like 1

Share this post


Link to post
Share on other sites

 

35 minutes ago, austin_medic said:

perhaps explaining what is actually wrong with the code would be more helpful than just saying "Really?".

 

48 minutes ago, killzone_kid said:

Why wouldn't it? The syntax is all wrong. You either use

Share this post


Link to post
Share on other sites
On 2017-01-14 at 0:53 PM, austin_medic said:

the second one works as well because date command returns an array, so when you call another function it sees the brackets are there and takes whatever the date command returned as arguments. If you weren't familiar with the date command returning an array and other commands being able to accept that array directly then it becomes easy to see how somebody might get confused.

 

e.g

 


myDate = date; //--->[6,3,2,2,2];

myDate call BIS_fnc_sunriseSunsetTime;

if you were to replace the myDate infront of the call with the date command itself, the same thing would be passed into the function directly, saving space/time/memory

 

perhaps explaining what is actually wrong with the code would be more helpful than just saying "Really?".

Now what I don't get is what the blank array in the first one passes to the sunrisesunset command. It gives an output so it's obviously happy with the input. As the original point of the thread, it wasn't doing what Feint wanted, so I'm guessing it was just assuming Jan 1st or something?

 

 

On 2017-01-14 at 0:39 PM, killzone_kid said:

but not both at the same time

I thought you had meant both full scripts at the same time or something like that. Eg:

hint format ["%1",[] call BIS_fnc_sunriseSunsetTime] hint format ["%1", date call BIS_fnc_sunriseSunsetTime];

Obviously there was no reason for you to think that so I assumed I was wrong, hence why I asked "what do you mean?". Also when I said "the bottom one works" I wasn't saying the top one didn't, just that I'd tested your correction of my syntax and it worked. Sorry for the confusion.

Share this post


Link to post
Share on other sites
On 14.1.2017 at 8:41 PM, haleks said:

Just noticed this function is missing from the wiki : https://community.bistudio.com/wiki/Category:Arma_3:_Functions

It's listed if you're logged in.
Logged in: 923 functions. Logged out: 896 functions.

The same with the Arma 3 script commands page; 2,056 vs. 2,047


I remember a while ago someone at BI tried to figure out why this happens.

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, Greenfist said:

It's listed if you're logged in.
Logged in: 923 functions. Logged out: 896 functions.

The same with the Arma 3 script commands page; 2,056 vs. 2,047


I remember a while ago someone at BI tried to figure out why this happens.

Hate to hijack the thread from feint even further, but I can't seem to find a way to create an account. My forum login doesn't seem to be accepted either.

Share this post


Link to post
Share on other sites
6 minutes ago, haleks said:

@Drift_91 : you need to create an account on MediaWiki I think : https://www.mediawiki.org/w/index.php?title=Special:CreateAccount&returnto=Help%3ALogging+in

No, that's for Mediawiki.org. :)
The BIKI registration has been disabled for a while now, because of spamming or the lack of Bohemia account integration I think.
I believe you need to contact Dwarden, he can manually create an account for you.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×