Home   Help Search Login Register  

Author Topic: light sensor...  (Read 2905 times)

0 Members and 1 Guest are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
light sensor...
« on: 13 Aug 2005, 14:04:58 »
m'kay. flashpoint being as complex and real-worldish as it is, the sun sets at different times depending on the time of year.

what i need is some way of detecting when it's dark. the daytime command is not all that useful here, for the reason outlined above. the only way i can think of is to catch a streetlight and find out if it's lit or not...

but what about islands without lights?

EDIT - and checking the streetlight doesn't seem to work. they return "auto" rather than 'on'...
« Last Edit: 13 Aug 2005, 14:20:18 by bedges »

bored_onion

  • Guest
Re:light sensor...
« Reply #1 on: 13 Aug 2005, 14:34:37 »
a number of half-wit ideas :P:

maybe you could have a AI unit like a chopper or jeep on safe mode and check if its lights are on (can that be done?) because the AI tend to put them on when its dark. - you never know, it could work.

beyond that, the game itself must have some way for the street lights to know whether its dark or not which could be buried deep in the config. the ECP guys might know a thing or two about this.

make a script which will do this by comparing daytime to the date and such like. it would be dull but i think it could be done.

other that I can't think of anything....

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #2 on: 13 Aug 2005, 15:27:02 »
mhmm, a few of those crrrazy ideas went through my mind also ;)

detecting a vehicle unit's lights is also not possible it seems.

as far as i know there's no 'date' command, otherwise i could possibly script something which approximates the sunset time... bah humbug!

i may well ask someone in the ecp team, that seems a good bet.

cheers anyways  8)

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:light sensor...
« Reply #3 on: 13 Aug 2005, 15:27:38 »
Have you done a search?  I recall reading a thread about a script that calculates sunrise and sun set times based on the date.  It was a few months ago now.
« Last Edit: 13 Aug 2005, 16:53:46 by THobson »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #4 on: 13 Aug 2005, 15:32:53 »
 :-[ ach min - anyone ever tell you you're brillant?

found what i'm after here. idiot me for not searching properly...
« Last Edit: 10 Mar 2007, 16:19:08 by bedges »

bored_onion

  • Guest
Re:light sensor...
« Reply #5 on: 13 Aug 2005, 15:43:22 »
this would make a nifty function. that way all we'd have to do was call daylight.sqf.

*makes suggestion in function requests*

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #6 on: 13 Aug 2005, 15:49:39 »
only problem being it doesn't work.... at least not in SP as it relies on missionstart.
« Last Edit: 13 Aug 2005, 15:53:12 by bedges »

bored_onion

  • Guest
Re:light sensor...
« Reply #7 on: 13 Aug 2005, 17:14:19 »
put it in the init.sqs maybe? or does missionstart give the date??

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:light sensor...
« Reply #8 on: 13 Aug 2005, 23:19:50 »
My thought on this is that you'd have to open up mission editor and go to the Longest day 6-21/22 shortest 12-21/22 as well as March and Sept 21/22 write down the times of sunrise and sunset. Using no cloud cover on the Selections as to see clear Sunsets.(standing by a town and sea watching lights truning On and Off)
 
Do the math and write a script.

A little of trial and error and a little of Caculations here.

Not Fancy or really fast but should get the Job done. :P
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #9 on: 14 Aug 2005, 08:57:44 »
that part of it is pretty simple. the difficulty is finding out what date it is... :P

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:light sensor...
« Reply #10 on: 14 Aug 2005, 09:45:43 »
Oh well, not knowing what I'm talking about never stops me 8)

vehicle actions to turn headlights on / off, are removed during 'daylight'. Since you can andd and delete actions, can you test for their presence also?

Just say no to bugz

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #11 on: 14 Aug 2005, 13:34:55 »
interesting idea... i wonder. hmmmm.....

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:light sensor...
« Reply #12 on: 15 Aug 2005, 01:47:00 »
I won't give up on the idea of math solving this and  the "angle' of Island with no lights.

Count the days as in Jan. 1 = 1 to Dec. 31 = 365
So Feb 28 = 59
So for a Script to check which day it is, a person using it would have to type it in.
Is there a way to check the INTEL window date in a script or such?? If so then can it be transferred to numbers easily.

Where my idea is going?? I have no Idea ???
Just some thoughts here.

By the way you may Know this, Jan 1 in the game starts on a Tuesday.
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:light sensor...
« Reply #13 on: 17 Aug 2005, 04:42:05 »
OK I'll admitt it. Math won't slove this True Sensor problem  :'(.

If you are looking for a Light sensor that works all the time then Mikero's Idea is probably the right track to go on.

I set up a little test Jan 1 @ 7:30 am.
 Me as a Player Officer and a Jeep with it's reg. loons inside. All of us on the east side fo Malden beach watching the sun come up.

Test 1. Early Morning at default clouds and the like. One could see the sun coming up and the surrounding area seem bright enough. However the jeep turned off it's Lights at 7:47.~20sec.

Next:  Did the same on everything else and except made it as clear as I possible could. The Jeeps lights went off at 7:33 and about ~10 sec.

3rd one was a fog one and it turned off the lights around 7:38.~25sec.

So for a True Light Sensor, Mikero's idea!!

And I'll, just Shut-Up about this  :-X
    Sharkyjoe
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #14 on: 17 Aug 2005, 07:23:46 »
excellent :) now all i need to do is find out how to interrogate a jeep's driver to see if he has the lights on or off...  :-\

