Garry's Mod

Garry's Mod

165 ratings
[TFA][HBW] Heat Based Weapons | Base
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
2.822 MB
19 May, 2020 @ 11:21am
21 May, 2020 @ 8:38am
6 Change Notes ( view )

Subscribe to download
[TFA][HBW] Heat Based Weapons | Base

Description
Item is no longer supported

Heat Based Weapons | Base

Information
This addon is a modification for TFA weapons. Developed for star wars weapons but usable for any kind of TFA weapons. Its a simple to use addon wich removes the ammo of the configured weapons and replace it with an heat display. You can fire with those heat based weapons as long as the heat display doesn't reach the red status.

Weapons in the screenshots are not in this addon. This addon only adds the display for the heat status and the heat system it self. The Heat Based Clone Wars Weapons will soon follow.
How it works
If configured correctly you will find on your weapon a heat display as seen in the screenshots. You can now shoot as long as the heat display isn't showing the red status. If you reached the red status, your weapon has overheated and you must reload to cool it down.
If you wait a configured time and you are not overheated the weapon cools down it self. Or you can press reload to cool the weapon down faster.

Create a Heat Based Weapon
To create a Heat Based Weapon this base is required. Then you must only add the few lines of code into your lua of the weapon. Also you should set the ammo consuption (SWEP.Primary.AmmoConsumption) to zero.
SWEP.Primary.AmmoConsumption = 0
-- Hover Heating SWEP.isHeatBased = true -- Must be true else it won't be a Heat Based Weapon SWEP.maxHeat = 40 -- Sets the max heat of a weapon. Could be compared with his magazine SWEP.currentHeat = 0 -- Sets the start heat of the weapon usually 0 SWEP.heatStep = 1 -- Defines how many heat it should add after a shot was fired SWEP.cooldownWaiter = 1 -- Defines how long it takes after the last shot till the weapon is cooling down SWEP.cooldownStep = 1 -- Set how many heat should be removed every cooldown round -- Display Size SWEP.heatDisplayX = 0.2 SWEP.heatDisplayY = 0.2 SWEP.heatDisplayZ = 0.25 -- Display Position and Rotation SWEP.heatDisplayPos = Vector(4, 2.1, 2.8) SWEP.heatDisplayRot = Angle(-90, 83, 0) -- -- -- --
If the weapon doesn't has any View Elements. You have to add the following code and change the bone.
SWEP.VElements = { ["case"] = { type = "Model", model = "models/dolunity/heatometer/heatometer.mdl", bone = "v_dlt19_reference001", rel = "", pos = weapon.heatDisplayPos, angle = weapon.heatDisplayRot, size = Vector(weapon.heatDisplayX,weapon.heatDisplayY, weapon.heatDisplayZ), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }, ["heat"] = { type = "Model", model = "models/hunter/plates/plate025.mdl", bone = "v_dlt19_reference001", rel = "case", pos = Vector(0, 0, 0), angle = Angle(0, 0, 0), size = Vector(weapon.heatDisplayX * 0.6, weapon.heatDisplayY * 0.7333, weapon.heatDisplayZ * 0.1), color = Color(255, 255, 255, 255), surpresslightning = true, material = "models/debug/debugwhite" , skin = 0, bodygroup = {} } }
Create TFA attachments
If you want to have a TFA attachments which influence the heat system you have to add the following code to your attachment:
function ATTACHMENT:Attach(wep) wep.maxHeat = wep.maxHeat + 15 -- Increases the max heat of the weapon by 15 if you add the attachment to your weapon wep:Unload() end function ATTACHMENT:Detach(wep) wep.maxHeat = wep.maxHeat - 15 -- Decreases the max heat by 15 after removing the attachment wep:Unload() end

Credits
Lua Code - Me (DolUnity | STEAM_1:1:156804976)
Model - Me (DolUnity | STEAM_1:1:156804976)

Thanks to:
Stoker | Shader™ for helping me with some model questions
ChanceSphere574 for helping me with the TFA attachment compatibility and the animation

Copyright 2021 DolUnity. This item is not authorized for posting on Steam, except under the Steam account named DolUnity
Popular Discussions View All (2)
3
18 Jul, 2021 @ 4:32am
PINNED: Suggestions
DolUnity
1
21 May, 2020 @ 12:08pm
PINNED: TFA Weapons which support Heat Based Weapons
DolUnity
12 Comments
Lunneth Arc 23 Jun @ 6:17pm 
@operator Kowalski
Yeah, just be sure to DL the TFA Star Wars Scope Fix.
Operator Kowalski 19 Aug, 2023 @ 1:53pm 
does this still work?
Alkyiel 6 Mar, 2022 @ 11:19am 
Any idea what would be stopping the overheat case from having the lights that change? everything else works perfectly fine, its just that the lights that go from green to red arent showing up.
[TGG] DoctorHeisenberg 26 Feb, 2022 @ 5:55am 
i dont see this at all in the weapons tab and i have TFA?
Clumba 7 Jan, 2022 @ 12:55am 
DolUnity, is there a plan to add a 2d overheating indicator? 3d model for multiplayer is not the best idea
SpecyJ 10 Jul, 2021 @ 2:34am 
I don't like Star Wars blasters having heat mechanics, but a heat system for TFA is perfect as there haven't been many unique sci fi weapons in TFA. This does however need some changes and optimization so it won't ruin a server.
Other than that I hope this addon can be perfected because I really want to see this applied to Halo weapons some day.
Dank 20 Jun, 2021 @ 6:07am 
The "CoolDownThinker" hook is the #1 most expensive function call on most servers, please kill it with fire lol
Anti Cheat 14 Jul, 2020 @ 12:15am 
heat-manager Top 1 server load without any Heat Based weapon on the server, nice :steamfacepalm:
TunnelSnakes_7827 24 May, 2020 @ 6:57pm 
its a god Develeped
DolUnity  [author] 21 May, 2020 @ 12:08pm