Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
the game already does show total ammo weapon value..
what do you want to use on that return total ammo value?
What? Did you read OP?
He wants to get a weapon's total max ammo after skill calculations.
I have a mod that gives the user a rough estimation of Total Damage Output. It's a simple measure one can use when considering damage vs endurance, etc. It is not specific ala breakpoints it's more of a general idea of 'this weapon has the potential to do a total of XXX damage' (# of rounds times amount of damage per round).
What I'm trying to do is make a simple calculated field that is Total DMG (weapon base damage + damage from mods + damage bonuses from skills) * total Ammo (weapon's total ammo - mods that subtract ammo [like dmr kit/skins] + skills that grant ammo [like fully loaded]).
I have it working sort of... it does the total damage part correctly, but I'm having trouble with when the amount of ammo changes. I suppose the long way would be to check for if the user has the fully loaded skill, if that returns true then multiply total ammo times the multiplier... but still not sure how to handle ammo reducing mods and/or skins.
Thank you for your response I hope I explained it better.
This. But also after skill calculations and after any ammo-reducing mods. I'm wondering what the variable for this is, as returning the total ammo for a weapon returns the original (for example returns 150 ammo on the car-4 with the dmr kit, where the ammo is clearly reduced).
Hope that clarifies...
The relevant weapon mods also define e.g. total_ammo_mod = -12, and you just sum over weapon itself plus all of its attached weapon mods. In this case, the -12 means a final index of 21-12=9, i.e. -0.6. The game does that in NewRaycastWeaponBase:_update_stats_values; after summing the indexes it clamps the values to fit inside the table and then looks up the value from the index:
self._current_stats[stat] = stats_tweak_data[stat] and stats_tweak_data[stat][j] or 1.
Actually it looks up the index i instead of j but that makes the rest of this post turn into italics. In the end the result is stored in _total_ammo_mod.
NewRaycastWeaponBase:replenish then multiplies the skill bonuses together and does
ammo_max_multiplier = ammo_max_multiplier + ammo_max_multiplier * (self._total_ammo_mod or 0)
which is equivalent to
ammo_max_multiplier = ammo_max_multiplier*(1 + self._total_ammo_mod)
assuming that _total_ammo_mod is defined (it should be). So the game only ever considers (1 + self._total_ammo_mod), which is why the original table might as well be shifted to 0, 0.05, ..., 1.95, 2.0. Anyway, in the case above the index is shifted by 12, which means the value changes by 0.6. As the starting point is 1, the new value is 0.4. That's the multiplier for the ammo. Or 1.25*0.4 if FL.
Max ammo is then
local ammo_max = math.round((tweak_data.weapon[self._name_id].AMMO_MAX + managers.player:upgrade_value(self._name_id, "clip_amount_increase") * ammo_max_per_clip) * ammo_max_multiplier)
where "clip_amount_increase" is leftover from PDTH I think, so this simplifies to
local ammo_max = math.round(tweak_data.weapon[self._name_id].AMMO_MAX * ammo_max_multiplier).