Any coherent guides to custom Lightning Effects?

Level 4
Joined
Apr 6, 2022
Messages
35
I found this:


but the guy lost me at "Open War3x.mpq and extract Splats\LightningData.slk"

How do I open this? Is there any clear, not ancient, guides to importing custom lightning effects? Can't seem to find anything helpful...
 
Level 4
Joined
Apr 6, 2022
Messages
35
The problem I'm having is in the asset manager I cannot change the file name from "war3mapImported\LightningData.slk" to "LightningData.slk" because the file already exists and thus I must access the mpq files, however following the tutorials on this website I run into a wall, because with mpq editors I go into the WC3 folders and cannot find mpq anywhere. Also, without the asset manager it does not allow me to change the full path to "Splats\LightningData.slk" because I cannot edit the field... HELP
 
Level 4
Joined
Apr 6, 2022
Messages
35
So I'm not paying for a microsoft account thus I cannot edit the file in excel, I can however open the file in google sheets and save it but how do I get it into the MPQ files?
 
Level 28
Joined
Jul 26, 2008
Messages
1,491
1743915139009.png


Just looking at the tool I linked above, you would go to game Storage, then it will auto pick the retail Wc3 folder. Then you can look inside all aspects of the MPQ, including Ubersplat for lighting effects. Not sure if I am missing part of the question or not.
 
Level 4
Joined
Apr 6, 2022
Messages
35
How do I get the file in that folder? I am able to edit it, save it and import it. However within the asset manager I cannot change the full path to "Splats\LightningData.slk" because it doesn't let me change the field. I was able to find LightingData within "\AppData\Local\Temp" and change the name, thus I was able to use the name "lightningdata.slk" in the asset manager, but I still cannot set full path to Splats\LightningData.slk, and still cannot use the imported effect.
 
Level 4
Joined
Apr 6, 2022
Messages
35
somehow I finally got the asset manager to accept the path "Splats\LightningData.slk" and then the game was crashing... now when I try to upload the lightning data I get this error. Also, here is a screenshot of the spreadsheet:
 

Attachments

  • stuck.png
    stuck.png
    3.3 KB · Views: 7
  • stuck2.png
    stuck2.png
    70.3 KB · Views: 7
Last edited:
It's possible that the tool you used to edit the SLK file led to it being corrupted or malformed, so Warcraft III may not recognize it.

I recommend using this SLK editor that is in our files section: War3Slk Edit version 1.05

Since your SLK file is likely already corrupted after you made the edits, I would recommend deleting the imported LightningData.slk from your map (make sure the game is no longer crashing), and then starting all over. Here are some instructions to follow:

Tools Required​

Step-by-Step​

  1. Open CascView
  2. Click the game storage icon and select Warcraft 3 Reforged (as tulee showed).
    1743973929911.png
  3. Go to war3.w3mod > Splats > LightningData.slk. Right-click and extract it somewhere on your computer (the default will be the "Work" folder where your CascView executable is located).
    1743974062202.png
  4. Open War3 Slk Edit and go to File > Open > Select your extracted LightningData.slk
    1743974200869.png
  5. Once it is open, select a row on the left-side to base your lightning off of (e.g. I selected "LEAS" a.k.a. "Magic Leash"), and then go to Edit > Copy Group. It will prompt you to put an ID for the new lightning you're creating. Choose a four letter code, e.g. WAVE.
    1743974445777.png
    1743974472933.png
  6. It might make the new row allll the way at the bottom. That is fine though. Scroll down to select it, and then you can start modifying the fields by selecting them in the right-window. In this case, you can follow the tutorial (How to Customise Lightning Effects) and update the comment, Dir, file, AvgSegLength, Width, NoiseScale, and TexCoordScale accordingly.
    1743974737225.png
  7. Once you're done, go to File > Save As > and save it anywhere (e.g. lightningdata_updated.slk).
  8. In your map, go to the Asset Manager, right-click, import file and select your updated SLK file. On the left-most column (where the "File Name" is), double-click the name and change the path to Splats\LightningData.slk.
    1743974892731.png
  9. Finally, if you want to test it out in the editor you can add a simple trigger. Create a lightning-type variable named "LightningType" and two points (e.g. LightningLoc1 and LightningLoc2), and set-up a trigger like the one below. Lightning-types are actually just string variables (enclosed in quotes "") and you just need to put the four-character ID that you put in your SLK (e.g. "WAVE").
    • Start
      • Events
        • Time - Elapsed game time is 0.00 seconds
      • Conditions
      • Actions
        • Custom script: set udg_LightningType = "WAVE"
        • Set VariableSet LightningLoc1 = (Position of Footman 0001 <gen>)
        • Set VariableSet LightningLoc2 = (Position of Footman 0002 <gen>)
        • Lightning - Create a LightningType lightning effect from source LightningLoc1 to target LightningLoc2
        • Custom script: call RemoveLocation(udg_LightningLoc1)
        • Custom script: call RemoveLocation(udg_LightningLoc2)
  10. Test it out and it should be good to go!
    1743975012064.png
 
Level 4
Joined
Apr 6, 2022
Messages
35
Do any of these settings reduce stretching of the lightning effect? Like rather than stretching the chain it simply replays the graphic, so more chain links show up instead of stretching the chain links
 
Sadly, I don't think so--at least not through the attributes. For the record, here are some of the attributes I tested:
  1. AvgSegLen (Average Segment Length) - Appears to control how "pointy"/flat the edges of the lightning are. Higher AvgSegLen => more pointiness/longer triangle. Lower AvgSegLen => more flat at the edges. A value below 10 leads to almost square edges. 1 or below tend to lead to a lot of display issues. 0 will crash the engine.
  2. Width - How wide the lightning is drawn. You can increase this to make the lightning wider, or decrease it to make the lightning more narrow (see screenshot below).
  3. NoiseScale - Adds some jitteriness/irregularity to the lightning texture.
  4. TexCoordScale (Texture Coordinate Scale) - Controls how fast the lightning texture is moved across the plane. Higher values (e.g. 5) => Very slow. Low values (e.g. 0.25) => Very fast.
Some suggestions though:
  1. Texture Resolution - If your texture is scaling poorly, you can try finding a higher-resolution image to use. But it will still be stretched regardless--it might just look less grainy (assuming you find a higher quality version of your texture).
  2. Adjust the width - If your texture is stretched too far horizontally, you can adjust the width to scale it down horizontally, which can sometimes look better or make the stretching less apparent:
    1744009346461.png
  3. Spawn multiple lightning segments - if you want to spawn lightning from A to D, and the distance is quite far, you can consider dividing the distance into segments and spawn lightning from A to B, then B to C, then C to D. This way you'll have the texture scaled more appropriately for each segment, rather than being stretched all the way from A to D. The main issue though is that the edges of the segments can be pretty obvious because of the "pointiness" of lightning. You can try lowering the AvgSegLen to something like 2 to make this a bit less apparent. And then you can mess with the positioning slightly to try to make the segment edges less noticeable. Here is an example--the left side is the standard lightning (stretched) whereas the right side is the same lightning but broken up into 3 segments across that same distance.
    1744009785123.png
 
Top