Schall Recharging Weapon


Experimental recharge mechanism. Introduced energy weapons, which recharge from personal batteries! Currently includes laser rifle, laser sniper rifle, laser shotgun, laser machine gun, mega laser cannon, chainsaw. (Locale: English, Deutsch, 正體中文, 简体中文, Português Brasileiro, Русский)

Content
16 days ago
0.17 - 2.0
7.62K
Combat

FAQ

Q: Is the chainsaw from another game?
A: Yes, it is from the classic FPS game “Doom”! My favourite weapon when need to conserve ammo.
It would be nonsense for needing "ammo" to operate it. So the new recharge mechanism would make perfect sense to make it in game.

Q: Are the laser weapons from another game?
A: Yes, some are from the classic SLG game “UFO: Enemy Unknown” (aka. X-COM: UFO Defense)! Laser rifle was my favourite because it is very versatile and never needs ammo.
The three guns (laser rifle, laser machine gun, mega laser cannon) are using the graphics from the original game, but in no way correspond to original named guns. The reason is quite obvious, the original game has mechanics like snap shot, auto shot, accuracy settings to distinguish the guns, but these do not play much role in Factorio. Therefore, some "creativity" is used here to make them useful guns with different roles.

The other two guns (laser sniper rifle, laser shotgun) are using the graphics from Final Mod Pack from the SLG game OpenXcom, which is an open-source clone of the original “UFO: Enemy Unknown”. Solarius Scorch has been very kind in allowing me to use the resources from the mod pack freely. I would also thank any other contributors, who made the graphics and sound effects of the guns.

Q: Do these resources have any copyright issues?
A: I am not a lawyer, so I do not know. But since I do not sell this as a commercial mod, I guess it is okay. If you are the copyright owner and feel this is an issue, please contact me.

For the resources from Final Mod Pack, permission is granted by Solarius Scorch. All rights reserved by FMP and its contributors. It you wish to reuse or modify those resources, you should ask for their permission to do so.

Q: I see some "stun enemies" text in the weapon description. Do they have any special effects?
A: Yes, some weapons have special effects. Please see the below for in-depth description.

Q: Some weapons use so much energy! Can you reduce those values?
A: Since no ammo (thus no resources) is needed for these weapons, it should take some energy to fire to be balanced. The energy requirement is carefully balanced, based on the laser turret (800 kJ per shot) and 0.16 personal laser defense equipment (200 kJ per shot).
Note that I have ignored the setting of 0.17 personal laser defense equipment (50 kJ per shot). It is ridiculously low! I refuse to accept it, as a huge buff to an already overpowered weapon.
If you need to fire these weapons a lot, equip more personal batteries! Also have at least one "traditional" ammo-consumed gun, so you still have firepower when run out of battery.

Instructions to Fellow Modders

Adding Dependency

The remote interface (explained below) to support fellow mods is first introduced in version 0.17.9 of this mod. Your mod should require this mod and version (or above) to utilize it. So first of all, in "info.json" of your mod folder, please add a dependency "SchallRechargingWeapon >= 0.17.9", to make sure the load order is correct.

Here is an example:

"dependencies": ["base >= 0.17.0", "SchallRechargingWeapon >= 0.17.9"]

Converting from Ammo-based to Grid-powered

Here I assume you already have a working modded gun ready. Therefore, you should have the gun item, ammo item, projectile, recipe, technology prototype definitions (if applicable) all properly set up, where you can already use the gun in game.
If you do not know how to create a new modded gun, please search Factorio modding tutorials or seek help in forum. This page will NOT go for these basics.

Now comes to the conversion procedures:

1) The gun should have its internal name starting with "Schall-recharging-". This is done to distinguish it from other ordinary guns, so to avoid mistakenly reset ammo of the wrong guns. We set "Schall-recharging-example-gun" as the example gun in the following description. In short, the internal name should fit the Lua string pattern of:

"^Schall%-recharging%-"

2) The unique ammo (it is "automatically" charged, so not replaceable like ordinary guns) should have its internal name the same as the gun plus ending with "-charges". The clip for the example gun should be "Schall-recharging-example-gun-charges". In short, the internal name should match Lua string pattern of:

"^Schall%-recharging%-.+%-charges$"

3) Make sure you renaming is properly done in all of your prototype definition files.
4) Edit control.lua in root folder of your mod. (Create if missing.) Add the following function call to it:

local function add_recharging()
if remote.interfaces["SchallRechargingWeapon"] then
remote.call("SchallRechargingWeapon", "add_charges", "Schall-recharging-example-gun-charges", {energy=1000000, stack_size=4, magazine_size=10})
end
end

5) The above script will add the gun to the recharging mechanism of this mod. The gun will charges 1 MJ per shot, 4 ammo item per stack, and 10 shots per shot. Therefore, a full charge will contains 40 shots, causing a total of 40 MJ from personal batteries in your grid. Adjust these three numbers to what fits your gun.
6) Register this function add_recharging() to on_load, on_init and on_configuration_changed events.
7) If in doubt, download Schall Land Mine, look into control.lua and other files, then learn how it works.
8) Now test the gun in game, it should work as the other recharging weapons of this mod! If not, go back to the former steps and check carefully.
9) Remove the recipe of the ammo, if you have not done so already. Such recipe is absolutely unnecessary. The script of this mod will check your inventory and actually remove them.
10) If you would like share your gun(s) with me and others, please state some description in my Discussion section. I would include your mod to the list on the mod main page!

