Dynamic Color Question

Questions and answers about the how and why of making maps.
Post Reply
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Dynamic Color Question

Post by ducatiwannabe »

Does anybody know how to make it so it flashes white really quick at random times or what SEEMS at random times? Say such as...a light flashing out when a bulb dies. Or perhaps lightning? Like that.
User avatar
^nightmare^
Private First Class
Private First Class
Posts: 1264
Joined: Sun Feb 20, 2005 7:14 pm
Location: Alabama
Contact:

Post by ^nightmare^ »

Im not sure, but this might help you.
http://www.bzflag.org/wiki/MapMaking
-goodluck
Need bzflag help? Try looking here: http://www.freewebs.com/bznightmare/map ... aghelp.htm
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1405
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

are you trying to start off people's epilepsy DW??? :)
"Life is what happens to you while you're busy making other plans." - John Lennon
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

I'm just trying to test something :/ I'm not having much luck. Just testing now. Trepan, or somebody? How would I make it do that with Dynamic Color?
User avatar
Red Cobra
Private First Class
Private First Class
Posts: 184
Joined: Mon Feb 21, 2005 11:37 pm

This could help

Post by Red Cobra »

This could help. I dont know what dynamic colors are but here is a website that has dynamic solora and a couple of comands for them.

http://my.bzflag.org/cgi-bin/man/man2html?5+bzw
Cop@R3lax
Trusted@Viper
User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

Answer?

Post by person1 »

I know how to do dynamicColor's but I do not understand what you would like it to do.

My understanding:
You want it to go from one color to white and back in a very short time.

example
red (for 5 seconds) -> white (for 0.5 seconds) -> back to red (or another color)

or

go between white and clear?

Is this anything like you would like it to do?
Image
Image
I not just any person, I am person1
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

i got this one in a map pack i download. dont know if it helps...
Attachments
flashingbox.txt
this is a box that has an area that falshes diffrent colours with a rock border
(11.44 KiB) Downloaded 181 times
Image
Sig Made By AlliedArmour

TGPH
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

Thanks all. I kind of gave up on trying to make it look like lightning was flashing.

Oh, and thanks person1, I did want it to do that...but at random times. For lightning :)
User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

do u want help?

Post by person1 »

I know how to do that, if you would like I will write up some code for you.
Image
Image
I not just any person, I am person1
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

I would appreciate that! Would you please?
User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

DynamicColor Lightning

Post by person1 »

ducatiwannabe: this may not be sophisticated enough, but I hope this will give you something to work with. (not random)

The following code will generate a lightning effect on an object.

Code: Select all

# Person1 (11/8/05)
# Insert this code into you bzw file
# You are free to remove comments, etc.

# This defines the dynamiceColor used to generate the lightning effect (note: reference by
# the name 'lightning' (may change)

dynamicColor
  name lightning
  
  # Begin Color Set: sets red, blue, green to 1 or 255 rgb each
  # This causes the object to be white
  red limits 1 1
  blue limits 1 1
  green limits 1 1
  # End Color Set
  
  # This causes 'alpha' (transparency) to flash off for 0.1 seconds every 5 seconds
  alpha clampDown 5 0 4.9 # period, offset, width
end


# Material is necessary to load a dynamicColor

material
  name lightning
  dyncol lightning
end

# This is a simple box that the lightning effect is applied to
# You can change this to any object (ex. a mesh you create looking like lightning)
# Remember if you use a regular object such as: box, pyramid, sphere you must find the
# mesh names (ex. meshbox, meshpyr, ...)

meshbox
  position 0 0 0
  size 10 10 10

  # Use this to apply the lightning dynamicColor (defined above) to your object
  matref lightning
end
I included lots of comments so that anyone else viewing this may be able to use and modify this code.


To change the time period between lightning strikes use the following:

Line to change (18): 'alpha clampDown 5 0 4.9'

Rewrite: 'alpha clampDown 5 0 4.9' to 'alpha clampDown a 0 b'

Forumula: b = a - 0.1
Where: a = The number of seconds between each lightning strike



NOTE: I wish someone would have done this for me. (bzflag needs better documentation)
Last edited by person1 on Wed Nov 09, 2005 5:50 pm, edited 1 time in total.
Image
Image
I not just any person, I am person1
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

I thank you greatly for this and taking the time! I tryed it out but it didn't quite work like I wanted it to. I've got lots of settings to mess around with to see if I can get it to work. Thanks.
User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

Just wondering...

Post by person1 »

What did you not like, just curious.
Image
Image
I not just any person, I am person1
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

This is probably a little closer to what you want.
I'd suggest making your own lightning geometry,
the one provided was done in about 45 secs
(and with abuse of the artistic license).

P.S. The seqeunce pattern was generated using
a small C program that output 2''s 10% of the time
based on the rand() function.
Attachments
lightning.bzw
(13.41 KiB) Downloaded 182 times
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

Thanks trepan, this is kind of what I was looking for! I was hoping to somehow make the sky flash white and then go back to dark but this works too. Is there anyway to spread it out over the map? This isn't neccesary. Perhaps make groups? Such as:

group lightning
position 228 228 0
end

And, one last thing, is there a way to make it not do lightning as MUCH. Meaning do it less often? Thanks, this is awesome!

This made me consider something...I wonder if this technique could be used to make a tornado for a Wizard of Oz map or something :D
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

If you want the whole sky to flash, you can either write a script
that modifies the BZDB _skyColor variable, or use a large mesh
that covers the entire sky (with a dyncol).

You want it less often? Replace some of the 2's with 0's.
User avatar
ducatiwannabe
Private First Class
Private First Class
Posts: 3258
Joined: Tue Aug 10, 2004 3:55 pm
Location: Planet Earth
Contact:

Post by ducatiwannabe »

Thanks, Trepan! If I knew how to do coding I'd mess with the skycolor thing. This is awesome!
User avatar
person1
Private First Class
Private First Class
Posts: 159
Joined: Wed Sep 14, 2005 3:44 am
Location: Omaha, Nebraska

Very nice.

Post by person1 »

Very nice Trepan. I see you are more skilled than me, I never thought I was very good.
Image
Image
I not just any person, I am person1
Post Reply