remove overheat weapon

Started by Xaxadar, August 07, 2023, 01:11:03 AM

Previous topic - Next topic

I'm looking for how to suppress the overheating of weapons for a whole game, for the player
I did the following searches in the api for console code:

but obviously there is no ready "remove overheat" function from what I have seen a function to remove overheating. It is surely necessary to select the weapon which is in the inventory and to apply to this weapon another function of the api.

My goal is to write a script that can be added to the fake console.
I'm a newbie to modding this game, but I know how to code and I'm willing so any help would be appreciated.
Thank you for taking the time if you ever want to help me.

August 07, 2023, 05:51:33 AM #1 Last Edit: August 07, 2023, 05:54:12 AM by {AR}MetalKiller Reason: Remove code block for better readability
Behind every script function there is usually a function within the game code.
If your intention is to add a "RemoveWeaponOverheating" function, you would need to connect this script function with a function in the game code that implement this functionality (I doubt that there exists one).
For it to work you would need to have access to the game code or find a way to inject code into the executable.
This is not trivial.

I have only modded for SWBF1 so far, but I assume that it is not that different to SWBF2.
If you want to remove the weapon overheating only for a specific weapon you could modify the respective side (have a look at the modding tutorials).
Let's say you want to remove the overheating of the rebel pistol:
- Find the file "all_weap_inf_pistol.odf" in your custom side directory
- Open it with a text editor of your choice
- Look for the line that contains "HeatPerShot"
- Set its value to 0
- Munge your custom all.lvl side
- Make a backup of your original all.lvl
- Replace your custom all.lvl side with the original

First of all, thank you for your advice.
Only I would rather make a mod that affects all weapons even those that come from mods.
That's why I was talking about the fake console, for example when you select the jump like a jedi option it affects the player even with another mod installed.

I try to explain it as easy as I can, maybe someone can help me out to make it even simpler.

When you open the fake console you see a list of functions.
Each of those functions connect to a piece within the game code.
This game code is fixed and can not be altered (trivially).
The fake console is only there to call this function dynamically (you wouldn't want to make every unit jump like a jedi on every mission).
If you want to add a new entry to the fake console, you would need to know the game code and see if the functionality exists there.
This only works by disassembling the game code and taking a stroll through the game files.
At least, that is my understanding.
I might be wrong.

The following comparison might lack a bit but here we go ...
Imagine a soft drink dispenser.
Every type of soft drink represents a functionality of the game code.
The number input thingy of the dispenser is the fake console (the script connection to the game code) where the user selects a number to get a certain soft drink.
You can not add more soft drinks to the dispenser because it is already filled.
Not all soft drinks might be accessible via a the number input, but you could connect the soft drink to the number input.
However, you would need to know the number of the soft drink.

You would either have to study how the number input is connected to the soft drink, or even harder, open the dispenser and add a new type of soft drink.