Jump to content
Sign in to follow this  
Jex =TE=

Adding time of day

Recommended Posts

Been looking for last 2 hours for this which I thought would be simple but instead is turning out to be infuriating. All I want to do is add a time to start the mission in the lobby. I've been to many websites and what they write don't work. My latest attempt was this...

Quote[/b] ]

Time Of Day

First off, set the time in the editor to 12am.

Open up your description.ext and add the following lines preferably after the debriefing=1 etc lines:

Quote

titleParam1 = "Difficulty";

valuesParam1[] = {1, 2, 3};

defValueParam1 = 1;

textsParam1[] = {"Default", "Hard", "Rambo"};

titleParam2 = "Time of Day";

valuesParam2[] = {1, 2, 3, 4};

defValueParam2 = 2;

textsParam2[] = {"Morning", "Mid Day", "Evening", "Night"};

Then add the following to your init.sqs for Time of day:

Quote

? (Param2 == 1) : skipTime -6

? (Param2 == 3) : skipTime 6

? (Param2 == 4) : skipTime 12

Byut I just get errors. Can anyone give me a definitive, "yes this works" answer?

I'm not using the difficulty part.

Thx.

Share this post


Link to post
Share on other sites

I'd say "yes" this would work, what errors are you getting?

Share this post


Link to post
Share on other sites

You need change:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? (Param2 == 1) : skipTime 6

? (Param2 == 2) : skipTime 12

? (Param2 == 3) : skipTime 16

? (Param2 == 4) : skipTime 20

Share this post


Link to post
Share on other sites
You need change:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

? (Param2 == 1) : skipTime 6

? (Param2 == 2) : skipTime 12

? (Param2 == 3) : skipTime 16

? (Param2 == 4) : skipTime 20

if he changed it like that then it wouldn't match his textsParam2 and he doesn't need to check (Param2 == 2) because thats the default time.

Share this post


Link to post
Share on other sites

Not applicable to this discussion. Edited out to avoid confusion or complication.

Share this post


Link to post
Share on other sites
description.ext  icon_rolleyes.gif

what errors are you getting Jex?

Hey Squeeze

Ok i have this for Init.sqs

Quote[/b] ]

//Time

? (Param1 == 0400) : skipTime 16

? (Param1 == 1800) : skipTime 6

? (Param1 == 2200) : skipTime 10

and this for Descr.ext

Quote[/b] ]

//Time Start

titleParam1 = "Time:";

valuesParam1[] = {0400,1200,1800,2200};

defValueParam1 = 1200;

textsParam1[] = {"First Light","Midday","Last light", "Night"};

It then thros up invalid expression line 3 or something. It doesn't seem to like skip time 16 as well

I spent 3 hours looking at different forums on a goggle search and each "suggestion" was bogus. It seems everyone has a different way but they never work. No wonder hardly anyone makes missions for this game

thanks again smile_o.gif

Share this post


Link to post
Share on other sites

comments in *.sqs should start with ; not //

if you didn't know this then maybe there is alot more wrong then you think.

make a small mission with just what you have here and see if it works.

Share this post


Link to post
Share on other sites

Try this in your Description.Ext

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//To use Time of Day set Mission Time to 12 Noon

titleParam1 = "Time of Day:";

valuesParam1[] = {10, 100, 1000, 2000};

defValueParam1 = 100;

textsParam1[] = {"Morning", "Day", "Evening", "Night"};

Share this post


Link to post
Share on other sites
description.ext  icon_rolleyes.gif

what errors are you getting Jex?

Oh pfft!  My mistake, I didn't see that part about description.ext.  Honestly, it's the quotes inside the quote, and the comments that don't have any syntax to them that makes it so unreadable. tounge2.gif

I'll edit out my last post, since it's irrelevant to this discussion.  Forgive me!   confused_o.gif

Share this post


Link to post
Share on other sites

It's Working!! smile_o.gif

Thanks everyone who offered advice. My mistake was simple - my init.sqs had somehow changed to .sqf so I changed it back, turned the // in ;; and it's perfect. So the end result is...

Init.sqs

Quote[/b] ]

;;Time

? (Param1 == 0400) : skipTime 16

? (Param1 == 1800) : skipTime 6

? (Param1 == 2200) : skipTime 10

Description.ext

Quote[/b] ]

//Time Start

titleParam1 = "Time:";

valuesParam1[] = {0400,1200,1800,2200};

defValueParam1 = 1200;

textsParam1[] = {"First Light","Midday","Last light", "Night"};

Apologies if the first post wasn't clear but when you don't know what you're doing, you don't know when your doing something wrong lol.

Cheers guys!

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
Sign in to follow this  

×