Home   Help Search Login Register  

Author Topic: Lightning Bugs! (Fireflies)  (Read 6515 times)

0 Members and 1 Guest are viewing this topic.

Offline Pilot

  • Contributing Member
  • **
Lightning Bugs! (Fireflies)
« on: 09 Jul 2005, 01:12:53 »
Here is a sure winner for the most useless script award ;D.  I have been playing around with the drop command and came up with this.  This script produces "lightning bugs" more properly known as fireflies (am I the only one that calls them lightning bugs? :P).  Of course, this script is meant to be used for night-time missions ::)  I think it adds a lot of atmosphere to the OFP night world, but that may be me.  Try it out and tell me what you think.

Addons Required: None
Useable in MP: I have no idea

Call the script in the following format:
[NumberOfFireflies, RadiusAroundPlayer] exec "firefly.sqs"

NumberOfFireflies is the number of fireflies you want created at any one time
RadiusAroundPlayer is the radius around the player you want the fireflies to be created.

-Student Pilot

Get V1.45 below!
« Last Edit: 19 Jul 2005, 04:07:10 by Student Pilot »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Lightning Bugs! (Fireflies)
« Reply #1 on: 09 Jul 2005, 04:07:31 »
Heh. I'd hardly call this a useless script. It's actually a pretty nice effect. I'm surprised it hasn't been done before (unless it has....), considering how visible and plentiful those things seem to be at night. Then again, we don't have those around my area, and maybe most people don't.

The effect looks great. I honestly was ready to look at the script and give you a ton of comments (based on my "expert opinion" after having only seen them a few times), but it looks awesome.

I do have a few suggestions, however:
  1) Make the flies appear ALL around the player, not just in front of him. It looks pretty odd when I turn my head and don't see any behind me (let alone when using the command view).
  2) Add a parameter to determine the frequency of the flies (the random delay).
  3) Add another parameter that determines what object the flies will be centered on. This way an editor could anchor the flies around a specific area on the map, or could use the script during cutscenes.
  4) Add a way to exit the script (via a global variable, or other means).

Also, one more thing. I thought fireflies (and I have heard them called "lightning bugs") were greenish? The ones I've seen were that color, at least. Are there different species with different colors or something?

Nice job. :)

EDIT

Ack! I just saw the 'bugs' up close, and they look terrible! I'd suggest you use the "kouleSvetlo" particle instead of the "cl_fire" one. It looks much nicer, although you might need to re-adjust the size and color of the particles.

« Last Edit: 09 Jul 2005, 04:13:38 by General Barron »
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #2 on: 09 Jul 2005, 14:23:39 »
Quote
1) Make the flies appear ALL around the player, not just in front of him. It looks pretty odd when I turn my head and don't see any behind me (let alone when using the command view).
Oh, I never thought the player would turn his head ::).  Ok, that is an easy fix

Quote
2) Add a parameter to determine the frequency of the flies (the random delay).
Ok, that should also be easy

Quote
3) Add another parameter that determines what object the flies will be centered on. This way an editor could anchor the flies around a specific area on the map, or could use the script during cutscenes.
Good idea

Quote
4) Add a way to exit the script (via a global variable, or other means).
Ok, I'll look into it

Quote
I thought fireflies (and I have heard them called "lightning bugs") were greenish? The ones I've seen were that color, at least. Are there different species with different colors or something?
I'm glad I'm not the only one that calls then lightning bugs ;D.

GREEN?!!  Whoa, I would love to see those! ;D  The fireflies in Indiana all seem to appear yellowish.

Should I add an option for different colors then?

Quote
Ack! I just saw the 'bugs' up close, and they look terrible! I'd suggest you use the "kouleSvetlo" particle instead of the "cl_fire" one. It looks much nicer, although you might need to re-adjust the size and color of the particles.
I was afraid they would be seen up close.  I never thought about using kouleSvetlo for them.  Thanks for the suggestion :)

-Student Pilot

