Fading Values: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
(revert, spam)
Line 1: Line 1:
[http://stefan.burblers.info/ stefan] [http://humax-hd-ready.stroam.info/ humax hd ready] [http://downslip.info/index8_1000.html homepage] [http://grounge.wrawler.info/ grounge] [http://lofra-cucine.misserve.info/ lofra cucine] [http://burblers.info/index5_250.html url] [http://oroscopo-toro.unfeeble.info/ oroscopo toro] [http://automobili-toyota.unfeeble.info/ automobili toyota] [http://tv-lg-17.wrawler.info/ tv lg 17] [http://gigi-amoroso.indulger.info/ gigi amoroso] [http://ultras-samb.downslip.info/ ultras samb] [http://vans-sneakers-calzature-uomo.wrawler.info/ vans sneakers calzature uomo] [http://fisher-price.burblers.info/ fisher price] [http://exilim-z40.burblers.info/ exilim z40] [http://stroam.info/index6_666.html map] [http://grannies.misserve.info/ grannies] [http://batswing.info/index9_666.html link] [http://prepubescent-girls.batswing.info/ prepubescent girls] [http://filippina-pen-pal.indulger.info/ Filippina pen pal] [http://misserve.info/index4_250.html index] [http://winning-eleven-psp.misserve.info/ winning eleven psp] [http://i-belive-i-can-fly-kelly.misserve.info/ i belive i can fly kelly] [http://d-li7.wrawler.info/ d li7] [http://naked-sexy-pictures.unfeeble.info/ naked sexy pictures] [http://tucson-hyundai.downslip.info/ tucson hyundai] [http://kohl.unfeeble.info/ kohl] [http://flip-a-coin.misserve.info/ flip a coin] [http://psp-film.batswing.info/ psp film] [http://video-ick-berg.stroam.info/ video ick berg] [http://da-strada.burblers.info/ da strada] [http://age-of-kings.downslip.info/ age of kings] [http://kabi-khushi-kabhie-gham.indulger.info/ kabi khushi kabhie gham] [http://misserve.info/index2_666.html url] [http://indulger.info/index0_250.html index] [http://kwekwe.indulger.info/ kwekwe] [http://cosma.burblers.info/ cosma] [http://indulger.info/index8_666.html page] [http://www-goog-com.downslip.info/ www goog com] [http://unfeeble.info/index3_250.html map] [http://goldberg.downslip.info/ goldberg] [http://belo.stroam.info/ belo] [http://unfeeble.info/index8_666.html home] [http://bvgh.indulger.info/ bvgh] [http://surfin-usa-beach-boys.wrawler.info/ surfin usa beach boys] [http://carli-bank.batswing.info/ Carli bank] [http://goobles.downslip.info/ goobles] [http://downslip.info/index5_666.html link] [http://stroam.info/index4_250.html homepage] [http://video-auto.batswing.info/ video auto] [http://kawasaki-z-750-2004.unfeeble.info/ kawasaki z 750 2004] [http://portans.indulger.info/ portans] [http://video-free-sex.unfeeble.info/ video free sex] [http://y-3.stroam.info/ y 3] [http://dvd-x.batswing.info/ dvd x] [http://overlap.stroam.info/ overlap] [http://ben-aflek.wrawler.info/ ben aflek] [http://jose-jose.unfeeble.info/ jose jose] [http://indulger.info/index7_666.html site] [http://nova-domus-roma.misserve.info/ nova domus roma] [http://un-lavoro-da-grande.burblers.info/ un lavoro da grande] [http://burblers.info/index0_666.html site] [http://kenwood-kdc-psw9531.batswing.info/ kenwood kdc psw9531] [http://baby-blue.burblers.info/ baby blue] [http://tuner-tv-usb2.unfeeble.info/ tuner tv usb2] [http://we-shall-dance.unfeeble.info/ we shall dance] [http://pda-tom-tom.wrawler.info/ pda tom tom] [http://teda.wrawler.info/ teda] [http://atlas-15k-36gb.downslip.info/ atlas 15k 36gb] [http://blinde.indulger.info/ blinde] [http://usb-adapter.wrawler.info/ usb adapter] [http://misserve.info/index1_666.html site] [http://burblers.info/index5_250.html url] [http://hold-me-thrill-me-kiss-me.burblers.info/ hold me thrill me kiss me] [http://stroam.info/index0_666.html map] [http://in-quiete.burblers.info/ in quiete] [http://reflex-f70.batswing.info/ reflex f70] [http://indulger.info/index9_666.html site] [http://derki.wrawler.info/ derki] [http://acer-asp.unfeeble.info/ acer asp] [http://medak.batswing.info/ medak] [http://eos-50-e.burblers.info/ eos 50 e] [http://ls-4000-ed-nikon-scanner.unfeeble.info/ ls 4000 ed nikon scanner] [http://black-eye-pees.misserve.info/ black eye pees] [http://iron-maiden-the-early-days.burblers.info/ iron maiden the early days] [http://blue-4-ever.batswing.info/ blue 4 ever] [http://zoom-12x.wrawler.info/ zoom 12x] [http://www-oup-com-elt.wrawler.info/ www oup com elt] [http://misserve.info/index8_250.html homepage] [http://mouse-profumo.downslip.info/ mouse profumo] [http://lacie-20.downslip.info/ lacie 20] [http://plang.wrawler.info/ plang] [http://lung-cancer.batswing.info/ lung cancer] [http://dainese-crunch.unfeeble.info/ dainese crunch] [http://hub-100mb.wrawler.info/ hub 100mb] [http://batswing.info/index4_250.html site] [http://bau-bau.wrawler.info/ bau bau] [http://konta.wrawler.info/ konta] [http://sex-tv-hex-files.stroam.info/ sex tv hex files] [http://champion-league-theme.downslip.info/ champion league theme] [http://epson-c42.unfeeble.info/ epson c42]
This article describes an advanced effect in the [[Source]] engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.
This article describes an advanced effect in the [[Source]] engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.



Revision as of 09:01, 28 October 2007

This article describes an advanced effect in the Source engine, used to fade fog between different values, but it can be used for any entity that has a color value to change over time. You might also use that article to shift the Z-plane on a map to reduce the visibility, etc.

This trick is quite powerful, as it allows you to alter values that we usually leave static on a map: it would add game immersion.

Entities required

  • logic_relay is perfect to change game values or to abstract the routine. It also makes it much easier to duplicate the effect in other maps.
  • logic_timer is the basis of the effect, this entities is designed for measuring the time ticks.
  • math_counter keeps track of the evolution of the values uppon time for our effect.
  • math_colorblend or math_remap do essentially the same thing: they remap a value based on the input value.

Entity setup

logic_relay
targetname fade_value1
OnTrigger counter SetValue 0
OnTrigger timer 
OnTrigger timer Enable
logic_timer
targetname timer
RefireTime .2
StartDisabled 1
OnTimer counter Add .01
math_counter
targetname counter
max 1
OnHitMax timer Disable
OutValue colorblend InValue
math_colorblend
targetname colorblend
colormin "0 0 0"
colormax "255 255 255"
OutColor env_fog_controller SetColor

Process description

You trigger the logic_relay with another entity, or from the console with ent_fire fade_value1 trigger. This will start the sequence. The logic_relay starts the logic_timer and resets the math_counter. The logic_timer re-fires every .2 seconds, firing its output OnTimer, which adds .01 to the math_counter's stored value. The math_counter outputs its OutValue whenever its value is changed, which is in turn put into the math_colorblend. The math_colorblend takes the input value, which is a range from 0-1, and changes the colors based on that.

This range allows for 100 steps. The values that are setup are a compromise between making the blend really smooth and performance. It's slightly "steppy" because it happens only 5 times a second. It would be a lot smoother if you increased it to happen more often, with less of a step. You could do that by only adding .005 or a smaller value than the default .01.

Once the math_counter hits its maximum value (1) it will fire an output telling the logic_timer to disable. This effectively stops the sequence until the logic_relay is fired again.

OutColor and OutValue outputs both accept a parameter in Hammer, but make sure you do not specify one. The parameter they pass will be dynamically generated by the entity itself.

You can change OutColor on the math_colorblend to target any entity that will accept a color value, and it should work just the same. This entity rig can be further adapted to work with a math_remap, and used to fade between any two values, allowing you to affect the values of pretty much any entity in the game, and change them over time.