Home   Help Search Login Register  

Author Topic: To light or not to light  (Read 707 times)

0 Members and 1 Guest are viewing this topic.

B-2-0

  • Guest
To light or not to light
« on: 07 Oct 2003, 10:03:23 »
I have a mission in a desert with selectable time.

There are various fires dotted around the map which i would like to be lit at night but not during the day, as a fire in the desert in the day looks kinda weird.......i know i have to create a script that has all the fire names in an array, detects what time of day it is and lights the fires or puts them out accordingly but i have no clue how to create this script. ???  Can anyone help?

Thanx in advance

« Last Edit: 07 Oct 2003, 10:05:31 by B-2-0 »

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:To light or not to light
« Reply #1 on: 07 Oct 2003, 10:52:19 »
Code: [Select]
_firearray = [fire1,fire2,fire3,...]
?(daytime > 19) || (daytime < 5): "_x inflame true" foreach _firearray
exit

Try if that should work.
Not all is lost.

B-2-0

  • Guest
Re:To light or not to light
« Reply #2 on: 08 Oct 2003, 04:23:29 »
Ok, today is OFP take the piss out of B-2-0 day!!

Thx for the reply Artak!

The snippet u made didn't work so i played around with it a little and got some strange results.

_firearray = [fire1,fire2,fire3,fire4,fire5]
?(daytime > 19) || (daytime < 5): "_x inflame true" foreach _firearray
exit

Day = On
Night = On
--------------------------------------------

_firearray = [fire1,fire2,fire3,fire4,fire5]
?(daytime > 19) || (daytime < 5): "_x inflame false" foreach _firearray
exit

Day = On
Night = Off
---------------------------------------------

_firearray = [fire1,fire2,fire3,fire4,fire5]
?(daytime < 19) || (daytime > 5): "_x inflame true" foreach _firearray
exit

Day = On
Night = On
---------------------------------------------

_firearray = [fire1,fire2,fire3,fire4,fire5]
?(daytime < 19) || (daytime > 5): "_x inflame false" foreach _firearray
exit

Day = Off
Night = Off
----------------------------------------------

Now common sense told me that one of these four ways should work as there are only 4 possible outcomes...on on, off off, on off and off on (the one i want) but nooooo, OFP want's to take the piss out of me once again...lol

Anyone have the answer?

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:To light or not to light
« Reply #3 on: 08 Oct 2003, 08:34:47 »
Did you put it in the Init.sqs or somewhere else where it's loaded before the briefing?

I keep reading the code over and over again and keep thinking it should work.

The one thing I can think of is that you have daytime between 05:00 and 19:00 in the editor, and as the player chooses night, the script still uses the time from editor first.. so.. umm.. what if you'd put a short delay to the start to let the daytime starting param kick in.

It's pretty thin, but maybe, just maybe..  :P
« Last Edit: 08 Oct 2003, 08:37:52 by Artak »
Not all is lost.

Josef

  • Guest
Re:To light or not to light
« Reply #4 on: 08 Oct 2003, 23:33:30 »
Do you have accelerated time or somthing?

I suppose that when the scripts fail, the triggers come to the rescue!

Make a trigger, triggered by timeout, and simply make it turn on the fires by setting a global variable to true...have it another script set the variable to false, 12 hrs after the first is activated(Or whatever the night is...)

You only need 3 triggers to do it...

B-2-0

  • Guest
Re:To light or not to light
« Reply #5 on: 09 Oct 2003, 05:20:30 »
Ok, i am a complete idiot...lol ;D

I only went and had the fires still inflame true in their init fields didn't i ::)

Works fine know, thanx Artak :)