EDIT:
I have been doing some looking around and found that the wavelength og the light that is transmitted by fireflies is between 510 and 670 nanometers.  Apparently that equates from pale yellow to reddish green ::)
« Last Edit: 09 Jul 2005, 14:42:10 by Student Pilot »

bdfy1

  • Guest
Re:Lightning Bugs! (Fireflies)
« Reply #3 on: 09 Jul 2005, 16:00:58 »
Quote
Should I add an option for different colors then?
Yes, with black color we will get usual flies :)

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re:Lightning Bugs! (Fireflies)
« Reply #4 on: 09 Jul 2005, 16:18:31 »
http://ase.tufts.edu/biology/Firefly/

 ::)

can't find anything about any different colour of fireflies :-\

http://www.backyardnature.net/lightbug.htm

seems there's a diffrence in how the different species flash :P
« Last Edit: 09 Jul 2005, 16:22:12 by Garcia »

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #5 on: 09 Jul 2005, 16:56:45 »
@bdfy1
I'm not sure how the flies would look in the daytime as black flies.  These fireflies are created for about one second, then are destroyed.

@Garcia
Thanks for the links.  I did find the second page on my own, but not the first.

I remember going through all those pages and thinking to myself, All I want to know is what color the light is! ;D ::)  Fortunately I was able to find some page that gave the range in nanometers of the waves of light produced by the fireflies.  The color supposedly ranges from pale yellow to reddish-green.

@All
I have posted a new version of the script in the first post.  I have changed the type of particle from cl_fire to kouleSvetlo.  It looks much better that way.  I have also added two more parameters to the script.  See the readme for more info.

-Student Pilot

EDIT:
I have also added a Global variable, that when set to false, exits the script.  The variable is:
PILOT_Firefly

This is not mentioned in the readme, I will add it at a later date.

EDIT EDIT:
I have posted V1.2 in the first post.  I thought the fireflies were flying way too fast so I slowed them down a bit.  Other than that no other changes have been made.
« Last Edit: 09 Jul 2005, 17:43:14 by Student Pilot »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Lightning Bugs! (Fireflies)
« Reply #6 on: 09 Jul 2005, 18:58:01 »
nice script but dont they last a little short, i see them and they dont flash on and off every second, they stay on and fly around in random directions, or am i mistaken.


Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #7 on: 09 Jul 2005, 19:13:34 »
@pengiunman
Well, the fireflies here in Indiana flash on, stay on for a second or two, then turn off.  But maybe the fireflies in Indiana are messed up, they wouldn't be the only thing ::)

I have added another color to my firefly script (green) and will post the new version sometime today.  I just have to iron out any bugs I might find (lol, get it, iron out any bugs, hahahahaha. :tomato:  Oi, I need to get more sleep ::))

-Student Pilot

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #8 on: 09 Jul 2005, 21:09:37 »
Ok, here is V1.3 of my firefly script!!!  (I know all of you are just so excited :P)

Changes include:
I have increased the average lifetime of each bug by about .4 seconds.
I have added green fireflies!
I have added one more parameter to the script.

call the script like this:
[NumberOfFireflies, DistanceFromObject, Frequency, Object, "Color"] exec "Firefly.sqs"

NumberOfFireflies is the number of fireflies you want created at any one time
DistanceFromObject is the radius around the object you want the fireflies to be created.
Frequency is the random time between each set of fireflies being created.  Eg: If a 1 is entered, the game will wait between 0 and 1 seconds to create the nect group of fireflies
Object is the object you wish to have the fireflies fly around
"Color" is the color of the fireflies.  It can be either "Yellow", "Green", or "Mixed".  This is a string and requires the quotes to work properly.  Not case sensitive.

I have never seen green fireflies before, so if they look bad, tell me how to improve them.

-Student Pilot
« Last Edit: 11 Jul 2005, 04:34:43 by Student Pilot »

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Lightning Bugs! (Fireflies)
« Reply #9 on: 10 Jul 2005, 01:15:42 »
Neat little script! I like the way you actually get the illusion that they're all around you, especially so when you're moving.

