OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Messiah on 29 Jul 2004, 13:21:10

Title: Detect if its raining
Post by: Messiah on 29 Jul 2004, 13:21:10
i need to know if its possible to detect if its raining in OFP for a script... i can't see anything to tell me it is, but i wondering if any of you guys would know...

if not, can anyone tell me how to tell how much time has passed in a mission?

cheers  :)
Title: Re:Detect if its raining
Post by: j-man on 29 Jul 2004, 13:46:42
I'm not sure if it's possible to detect if it's raining. But to detect how much time has passed, use the "time" command.
Title: Re:Detect if its raining
Post by: Nulear_Man on 29 Jul 2004, 14:05:33
You Use missionstart command (Returns array) To show the mission start time, _Time has do do with time but im not sure how
Title: Re:Detect if its raining
Post by: macguba on 29 Jul 2004, 14:34:26
_time is a local variable which represents the time elapsed since the script has started

time is a global variable representing the time elapsed since the start of the mission

daytime is the time in the game world
Title: Re:Detect if its raining
Post by: Messiah on 30 Jul 2004, 01:34:18
cheers guys... hmmm thats a tad shite about the rain - is it possible to detect any weather condition? clouds for instance?
Title: Re:Detect if its raining
Post by: Dubieman on 30 Jul 2004, 02:41:00
Well I was lookin around and found a setovercast command. Dunno if that helps?

 :P
Title: Re:Detect if its raining
Post by: h- on 30 Jul 2004, 20:56:40
Nope, you can't detect any weather (afaik)...

And use time cautiously as surprise surprise, it has a bug in it... ::)
(or it's another savegame bug..)
When ever a saved game (be it save or retry) is loaded the time is reset back to 0...

Quote
Well I was lookin around and found a setovercast command
This sets clouds (or what ever), does not detect them... ::)
Title: Re:Detect if its raining
Post by: Messiah on 30 Jul 2004, 21:48:20
its needed for scripting on an addon, so its no bother if the time is reset at all... oh well, shame you can't detect rain... begger  >:(
Title: Re:Detect if its raining
Post by: General Barron on 01 Aug 2004, 01:20:26
Nope, you can't detect any weather (afaik)...

And use time cautiously as surprise surprise, it has a bug in it... ::)
(or it's another savegame bug..)
When ever a saved game (be it save or retry) is loaded the time is reset back to 0...This sets clouds (or what ever), does not detect them... ::)

Very, VERY interesting.... I didn't know that. The reason I find that interesting, is because that gives you a way of detecting when the mission has been loaded, which I never thought possible. Basically, you just need a script that a few seconds after the mission starts, and waits until Time is 0 before proceeding.

Hmm... not sure what you could do with such a script though, unless you wanted to rob the player of his one "savegame" he gets by default  :-X
Title: Re:Detect if its raining
Post by: macguba on 01 Aug 2004, 01:53:43
Yes, it's true.

The other thing about "time" is that it works off Martian seconds, which aren't always exactly the same as Earth seconds.  

Well ok maybe it isn't Mars, but it's somewhere.   The point is that an OFP game second does not necessarily exactly equal an Earth second.
Title: Re:Detect if its raining
Post by: Maddmatt on 01 Aug 2004, 12:17:52
Very, VERY interesting.... I didn't know that. The reason I find that interesting, is because that gives you a way of detecting when the mission has been loaded, which I never thought possible. Basically, you just need a script that a few seconds after the mission starts, and waits until Time is 0 before proceeding.

Hmm... not sure what you could do with such a script though, unless you wanted to rob the player of his one "savegame" he gets by default  :-X
Custom object/vehicle animations are also reset after a load, you could use this to restore custom animations. For example making sure a bas delta keeps his goggles down or a ukf marine keeps his helmet on.
Title: Re:Detect if its raining
Post by: h- on 01 Aug 2004, 13:57:10
setObjectTexture is reset after savegame reload as well, so this can be used in keeping the textures there where they should be...
Title: Re:Detect if its raining
Post by: dmakatra on 01 Aug 2004, 16:09:48
Very, VERY interesting.... I didn't know that. The reason I find that interesting, is because that gives you a way of detecting when the mission has been loaded, which I never thought possible. Basically, you just need a script that a few seconds after the mission starts, and waits until Time is 0 before proceeding.

Hmm... not sure what you could do with such a script though, unless you wanted to rob the player of his one "savegame" he gets by default  :-X

The problem about this theory is that he cannot use "update retry position" saves, nor can he exit the game and continue later on. Been there, tried that, dropped mission. As usual then. :P

:beat: *Gets Shot* :beat:
Title: Re:Detect if its raining
Post by: Planck on 01 Aug 2004, 16:47:04
I have a way round the replaying saves issue armstrong.

It's a bit footery, but it works for me.

Look in this thread.

http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=14265;start=135


Planck