Warband Script Enhancer 2 (v1.1.0.4)

Users who are viewing this thread

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

(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.
(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),
##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:

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?

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;
        damage = 10.0f;
    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):




Whereas without WSE2, they are marked as killed:




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:



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:


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

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):



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.

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

For instance:

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.


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