Halflight is a good choice for drop particle, undoubtedly the best for what you are trying to achieve

The only suggestion I might make, and it's small, is that you increase the weight of the fireflies slightly, because most of them seem to be travelling straight up, and few of them stay at the same level, or move down.

Apart from that....  :thumbsup:

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #10 on: 10 Jul 2005, 04:20:41 »
@Fragorl
The suggestion you made touched upon a part of the script I was a bit uneasy about.  I will add a little bit more weight to them so they don't all rocket skywards :P

-Student Pilot

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #11 on: 11 Jul 2005, 04:34:26 »
Version 1.35 is here.

The only change is:
I have increased the weight of the fireflies slightly.  Although many still fly upwards, more of the fireflies will fly sideways or stay where they are.  I think the effect is quite realistic (at least from what I see here in Indiana).  Again, please feel free to make any suggestions or criticisms.

-Student Pilot
« Last Edit: 14 Jul 2005, 14:11:53 by Student Pilot »

klavan

  • Guest
Re:Lightning Bugs! (Fireflies)
« Reply #12 on: 14 Jul 2005, 13:05:19 »
Nice script Student Pilot! I'm going to put it in my new mission.
Again, good work.
Klavan

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #13 on: 14 Jul 2005, 14:11:11 »
Thanks klavan!

@All
I made a few more adjustments, and am now releasing V1.4 of the firefly script.  Changes are:
1: Lifetime has been adjusted, now the fireflies aren't lit as long.  I was outside yesterday (that doesn't happen too often ::)), and realized my scripted fireflies stay lit up too long.  If anyone thinks I made a mistake by doing this, tell me and I will change it back.
2: I adjusted the height that the fireflies will appear at.  Now they can range from .7 meters to 2.3 meters.

And now for a poll, the question:
Who thinks Student Pilot is spending way too much time adjusting this script?
 ::)

-Student Pilot
« Last Edit: 18 Jul 2005, 22:50:45 by Student Pilot »

klavan

  • Guest
Re:Lightning Bugs! (Fireflies)
« Reply #14 on: 14 Jul 2005, 15:10:33 »

And now for a poll, the question:
Who thinks Student Pilot is spending way too much time adjusting this script?
 ::)

-Student Pilot

Not me! Thinking to all those night missions that take place in empty, flat environments..... This script, just like Petroizki's seagulls script and the recent dynamic grass scripts and addons would make the difference in terms of atmosphere and even gameplay if used with cognition of cause.
Downloading version 1.4 now.
Klavan

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #15 on: 14 Jul 2005, 15:38:36 »
I have an idea for the weight thing

how about randomizing the weight slighty (if you haven't already) so that some would be a little too heavy and drop, some would be too light and go up, and some would be just right and floa around sideways

(lol, its the three bears! if you remember that kids story....)

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #16 on: 15 Jul 2005, 02:57:41 »
Lol, yeah, I remember that story.  

Good suggestion!  I will play around with it and see what I get

-Student Pilot

Grendel

  • Guest
Re:Lightning Bugs! (Fireflies)
« Reply #17 on: 15 Jul 2005, 18:12:37 »
[] exec "reply.sqs"

#relply_loop


;Nice!  I haven't seen a firefly since I lived on the East Coast, but they look perfect.

;Ahhhh the drop command...once you start you can't stop.

?(more_constructive_comments):goto "reply_loop"

;Can you tell I've been spending too much time scripting lately?
exit

 :thumbsup:

-Grendel


« Last Edit: 15 Jul 2005, 18:13:26 by Grendel »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #18 on: 15 Jul 2005, 18:31:46 »
[uselesscomment]

Quote
[] exec "reply.sqs"

#relply_loop


;Nice!  I haven't seen a firefly since I lived on the East Coast, but they look perfect.

;Ahhhh the drop command...once you start you can't stop.

?(more_constructive_comments):goto "reply_loop"

;Can you tell I've been spending too much time scripting lately?
exit

obviously not, it won't loop! (check your spelling ;D)

and IMO it should be:
#reply_loop


hint "Nice!  I haven't seen a firefly since I lived on the East Coast, but they look perfect."

~3

hint "Ahhhh the drop command...once you start you can't stop."

?(more_constructive_comments):goto "reply_loop"
exit


 ;D ;) ;D ;) ;D :D :D :D


