OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: CAS_Daniel on 22 Nov 2005, 21:37:23

Title: Setting the time
Post by: CAS_Daniel on 22 Nov 2005, 21:37:23
Hi, I want to add the ability to change the time at the assign screen to my mission. I know where to do this - I opened a capture the flag mission and found it in the description file and the string table, but I don't understand how it works. Is there a simple way of doing this? Thanks, Daniel.  :)
Title: Re:Setting the time
Post by: KTottE on 23 Nov 2005, 08:48:10
The way it works is you have your time in the PARAMS thing on your description.ext, I assume you know how to do this because I don't remember how ;)

Anyway, in the mission you set the time to 00:00. And in your init.sqs you put:
skipTime params1

Assuming that params1 is your "Select time" thing. So in the value-field of your params you write the number of hours to skip ahead from 00:00, and et voilá you've got changable time.
Title: Re:Setting the time
Post by: Terox on 23 Nov 2005, 21:01:07
DESCRIPTION.EXT
Quote
titleParam1 = "Time of Day";
valuesParam1[] = {5,12,18.3,0};
defValueParam1 = 5;
textsParam1[] = {"First Light","Midday","Last Light","Night"};

INIT.SQS
Quote
Skiptime param1


MISSION EDITOR
set the mission start time to midnight, 00:00hrs

if you decide to use another mission start time, then you will need to amend the param1 values
Title: Re:Setting the time
Post by: CAS_Daniel on 24 Nov 2005, 18:57:25
Thanks a lot guys, I think I get it now.  :D

I'll lock this thread once I've tested it.  :)

EDIT: Works like a dream, thanks a lot!  ;D