OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Terox on 05 Jun 2003, 20:22:22

Title: Using Reserved Variable "Missionstart"
Post by: Terox on 05 Jun 2003, 20:22:22
The reserved variable missionstart, creates an array of the following elements
[year,month,day,hour,minute,second]

I have had some success extracting these elements, reorganising them and displayinmg them using titletext

When i run the following script on my local windows machine, in PBO format (and in mission editing format)it states the correct date and time that i started the mission
eg
5-5-2003 at 14:50 hrs

However when i run it on a linux dedicated server it displays the following

1 - 1 - 1970 at 1:0 hrs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I run the following script on the server only

?!(local server):exit
~1
;; The following lines use elements from reserved variable MISSIONSTART so that during the final score screen
;; The date and time the map was started on the server can be publicly shown
?(local Server):serveryear = missionstart select 0;publicvariable "serveryear"
?(local Server):servermonth = missionstart select 1;publicvariable "servermonth"
?(local Server):serverday = missionstart select 2;publicvariable "serverday"
?(local Server):serverhour = missionstart select 3;publicvariable "serverhour"
?(local Server):serverminute= missionstart select 4;publicvariable "serverminute"

and then later during the final score screen i have the clients run the following statement

serverstart = Format["%1 - %2 - %3 at %4 : %5 Hrs",serverday, servermonth, serveryear, serverhour, serverminute]
titletext[format["%1\n started on server at \n%2\n<<< FINAL SCORE >>>\nTied Game!\nEAST %3    <-->    WEST  %4",mapname,serverstart,EScore,WScore],"PLAIN"]



I havent access to a windows server, and therefore i cannot check to see if this is a linux problem only. Could somebody please run these scripts in a test map on a WIN server and see if they get the same results

Please note leave a delay between the server PV'ing the elements of the array and stating the serverstart array, otherwise inconsistencies occur due to synch problems


Thanks in advance
Title: Re:Using Reserved Variable "Missionstart"
Post by: Terox on 10 Jun 2003, 16:45:31
could somebody help me out by testing this please