[/uselesscomment]
« Last Edit: 15 Jul 2005, 18:33:04 by Triggerhappy »

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #19 on: 16 Jul 2005, 04:15:14 »
I think you both have been spending too much time scripting ;D

Thanks for the comments!

@All
I won't be able to update the script at all.  I have a few personal matters to attend to (real life has a way of doing that ::)), and I have to stay off the internet for awhile.  I will pop in and out occasionally, but all my projects are halted for the time being. :'(

-Student Pilot
« Last Edit: 16 Jul 2005, 04:15:56 by Student Pilot »

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #20 on: 18 Jul 2005, 22:50:13 »
I finally found some time to finish up the script.  Get V1.45 from the first post.  Changes include:
Slightly Randomized weights
Script is now commented

I have also updated the readme slightly, if I have forgotten any of you who beta-tested, please tell me and I will add your name to the list

-Student Pilot

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #21 on: 18 Jul 2005, 22:56:18 »
lol pilot if you don't mind i made my own version of your script, with more randomized weight, lifetime, and movement.

I'll attach mine and then go take a look at yours

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #22 on: 18 Jul 2005, 23:10:37 »
@Triggerhappy
No, I don't mind at all.

Your version isn't bad, in fact, it is probably better than mine.  One thing about it caught my attention.  The fireflies seem to fly awfully fast.  In my experience, fireflies are slow fliers.  I don't know, maybe it's just the Indiana fireflies ::)

-Student Pilot

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #23 on: 18 Jul 2005, 23:12:50 »
hmmm.. i didn't think they were that fast

I'll take a quick look at it

when i watch them, i only see a few going very fast, at the extreme of the randomness
the rest seem to float around normally
« Last Edit: 18 Jul 2005, 23:14:55 by Triggerhappy »

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #24 on: 18 Jul 2005, 23:14:20 »
hmm
Quote
m.. i didn't think they were that fast
Well...compared to mine they are ::)

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #25 on: 18 Jul 2005, 23:15:13 »
true

editted other post while you were posting ^
« Last Edit: 18 Jul 2005, 23:15:46 by Triggerhappy »

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #26 on: 18 Jul 2005, 23:20:59 »
new version, slowed them down a little bit, though they are still faster than yours

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #27 on: 18 Jul 2005, 23:24:06 »
Quite nice!  I like your version.  

-Student Pilot

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #28 on: 18 Jul 2005, 23:27:11 »
yay! ;D

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #29 on: 18 Jul 2005, 23:30:01 »
would you like me to put it on the pending list or do you want to?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #30 on: 18 Jul 2005, 23:34:53 »
btw, I don't even get fireflies here (florida) but I have seen them and my grandparents house in tennessee

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #31 on: 18 Jul 2005, 23:44:14 »
Quote
would you like me to put it on the pending list or do you want to?
You can do it.  I have to get off the computer now.

-Student Pilot

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Lightning Bugs! (Fireflies)
« Reply #32 on: 18 Jul 2005, 23:51:11 »
ok, bye bye :'(

Offline Pilot

  • Contributing Member
  • **
Re:Lightning Bugs! (Fireflies)
« Reply #33 on: 19 Jul 2005, 04:06:31 »
Thanks for the improvements, and also for submitting the script, Triggerhappy!

@All
The script is now pending, get it here.

I'll see you guys later from time to time.

-Student Pilot

Topic Locked