Offline 456820

  • Contributing Member
  • **
Re:light sensor...
« Reply #15 on: 17 Aug 2005, 08:54:09 »
what about a soldier with NVG's if he has them on its dark and you might be able to do it with hasweapon just another though if you cant do the jeep one

funkster

  • Guest
Re:light sensor...
« Reply #16 on: 17 Aug 2005, 10:36:51 »
ah.....cleverr......  
 ;)

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:light sensor...
« Reply #17 on: 18 Aug 2005, 01:10:50 »
Nah, what's clever is a genius like me coming up with the solution without having to actually find out how to make it work! Now, that's clever 8) ;D
Just say no to bugz

funkster

  • Guest
Re:light sensor...
« Reply #18 on: 18 Aug 2005, 03:06:58 »
Clever indeed,

I searched this thread for your solution, and it seems what is clever is "a genius like you coming up with a solution, without actually having to come up with a solution, OR make it work" - nice one!  :P ;)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #19 on: 18 Aug 2005, 07:34:05 »
off-topic gentlemen, as your posts freely admit. tsktsk... :hmm:

anyways, at present there seems no way to interrogate loons with nvgoggles or loons in jeeps with lights. no way to get at the number of actions in a vehicle, no way to tell if the nvgoggles are on or off. hasweapon simpy states that nvgoggles exist.

temporary solution is to include a dialog for the player to manually enter the date, or a field in the init.sqs file.

thanks for the help anyways  8)

Offline Speeder

  • Members
  • *
    • OFP.nu
Re:light sensor...
« Reply #20 on: 18 Aug 2005, 18:09:40 »
Turn the missioneditor to advanged.
Turn on ID's
Find the ID of a streetlamp (74632 (made that one up))

#Loop
~60
? (74632 inflame false) : GOTO #Loop
Execute my code here

exit


Thats my suggestion.
There are 10 kinds of people in this world. Those who get it, and those who don't.

Dubieman

  • Guest
Re:light sensor...
« Reply #21 on: 18 Aug 2005, 18:59:56 »
One problem is.... standard streetlights are not affected by inflame. Its an action switch like auto, on, off. ;)

Quote
off-topic gentlemen, as your posts freely admit. tsktsk... Hmmm.....
Can never have fun when its the mod's thread. ::) ;D

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
Re:light sensor...
« Reply #22 on: 19 Aug 2005, 02:16:30 »
>off-topic gentlemen, as your posts freely admit. tsktsk...

ooo, you know how much I like it when you whip me.
---
Umm, is this far fetched?

could you make a small addon that overrides the action of a 'standard' streetlamp. Such that when it is told to fire up it destroys itself (setdamage=1.0)

that way you could test for it right?

I know you can override the action with an inflame type of script, but I don't know if it's 'automatically' used by the engine.

maybe i should shut up.
Just say no to bugz

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:light sensor...
« Reply #23 on: 19 Aug 2005, 08:30:42 »
all help is appreciated, mikero, you don't need to shut up. i like hearing you yelp :P

the question is moot. i'd rather not get into anything overly complicated - all i wanted was a generic way of finding out when it gets dark in any mission, without explicitly knowing beforehand, but it seems unlikely to happen using any of the traditional means.

thanks to all contributors  8)