Author Topic: Why don't I get lightning?  (Read 338 times)

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Why don't I get lightning?
« on: September 08, 2013, 02:34:16 am »


               It's nothing special right now. I'll work more on giving it some robustness later. The whole module takes place in one city... so there isn't really any need for making the weather too crazy. I just want it to match in every area.

This works great... but I noticed something. When I switch to WEATHER_RAIN it seems to never show lightning or feel like a thunderstorm at all. Rain, in the area properties, is separate from Lightning so I imagine it might be that the SetWeather function won't change lightning at all. I just want to be sure. I'd like to actually have a chance for a real storm once in a while.

const float TIMER = 2400.0;

void TMPSetWeatherAllAreas()
{
object oModule = GetModule();
int iRand = d2();
switch (iRand)
   {
   case 0: SetWeather(oModule, WEATHER_CLEAR);
           break;
   case 1: SetWeather(oModule, WEATHER_RAIN);
           break;
   }
DelayCommand(TIMER, TMPSetWeatherAllAreas());
}
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Why don't I get lightning?
« Reply #1 on: September 08, 2013, 07:09:56 am »


               Not sure if there's much help I can offer except a few observations.

The weather system you are probably using I assume is custom, as such I believe you have to set the weather type, as well as a call for lightning and a percentage chance for it to occur. In what I'm seeing, I don't see calls for either one of those, so maybe it's a matter of fishing for those calls, as in the standard weather system for areas, you have to set them manually.

I'll dig a little and see what I can find.
               
               

               
            

Legacy_Rio420

  • Full Member
  • ***
  • Posts: 112
  • Karma: +0/-0
Why don't I get lightning?
« Reply #2 on: September 08, 2013, 07:20:29 am »


               I suspect that there's a vfx_tag for the lightning flash somewhere in the files, mixed with a:

PlaySound ("as_wt_thundercl3") and a EffectVisualEffect ( VFX_FNF_SCREEN_BUMP) or a _SHAKE and you could probably get the desired effect.
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Why don't I get lightning?
« Reply #3 on: September 08, 2013, 02:07:46 pm »


               SetWeather will not decide on lightning.

You have to specify a percentage in each area for lightning to happen.

EDIT - Area Properties - Visual - Customize Environment

When the weather script fires and the variable becomes WEATHER_RAIN, the area itself will check the % of lightning chance and set it as so. The downside to this is that each area will have its own percentage, so the lightning may not be consistent across multiple areas.

FP!
               
               

               


                     Modifié par Fester Pot, 08 septembre 2013 - 01:09 .
                     
                  


            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Why don't I get lightning?
« Reply #4 on: September 08, 2013, 03:35:17 pm »


               Rio- Yeah it's custom. I've not seen any VFX for the normal lightning except those from 'Call Lightning' which... though neat... is hardly typical of most thunderstorms I've been in.

As far as the screen shake and the thunder sound... I've played with those but the screen shake is just too much for casually walking around the streets of the city.

FesterPot- I figured it was the case that I would have to use the Area Properties. I was hoping that there was something I was missing in the SetWeather function that would ensure the lightning. The Snow/Rain/Lightning are separate parts. Are you saying that it will never 'Lightning' unless it's raining, right? Since this script I made checks every four hours and changes the weather it won't, say, start lightning during a clear day?
               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Why don't I get lightning?
« Reply #5 on: September 08, 2013, 03:40:37 pm »


               That's right.

Lightning percentage only works if it is raining. Although, there have been many of us who wanted the lightning flashes without the rain, to simulate a thunderstorm outside while inside of a haunted house or some other spooky interior location, but it doesn't work that way.

FP!
               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Why don't I get lightning?
« Reply #6 on: September 08, 2013, 03:42:26 pm »


               Well... that's a shame. Would be nice to be able to control the lightning. Thanks for the info!
               
               

               
            

Legacy_Khuzadrepa

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Why don't I get lightning?
« Reply #7 on: September 12, 2013, 03:37:52 pm »


               Lightning also works when it snows, just FYI. '<img'> But FP is spot on - no precipitation, no lightning '<img'>
               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Why don't I get lightning?
« Reply #8 on: September 13, 2013, 12:26:44 am »


               Thanks for letting me know. I don't use snow in this module, but it's good to know for future reference.