Warband Script Enhancer 2 (v1.1.2.0)

Users who are viewing this thread

Alright, I believe I've found the cause. It's coming from the upgrade_hero_party script:

("upgrade_hero_party",
[
(store_script_param, ":party_no", 1),
(store_script_param, ":mad:p_amount", 2),
##diplomacy start+
#Take into account faction quality/quantity settings. Do not apply this
#to the player party or to special parties.
(try_begin),
(ge, ":party_no", spawn_points_begin),
(store_faction_of_party, ":var1", ":party_no"),
(faction_get_slot, ":var1", ":var1", dplmc_slot_faction_quality),
(val_add, ":var1", 100),
(val_clamp, ":var1", 97, 104),#100 plus or minus three percent
(val_mul, ":mad:p_amount", ":var1"),
(val_div, ":mad:p_amount", 100),
(try_end),
##diplomacy end+

(party_upgrade_with_xp, ":party_no", ":mad:p_amount", 0),

]),

More specifically, the problem is with the party_upgrade_with_xp operation.

The script is called at the end of each round of battle simulation, to award XP to lord parties (hence only them being affected). I believe the issue must stem from how WSE2 handles upgrades for troops that have reached the next tier - perhaps in some cases it is unable to determine the ID of the next troop in the tree, so it defaults to 0 (which is trp_player).

Probably there needs to be a failsafe so it doesn't attempt to upgrade at all if it's unable to find the ID of the next troop or an obviously invalid result?
 
Last edited:
Thanks.

Another issue - weapons (like spears) with overhead stab (instead of the default overhead swing) attacks deal blunt rather than thrust damage. Normally it should take the weapon's thrust damage instead of its swing damage attribute into account.
 
What exactly prompted you to this idea?

C++:
isThrust = attack.m_type == at_thrust;
bool hasUpperStab = false;

if (!item.isValid())
{
    if (srcAgent)
        damage = (srcAgent->getTroop()->getAttribute(atr_str) * 0.3f + 2.0f) * attack.m_power;
    else
        damage = 10.0f;
}
else
{
    if (item.getItemKind()->m_properties & itp_has_upper_stab)
    {
        hasUpperStab = true;

        if (attack.m_type == at_overswing)
            isThrust = true;
    }

    damage = (float)item.getDamage(isThrust);

    if (!isCouching)
    {
        damage *= attack.m_power;
        damage *= attack.getHoldFactor() * 0.5f + 0.5f;
    }
}
 
Using WSE2, agents taken out by this attack are considered knocked out rather than killed (and the sound is that of a blunt attack):

ixUMWCC.png

woNzjhd.png

vqOFEs6.png

Whereas without WSE2, they are marked as killed:

aKy8VQk.jpg


FYvKuBf.jpg


sDm6zNA.jpg

That said, I didn't use the itp_has_upper_stab flag, so I'll try adding it. I used the tutorial on adding overhead stab, which didn't mention it, and it worked fine.
 
Sorry for asking but can this used PoP without any issues? Also just tested this with Native. Amazing, f*cking amazing. 200 vs 200 cavalry fight and only a few drops. Beautiful every damn Warband mod should be compatible with this.
 
Last edited:
I've been having issues with pathfinding in sieges that aren't present without WSE2 (in the same scenes, meaning it isn't due to something wrong with AI meshes).

More specifically, agents will get stuck on or near ladders, and occasionally buildings as well, and many archers won't fire even when they have clear line of sight. Obviously, such issues are present without WSE2 as well, but it appears to be a much bigger problem with my WSE2 version.

For example, with WSE2:

ebwZwD9.png

67jhyi3.png
W7JvEGq.png
uMcZWQl.png
GDNvoyR.png
lAGJLhN.png

The same thing happens with a lower battle size (150), and it doesn't seem it can be explained by archers getting stuck, since non-archers seem to get stuck too:

Hbd4CKa.png
EEIknnI.png


On the other hand, on the same scene, without WSE2, you can see it is much smoother:

n4juWSf.jpg
iMfsJt6.jpg
J89ZLob.jpg
 
I understand, I'm at loss as to what causes this, as well. I've tested native WSE2 vs my mod and the issue isn't present in WSE2 native, so it must be an issue with how my mod interacts with WSE2 changes, but I have no idea what could affect agent AI like that.

I suppose I'll be doing more testing to see if more details come up.
 
On further testing, it works fine if I order my units to hold their fire. The difference seems to be that they won't stay stuck on the ladder trying to aim at enemies out of their line of sight in the non-WSE2 version, whereas they often will with WSE2 (it's probably easily noticeable in the tests I did because a lot of infantry did have throwing weapons).

Hence there seems to be a general issue where ranged units will just stay there doing nothing if enemies are out of line sight, instead of moving to a position that would give them LoS.
 
Very well, thanks.

I've also had a graphical issue issue with some items (see below):

CT0NBiQ.png


qHZpsyg.png
zZ6gnw8.png

What's odd is that it doesn't happen to every agent with the item equipped, but there's always a few to whom it does in large groups of units. It only affects a few dozen items, but I haven't found any obvious reason why those specifically.

As before, the problem isn't present on the non-WSE2 version.

Do you have any idea what's causing this?
The graphical issue is getting causes by the meshes. They are not properly rigged. That issue also appears when not using WSE or WSE2, in most cases it happens with assets of CWE. You need to copy paste the rigging of a similar armour to the meshes.
 
Hello,

I believe I have found another issue. The messages reporting shot difficulty are shown for all heroes, and not just trp_player.

For instance:

s9CyszG.png
rjQ7hmx.png
NsMdamc.png
 
I have found a bug from native. When air_friction is high and arrow speed is low agents don't know how to correct angle and they are shooting in the ground in front of target. This happens in Viking Conquest with low speed havy spears.

In config this are 2 values. When I set to 0,100000 they will always miss with any ranged weapon.

fAirFrictionArrow=0.002000
fAirFrictionBullet=0.002000

@K700, can you provide source codes for friction so we can figure out the solution.
 
Back
Top Bottom