furrycat's SWAT3 flashlight hacking guide

OK so you've read the available documentation and you know that to make a gun with a flashlight you need to put a material into your mesh with the name FLASHLIGHT and edit the guns.dat file to toggle the flashlight capability.

But what happens when the creator of the weapon model didn't bother putting the FLASHLIGHT material in for you? Setting flashlight=1 in guns.dat will only buy you an "invalid polygon" error message when you run SWAT.

We have the technology

Not to worry. Through the magic of GSM hacking we can manufacture our own flashlight and graft it on to the GSM itself.

Step 1: Run gsmhacking

You need to get and install gsmhacking version 3. Get it from here.

After installing gsmhacking you should run it like this:

gsmhacking --add-flashlight <filename>

Replace <filename> with the name of your GSM file. gsmhacking may warn you that the weapon you are trying to convert is a pistol and thus cannot be used as a primary. Use the --make-rifle option to "fix" the GSM.

Step 2: Edit modguns.dat

The final step is to activate the flashlight in modguns.dat. You should know how to do this already but here's an example anyway. It's supposed to be all on one line but I've split it up to save scrolling!

  ak74su      36      1   0.1   2.5   Gunshot_AK47    Gunshot_AK47   \
  gun_flashA  gun_flashB    (545X39HP,6,30)   (545X39FMJ,6,30)  NoAmmo_Rifle  \
  3     1   14.0    (0,0,16)    1.0   0   1.0   1.06  1.0     .75   1   1   1 $ak74su_name

Feedback

Send any comments to swat3@furrycat.net.