Warband Script Enhancer 2 (v1.0.5.9)

Users who are viewing this thread

Do you think you can help me with how the terrain system works ?
I want to reproduce this to create an open source software which represents the terrain in 3d like in the game and maybe at the end create an external scene editor.
 

K700

Sergeant Knight
WB
Yes, you can even do it yourself, use linux build for reversing, with function names it will be easier.
 

K700

Sergeant Knight
WB
1.0.4.4
-Added bAllowKickDuringMeleeAttacks config option.
-Fixed itp_cant_reload_while_moving and itp_cant_reload_while_moving_mounted item flags.


This is Warband kick bug, which allows you to kick during melee attacks. This has been fixed in WSE2.

check melee action for ranged weapon instead melee weapon
Code:
if (wieldedItem.getItemKind()->isRangedWeapon())
{
    int phase;
    int type;

    mbActionGetMeleeAttackData(m_actionChannels[1].m_actionNo, phase, type);

    if (phase == ap_release)
        return false;
}

correct
Code:
if (wieldedItem.getItemKind()->isMeleeWeapon())
{
    int phase;
    int type;

    mbActionGetMeleeAttackData(m_actionChannels[1].m_actionNo, phase, type);

    if (phase == ap_release)
        return false;
}

Nevertheless, players are used to playing with such a kick and asked me to return it, so this check is now disabled by default. Use bAllowKickDuringMeleeAttacks config option to turn off kick during melee attacks.
 

Vetrogor

Sergeant at Arms
Can you make an option for messages to write to rgl_log for debugging. Native messages write when edit_mode is enabled?
 

Vetrogor

Sergeant at Arms
I mean all message operators. They write to rgl_log when edit mode is enabled. I know about edit mode. I used rgl_log to debug native a lot.
 

K700

Sergeant Knight
WB
1.0.4.5
-Fixed bug with crossbow reloading.
-Implemented WSE Profiler (Profiling config options).
-Added bEditMode config option (currently only displays messages in rgl_log.txt).
-Fixed sModuleDownloadUrl config option.
 

K700

Sergeant Knight
WB
1.0.4.6
-Implemented Stats window and character import/export.
-Fixed troop_set_proficiency operation.
 

Carl_Johnson

Regular
When I open orders window, I can't close it using Backspace. I must use Escape key to close it. Could you fix it in next version?

Another question - are received damage sliders working?
 

K700

Sergeant Knight
WB
If you are talking about this window, it opens and closes by Backspace, I checked.

yes. sliders working, but for backward compatibility with saves, saving will only save 25%, 50%, 100%
 

Vetrogor

Sergeant at Arms
@K700 , hi. Can you post script that calculated how much agents will spawn on your side taking battle advantage into account?

I have runned some tests and it shows that advantage varies between 5 to -12 (for player). If we take 30 as base it will shows exact numbers.
0 advantage is 15/30=50%.
1 advantage is 16/30=53%
2 advantage is 17/30=56%
3 advantage is 18/30=60%
4 advantage is 19/30=63%
5 advantage is 20/30=66% - this is max advantage for player

-12 advantage is 3/30=10% - this is max disadvantage for player

Max and min values are hardcoded to game engine. Script can still generate like -15 or less advantage or more than 15. For AI
-15 advantage is 30/30 = 100% (of options slider) - max is limited to 100%. This cases to spawn actually 110% of battle size (100% ai + 10% player - wich is bugged).
5 advantage is 10/30 = 33% min is limited to 33%.

The next question is how much ally agents will spawn compared to player. Tests show that it is ally_companions/total_companions (+/-) 15% random. Where total_companions = player_companions + ally_companions. This randomnes is stupidness.

Can you verify my observations?
 
Last edited:

K700

Sergeant Knight
WB
C++:
numToReinforce = rglMax(rglRound(getBattleAdvantageFactor((float)advantage) * numTroops), 1);

float mbMission::getBattleAdvantageFactor(float advantage)
{
    return rglClamp((advantage + 15.0f) / 15.0f, 0.2f, 2.5f) * (rglConfig::Battle::fBattleSize * 4.0f + 1.25f);
}

and every frame

void mbMission::spawnEntryGroups()
{
    mbMissionTemplate *missionTemplate = getTemplate();
    bool done = false;

    for (int i = 0; i < 100 && !done; ++i)
    {
        done = true;

        for (int j = 0; j < missionTemplate->m_numGroups; ++j)
        {
            mbMissionTemplateGroup *group = &missionTemplate->m_groups[j];

            if (group->m_flags & mtef_visitor_source && !getSite()->m_visitors[j].m_troopNos.empty() || group->m_availableReinforcements > 0 && !m_usedEntries[j])
            {
                if (spawnEntryGroup(j))
                {
                    group->m_availableReinforcements--;
                    group->m_spawnedReinforcements++;
                    shiftEntryPoint(group->m_entryPointNo);
                    done = false;
                }
            }
        }
    }
}
 

Vetrogor

Sergeant at Arms
The next question is how much ally agents will spawn compared to player. Tests show that it is ally_companions/total_companions (+/-) 15% random. Where total_companions = player_companions + ally_companions. This randomnes is stupidness.
What about ally stregnth compared to player?
 
Top Bottom