Game Development Community

Rain and Lightning

by Lars Boldt · in Torque Game Engine · 04/20/2004 (6:29 pm) · 4 replies

new Precipitation(Rain) { 
      position = "0 0 0"; 
      rotation = "1 0 0 0"; 
      scale = "1 1 1"; 
      dataBlock = "HeavyRain"; 
      percentage = "0.5"; 
      color1 = "0.600000 0.600000 0.600000 0.500000"; 
      color2 = "-1.000000 0.000000 0.000000 1.000000"; 
      color3 = "-1.000000 0.000000 0.000000 1.000000"; 
      offsetSpeed = "0.25"; 
      minVelocity = "0.25"; 
      maxVelocity = "1.5"; 
      maxNumDrops = "2000"; 
      maxRadius = "125"; 
      locked = "true"; 
   };

   new Lightning() {
      position = "0 0 200";  //move the lightning block with the world editor
      rotation = "1 0 0 0";
      scale = "624 688 500";
      dataBlock = "LightningStorm";  //this links to the lightning.cs datablock
      strikesPerMinute = "50";
      strikeWidth = "2.5";
      chanceToHitTarget = "100";
      strikeRadius = "50";
      boltStartRadius = "20";
      color = "1.000000 1.000000 1.000000 1.000000";
      fadeColor = "0.10000 0.10000 1.000000 1.000000";
      useFog = "1";
      locked = "true";
   };

Problem number 1) My lightning works fine, but it doesn't turn blue when it fades, it's all white all the time, why?

Problem number 2) I've tried increasing the values in the rain section to increase the number of raindrops, but I can't seem to get the desired effect, or any at all. I want the rain to look like in the Torque Feature Demo, what settings should I use?

Off topic question: The FPS meter ingame, what is the mspf value?

In advance thanks!

Lars

#1
04/20/2004 (11:36 pm)
Fixed the rain, still wondering why the lightning doesn't turn blue tho :)

Lars
#2
04/21/2004 (6:42 am)
If you use d3d then change to opengl becuase many things
dont work like they should i direct3d mode.
Things like water,lightning works better in opengl.
Hope this helps its the only thing i cant think of for now.

To make the rain looks like it rains moore change this
maxRadius = "125"; to 20 or something.
and activate these and change them to a desire effect.
color2 = "0.500000 0.500000 0.500000 1.000000";
color3 = "0.500000 0.500000 0.500000 1.000000";
#3
04/21/2004 (10:15 am)
Holy crap!

That did the trick, for some reason it was set to D3D. With OpenGL I get correct lightning, and lots of other cool effects I didn't even know was there, aswell as a big increase in framerate!

Thanks mate :)

Lars
#4
12/01/2012 (12:39 pm)
well every post i have found for lightning not working is from 2004 to 2006.

Its 2012 now and the environmental.cs for lightning is gone from afx2.0

I have a disk with 3 gigs of assets and scriptlets from 2004 to now.
I beleive i have the .exe that runs and shows all the scripts with the water fountain datablock and many others if i can dig thru this stuff and find it , i will upload it somewhere and make a new post with the url i uploaded it to.

It goes from tge1.2 to tgea to tgeshader, to now 2012.

later all and good luck with all your projects.
Thomas Champion.