Technical Details

These are all recharging weapons. No ammo needs to be crafted. Instead, "ammo" (called charges) are automatically generated, if personal batteries are presenet in players' armor grid, and there are enough energy to recharge.

Laser Rifle

  • Portable version of laser turret.
  • Target: Entity
  • Form: Instant shooting beam. (Same as laser turret or personal laser defense.)
  • Collision: No
  • Range: 24
  • Fire rate: 4 /s
  • Damage type: Laser
  • Shot damage: 25
  • Shot energy: 200 kJ
  • Movement: -20%
  • Effect: None
  • Upgrade techs: Energy weapons damage (Damage), Laser turret shooting speed (Shooting speed)

Laser Sniper Rifle

  • Long range precision fire.
  • Target: Entity
  • Form: Instant shooting beam. (Same as laser rifle above.)
  • Collision: No
  • Range: 8 - 48
  • Fire rate: 0.5 /s
  • Damage type: Laser
  • Shot damage: 40
  • Shot energy: 4 MJ
  • Movement: -95% for 2 s
  • Effect: None
  • Upgrade techs: Energy weapons damage (Damage), Laser turret shooting speed (Shooting speed)

Laser Shotgun

  • Spread shots stun enemies.
  • Target: Directional
  • Form: Each burst consists of 12 beams, widely-spread. (Similar to shotgun shells.)
  • Collision: Yes (So can cause friendly fire.)
  • Range: 16
  • Fire rate: 1 /s
  • Damage type: Laser
  • Shot damage: 12× 10
  • Shot energy: 2 MJ (167 kJ per beam)
  • Movement: -20%
  • Effect: Stun for 30 ticks (0.5 s)
  • Upgrade techs: Energy weapons damage (Damage), Laser turret shooting speed (Shooting speed)
  • Tips: Designed to hit-and-run tactics. The spread shots kill lesser enemies, spawners and worms effectively, while the stun property helps suppressing stronger biters from coming to you.

Laser Machine Gun

  • Suppressive fire stuns enemies.
  • Target: Directional
  • Form: Inaccurate short beam. (Similar to the inaccurate tank cannon shots.)
  • Collision: Yes (So can cause friendly fire.)
  • Range: 25
  • Fire rate: 10 /s
  • Damage type: Laser
  • Shot damage: 20
  • Shot energy: 200 kJ
  • Movement: -100% for 2 s
  • Effect: Stun for 30 ticks (0.5 s)
  • Upgrade techs: Energy weapons damage (Damage), Laser turret shooting speed (Shooting speed)
  • Tips: Designed to provide suppressive fire, stopping enemies allowing friendlies to deliver killing blows. Not a good choice for run-and-gun tactics. It is better to use with another player(s), one keeps firing while another one is advancing, then exchange their roles when the advancing player is ready to fire. It is called Fire and movement (aka leapfrogging) in military tactics.

Mega Laser Cannon

  • Giant beam attacking all enemies on path.
  • Target: Directional
  • Form: Line attack. Also stun targets briefly. (Behaves like hidden railgun.)
  • Collision: No (Anything on line is attacked, non-stoppable.)
  • Range: 26
  • Fire rate: 0.33 /s
  • Damage type: Laser
  • Shot damage: 100
  • Shot energy: 5 MJ
  • Movement: -50%
  • Effect: None
  • Upgrade techs: Energy weapons damage (Damage), Laser turret shooting speed (Shooting speed)

Chainsaw

  • Melee weapon. Also stuns target.
  • Target: Entity
  • Form: Instant damage.
  • Collision: No
  • Range: 2
  • Fire rate: 3 /s
  • Damage type: Impact
  • Shot damage: 20
  • Shot energy: 2 kJ
  • Movement: -20%
  • Effect: Stun for 2 s
  • Upgrade techs: Physical projectile damage (Damage), Weapon shooting speed (Shooting speed)
  • Tips: Use the stun effect to the greatest benefit! When solo duel, this stops the enemy completely, so you can kill enemy without inflicting any damage! Even when facing multiple enemies, you can sweep around to stun every enemy. But still, do not get completely surrounded. Get trapped in acid splash is not a nice experience.

Full List of New (or Changed) Items

Weapons

  • 5 laser:
    • Laser rifle
    • Laser sniper rifle
    • Laser shotgun
    • Laser machine gun
    • Mega laser cannon
  • 1 physical:
    • Chainsaw

Ammo

  • 5 laser:
    • Laser rifle charges
    • Laser sniper rifle charges
    • Laser shotgun charges
    • Laser machine gun charges
    • Mega laser cannon charges
  • 1 physical:
    • Chainsaw charges

Technologies

  • 6 weapon-related:
    • Laser rifle
    • Laser sniper rifle
    • Laser shotgun
    • Laser machine gun
    • Mega laser cannon
    • Chainsaw