Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Overheating Weapons
New feature: Overheating Weapons[message #295171] Wed, 14 December 2011 23:53 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Overheating weapons

Hi, as I felt the feature was missing, I've implemented the feature of overheating weapons. Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently. Above a certain threshold, the gun also degrades much faster. The temperature is lowered every turn (turnbased)/5 seconds (realtime).

The increasing/decreasing of temperature works for all weapons in a game, both for mercs and soldiers. It also works for weapons in the sector inventory, in any sector, regardless of merc presence (so a weapon dropped by an enemy will cool down).

You can edit a gun's heat generation and its jam and damage thresholds via Weapons.XML:

...
<usOverheatingJamThreshold>4700.0</usOverheatingJamThreshold>
<usOverheatingDamageThreshold>5300.0</usOverheatingDamageThreshold>
<usOverheatingSingleShotTemperature>50.0</usOverheatingSingleShotTemperature>
...
As there is now a replacable barrel, the speed of cooldown can be set in Items.XML:

...
<barrel>0</barrel>
<usOverheatingCooldownFactor>125.0</usOverheatingCooldownFactor>	
...
Different ammunition types can modify heat generation in AmmoTypes.XML:

...
<temperatureModificator>1.03</temperatureModificator>	
...
A gun's barrel can be replaced with a new barrel if you allow it in Merge.XML (1377 is the item-number of the replacable barrel):

...
<MERGE>
<firstItemIndex>1377</firstItemIndex>
<secondItemIndex>1075</secondItemIndex>
<firstResultingItemIndex>1075</firstResultingItemIndex>
<secondResultingItemIndex>1377</secondResultingItemIndex>
<mergeType>8</mergeType>
<APCost>50</APCost>
</MERGE>
...
I've added a section to the Data-1.13/Ja2_Options.INI where one can set global values (note that now attachments can alter cooling properties):

...

[Tactical Weapon Overheating Settings]

;******************************************************************************************************************************
; In this section you can modify global settings for weapon overheating.
;******************************************************************************************************************************

; Maximum 'temperature' a gun can have
OVERHEATING_MAX_TEMPERATURE = 40000

; Should a 'thermometer' for guns and replacable barrels be displayed?
OVERHEATING_DISPLAY_THERMOMETER = TRUE

; A weapon's cooldown factor is multiplied with this, accounting for worse heat reduction due to attachments
OVERHEATING_COOLDOWN_MODIFICATOR_SILENCER         = 0.8
OVERHEATING_COOLDOWN_MODIFICATOR_BARRELEXTENDER   = 0.85
OVERHEATING_COOLDOWN_MODIFICATOR_FLASHSUPPRESSOR  = 0.97

; If a barrel is not in someone's inventory, it cools down a little bit better
OVERHEATING_COOLDOWN_MODIFICATOR_LONELYBARREL = 1.15
...
The XML-Files are needed for playing.

I have also edited the INIEditorJa2Options.xml for descriptions.

I tested this feature, it was built upon the currently newest source in the trunk, revision 4946.

Temperature is displayed via a thermometer on the left side of a weapon. Temperature is additionally shown in the description window, in the same colour as the thermometer.

This feature can be turned on and off in the 'Preferences' menu.

Due to code changes, there is no savegame compatibility, as I have made changes to the OBJECTTYPE class.


Changes in version 1.2.1:
- I've changed a few weapon values, no more stock values.
- The thermometer is now deep red while the temperature rises, and becomes brighter as the jam threshold is violated
- I've added caliber-specific replacable barrels for all machineguns (so, 5 different barrels)

Update on 6.3.12:

Changes in version 1.2.2:
- icons for everything overheating-specific added

[Updated on: Thu, 07 September 2023 11:15] by Moderator

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: Constructable static fortifications (sandbags etc.)
Next Topic: New feature: Improved trade menu
Goto Forum:
  


Current Time: Mon Dec 02 15:52:48 GMT+2 2024

Total time taken to generate the page: 0.03083 seconds