Author Topic: Default lightning?  (Read 936 times)

I remember that Blockland used to have lightning. Does that still work?
Yes, very



I was browsing this topic and found the lovey snippet above. It tells of a default lightning datablock leftover from days yonder. Anyone have any clues on how to actually use it? Not much else was said in that thread.

I'd suggest PMing Port.

datablock LightningData(MyLightningData)
{
    a = 1; // A datablock needs to have at least one field (parser limitation)

    // Optional fields:
    //   strikeSound = ...;
    //   strikeTexture[0] = ...;
    //   ...
    //   strikeTexture[7] = ...;
    //   thunderSounds[0] = ...;
    //   ...
    //   thunderSounds[7] = ...;
};

new Lightning(MyLightning)
{
    datablock = MyLightningData;

    // Optional fields:
    //   boltStartRadius = ...;
    //   color = ...;
    //   fadeColor = ...;
    //   strikeRadius = ...;
    //   strikesPerMinute = ...;
    //   strikeWidth = ...;
    //   useFog = ...; // only for bitmaps
};

MyLightning.strikeObject(object);
MyLightning.strikeRandomPoint();
MyLightning.warningFlashes(?);

Isn't there an add-on that re-adds lightning? I recall i made one before v21, but hasn't a new one been made since then? It might still require using the mission editor though

Gravity Cat made an add-on that uses lightning: https://forum.blockland.us/index.php?topic=107991.0 (ctrl + f "Thunderstorm"), which works albeit for lightning not always being visible when you're not looking in certain direction upward.

The thundershot has a neat lightning effect that closely resembles the picture.
You can probably take the code from there.