OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kilo11 on 04 Jun 2004, 19:59:25

Title: Timer Script
Post by: Kilo11 on 04 Jun 2004, 19:59:25
Hello,

I am making a training mission that requires you to drive down a road (in simple terms) and make it to the finnish.  There is a START and a FINISH that I have setup.


What I need is a script that would start once the driver enters the START trigger, it will start a clock watch if you will.  When the unit gets the the FINNISH trigger, the script will display the exact time that he/she took to finish the course.

If anyone could give me the command or script or point me in the right direction id be greatful.  Thanks!


-=Kilo=-
Title: Re:Timer Script
Post by: macguba on 04 Jun 2004, 20:09:10
The reserved variable time records the mission time.   By checking at at start and finish and doing some arithmetic. ..

Alternatively, the reserved local variable _time records the time since the script started.     Call a script at the start and extract the variable at the finish.

No time for details now, hopefully that will help.
Title: Re:Timer Script
Post by: dmakatra on 04 Jun 2004, 20:38:00
Start a script where in the start trigger. Make it look like this:

@ blabla
hint format ["Your time was: %1 seconds.", _time]
exit


In the end trigger, turn the boolean blabla into true.

:beat: *Gets Shot* :beat:
Title: Re:Timer Script
Post by: Kilo11 on 04 Jun 2004, 20:56:55
THANKS!


-=Kilo=-