Jump to content
Sign in to follow this  
vitoal125

simulating a light at night via flare

Recommended Posts

okay, I'm trying to make a base with a light on Kolgujev. Im doing this with a script that camcreates a flare and then places it at the height I want near the base, problem is, the flare only lasts for about 20 seconds. Is there a way to make them last longer or do I have to do it like I'm doing now and use another script to run the flare script again?

;this is the script that calls and repeats the light script

#start

player exec "lights1.sqs"

~15

goto "start"

exit

;this is the actuall script that creates the light

thelight = "flareyellow" camCreate [getpos light1 select 0, getpos light1 select 1, (getpos light1 select 2)+5000]

~2

#start

thelight setpos [getpos light1 select 0, getpos light1 select 1, (getpos light1 select 2) +45];

~.005

goto "start"

exit

Share this post


Link to post
Share on other sites

forgot to mention, light1 is the invisible helipad where I want the light to be over.

if anyone has a better way to do this or already has a script that fulfills this purpose, please post it. Much thanks in advance.

Share this post


Link to post
Share on other sites

I played around with this a while ago. You have to keep making new flares. On top of this, the flares take a little while to start making light (maybe 2 seconds) so you have to create them early and keep them offscreen for a while before you bring them in.

Do the new create commands let you create objects? If you could create a real lamppost that would of course be a much better solution...

Share this post


Link to post
Share on other sites

hmmm... well, this is kinda what I'm doing right now by just repeating the script, but it looks kinda funny because the light appears, hovers for about 15 seconds, then falls to the ground, then reappears at the spot again.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Do the new create commands let you create objects?  If you could create a real lamppost that would of course be a much better solution...<span id='postcolor'>

You can create Buildings with createVehicle, but AFAIK no StreetLamps (light1 = "StreetLamp" createVehicle [...]). "StreetLamp" seems to be outside of the regular OFP Object Tree.

I would like BI to make some Light Objects in the Future, because at night it is really dark at some Bases; and I don't want any inofficial AddOns like the "StreetLamp" AddOn.

Share this post


Link to post
Share on other sites

I got it to work like you would expect. Even got it to do some cool things like lights that blink colors. I was going to try to make runway lights with them, but then I found out that flares make really annoying lights (with that lensflare thing) plus you can't have them too close to the ground or they go out (I have to keep them about head height) so it didn't look right anyway. If you want the scripts I could mail them to you...

Share this post


Link to post
Share on other sites

well, if found something that works pretty good, so I thought I'd post it for others with my same problem. It involves two scripts

;this is the first script called light1.sqs

;light1 is an invisible H that is where the light is going to appear over

add1 = 0

thelight = "flareyellow" camCreate [getpos light1 select 0, getpos light1 select 1, (getpos light1 select 2)+5000]

~2

#start

thelight setpos [getpos light1 select 0, getpos light1 select 1, (getpos light1 select 2) +45]

~.005

add1 = add1 + 1

? (add1 == 200): player exec "lights1a.sqs"

? (add1 > 300): goto "end"

? (add1 < 1): goto "end"

? (turnoff > 0): goto "end"

goto "start"

#end

thelight setpos [0, 0, -1000]

thelight = objnull

exit

;this is the second script lights1a.sqs

add2 = 0

thelighta = "flareyellow" camCreate [getpos light1 select 0, getpos light1 select 1, (getpos light1 select 2)+5000]

~2

#start

thelighta setpos [(getpos light1 select 0) + 0.05, (getpos light1 select 1) + 0.05, (getpos light1 select 2) +45]

~.005

add2 = add2 + 1

? (add2 == 200): player exec "lights1.sqs"

? (add2 > 300): goto "end"

? (add2 < 1): goto "end"

? (turnoff > 0): goto "end"

goto "start"

#end

thelighta setpos [2, 2, -1000]

thelighta = objnull

exit

hope this helps others. if there is a less complex way, I'm still open ears. by the way, to turn the light off, just use a trigger or some method in game to make add2 and add1 less than 0. to turn it back on, execute either script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×