Lightning

From The DarkMod Wiki
Revision as of 10:03, 17 January 2009 by Flanders (talk | contribs) (adding lightning to your map)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

written by Flanders

Prefab and settings

Here we use func_fx’s to simulate random interval lightning. Start by loading up the tdm_sky_storm_thunder prefab in prefabs/nature/skyboxes. The func_fx underneath the skybox is used to create a light and a sound inside your map. Move it to a position high in your map where you want the flash to appear. The func_fx in the skybox makes a flash in the sky.

To trigger the lightning a trigger_timer is used. The time between triggering is a random time between “wait” ± “random” in seconds. The trigger_timer targets the func_fx’s. The fx effects are defined in thunder.fx in the fx folder. The fx that is used can be set with the “fx” property.

  • fx/thunder.fx for standard lightning
  • fx/thunder_distant.fx for distant lightning (dim light, long time between flash and sound)
  • fx/thunder_close.fx for close lightning (bright light, immediate sound)

These are for the fx inside the skybox:

  • fx/thunder_skylight.fx
  • fx/thunder_skylight_distant.fx
  • fx/thunder_skylight_close.fx

Skybox

Here there is a short explanation on how to change the appearance of the used skybox.

To change the colour of the sky select the big light and edit its properties. To change the colour of the small lights in the sky edit the two smaller lights. To make the clouds move at a different speed select the func_static with the cloud texture and add “shaderparm3” to it and give it a value (0.5 ~ 3). You can change the size of the clouds with the surface inspector, as long as you make sure it fits a rounded number of times so that there are no seams when the texture scrolls. As you can see, the whole skybox can be edited by editing the objects in the prefab skybox. The sky that is used in your map is just a projection of the stuff surrounding the info_portalsky.