SpecOp9 0 Posted April 4, 2004 Alright, Here is my question: Ingame at 5:00 PM, I want a chopper to lift off. It's as simple as that. Other examples would be, at 3:00 PM I want a group of soldiers to wake up, and run into a boat and do whatever, drive around aimlessly let's say. I just need to know how to make scripts go off depending on what time it is ingame. Share this post Link to post Share on other sites
RED 0 Posted April 4, 2004 Use the daytime command: ?Daytime > 20: hint "The time is 8pm" RED Share this post Link to post Share on other sites
T J 0 Posted April 4, 2004 There are several ways you can call the time in OFP. As Red says, "daytime" gives you the real time. You can call that day/date/hour/second by using the "missionstart". You can also work with time elapsed during the mission, that is, since "missionstart", as the game sets up a global variable named "TIME". So to make an event happen 5 minutes after the mission starts, you could do; <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? (TIME >=300): Truck setdammage 1 Finally, you can call the amount of time that has elapsed in a script. In a script a reserved variable called "_time" is setup. So for example, you could have a script start, and then have it wait for a minute etc. Maybe for a scud launch etc, you could set off the various stages after specific timed stages. The only thing to watch is that you dont look for a definite time, eg. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?_time ==200: do thus As there is the chance that the game will miss it. So use <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ?_time >=200: do this Hope that helps a little. TJ Share this post Link to post Share on other sites
bn880 5 Posted April 4, 2004 Missionstart is available only in MP, at least in 1.75 that's what I found. Share this post Link to post Share on other sites
SpecOp9 0 Posted April 4, 2004 Thanx guys I'll give it a try Share this post Link to post Share on other sites
nubbin 0 Posted April 7, 2004 is there any way to do this with a trigger in game? Can I add this to any existing script, (just copying and pasting the line). or do I have to make a new sqs file, then have something in the init file refer to it? I want a trigger / script that ends the mission in a half hour after mission start. Could someone give me an example please? Share this post Link to post Share on other sites
RED 0 Posted April 7, 2004 Make a trigger type End1 or what ever you need, then put this in the condition field: time == (60 * 30) That will end the mission 30 mins after the start of the mission. RED Share this post Link to post Share on other sites
nubbin 0 Posted April 7, 2004 cool, thanks, I'll try tonight. Share this post Link to post Share on other sites
nubbin 0 Posted April 8, 2004 worked perfectly. Thank you. Share this post Link to post Share on other sites
SSG Plazmoid 0 Posted April 14, 2004 wow I didn't know _time was built in. You know how many times I've wanted to run timed events and tried _time = time @ (time - _time > 20):do something and of course _time changed right along with time so now I use _myTime to store a time. Anyhow, I wanted to ask what some tricky things you could do with _time? Share this post Link to post Share on other sites
hardrock 1 Posted April 14, 2004 _time tells you the time since the start of the script Share this post Link to post Share on other sites