Dynamic Color Question
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
Dynamic Color Question
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.
- ^nightmare^
- Private First Class
- Posts: 1264
- Joined: Sun Feb 20, 2005 7:14 pm
- Location: Alabama
- Contact:
Need bzflag help? Try looking here: http://www.freewebs.com/bznightmare/map ... aghelp.htm
- Spazzy McGee
- Sergeant Major
- Posts: 1405
- Joined: Mon Mar 21, 2005 4:59 pm
- Location: Planet MoFo, Sheffield Division; United Kingdom
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
This could help
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
http://my.bzflag.org/cgi-bin/man/man2html?5+bzw
Cop@R3lax
Trusted@Viper
Trusted@Viper
Answer?
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?
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?
I not just any person, I am person1
- The Knights Who Say Ni
- Private First Class
- Posts: 556
- Joined: Mon Sep 26, 2005 7:21 pm
- Location: Uplyme, England
- Contact:
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
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
do u want help?
I know how to do that, if you would like I will write up some code for you.
I not just any person, I am person1
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
DynamicColor Lightning
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.
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)
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
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.
I not just any person, I am person1
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
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.
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
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
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
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
- ducatiwannabe
- Private First Class
- Posts: 3258
- Joined: Tue Aug 10, 2004 3:55 pm
- Location: Planet Earth
- Contact:
Very nice.
Very nice Trepan. I see you are more skilled than me, I never thought I was very good.
I not just any person, I am person1