Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jun 2014
I
i30817 Offline OP
apprentice
OP Offline
apprentice
I
Joined: Jun 2014
If i try to add a deltamod for a bow :

new deltamod "PiercingBoostBow"
prefixname ""
suffixname ""
param "ModifierType" "Weapon"
param "MinLevel" "1"
param "BoostType" "ItemCombo"
new boost "_Bow_Piercing_WeaponBoost",1



and this is the boost (stored in one of the files holding items there)
new entry "_Bow_Piercing_WeaponBoost"
type "Weapon"
using "_BOOSTS_Weapon"
data "Damage Type" "Piercing"
data "DamageBoost" "-50"



It does not actually lower the damage of the primary (piercing) type.
However if i remove the minus, it adds up 50% bonus no problem. This means it isn't a problem in ItemCombos.txt.

This is irritating because i wanted to make a deltamod to 'divide' a ranged weapon pure primary damage into piercing and crushing, but this wasn't able to swing it.

Am i doing something wrong? Is there a minimum damage on the primary damage stat of each item you can't go under? And besides that, what's the difference between DamageFromBase and DamageBoost? Neither seems to work in this case mind you.

Last edited by i30817; 02/12/21 05:16 PM.
Joined: Jun 2014
I
i30817 Offline OP
apprentice
OP Offline
apprentice
I
Joined: Jun 2014
Here is the 'solution' and it's more than a bit stupid:

integer overflow of the percentage.

Since it appears to be a signed value this:

new entry "_Bow_Piercing_WeaponBoost"
type "Weapon"
using "_BOOSTS_Weapon"
data "Damage Type" "Piercing"
data "DamageFromBase" "2147483597"


Which is 'signed 32 bits int max - 50' appears to turn into '-50 percentage' for some reason when it tries to 'add' the multiplication it to the existing value, for reasons that are obvious after you think of the probable formula:

[base_value_min + (base_value_min * percentage), base_value_max + (base_value_max * percentage)]

the addition overflows to a value '50% under each value, and since base_value(s) is unsigned, it starts from 0. Presto, 50%.

Devs deving around, could not do normal negative percentages but left this overflow thankfully.

Last edited by i30817; 03/12/21 07:09 AM.
Joined: Sep 2017
veteran
Offline
veteran
Joined: Sep 2017
Hey! Most of the modding community is mainly active and over at the Larian Studios Discord (https://discord.gg/LarianStudios)

Joined: Jun 2014
I
i30817 Offline OP
apprentice
OP Offline
apprentice
I
Joined: Jun 2014
Thanks, before asking there i'm going to leave a shout of rage to the void.

This (dividing a damage type into two) actually seems impossible because the way to chain things in ItemCombos.txt (Boost2twice) doesn't actually work with multiple damage types, since apparently contrary to appearances they're not the application of two different boosts but the merge of two, so the 'Damage Type' and 'DamageBoost' will be overwritten. FFS larian.

Last edited by i30817; 03/12/21 08:16 AM.
Joined: Jun 2014
I
i30817 Offline OP
apprentice
OP Offline
apprentice
I
Joined: Jun 2014
Ahaha, no i'm not sending my fucking phone number to discord. FFS.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5