Warband Script Enhancer 2 (v1.1.2.3)

Users who are viewing this thread

Hi! Could you please show how agent_set_attack_action and agent_set_defend_action work in the code?
Code:
    case agent_set_attack_action:
        if (mbCheckAgent(intValues[0]) && rglBetween(intValues[1], -2, 4) && rglBetween(intValues[2], 0, 2))
        {
            mbAgent *agent = g_mission->getAgent(intValues[0]);

            agent->m_attackOverrideType = intValues[1];
            agent->m_attackOverrideHold = intValues[2];
        }

        break;
    case agent_set_defend_action:
        if (mbCheckAgent(intValues[0]) && rglBetween(intValues[1], -2, 4) && values[2] >= 0)
        {
            mbAgent *agent = g_mission->getAgent(intValues[0]);

            agent->m_defendOverrideType = intValues[1];
            agent->m_defendOverrideDuration = values[2] / 1000.0f;
            agent->m_defendOverrideTimer.reset();
        }

        break;
void mbAgent::updateAiControl()
{
    m_control.m_flags1 = m_ai.m_control.m_flags1;
    m_control.m_flags2 = m_ai.m_control.m_flags2;
    setLookHeight(m_ai.m_control.m_lookDir.z);
    changeLookDirf(m_ai.m_control.m_lookDir.vec2().getAngle());

    __int64 missionTime = mbGetRawMissionTime();
    bool found = false;

    while (!m_ai.m_queuedControls.empty())
    {
        mbAgentAiQueuedControl *queuedControl = &m_ai.m_queuedControls.front();

        if (queuedControl->m_time >= missionTime)
            break;

        m_control.m_flags2 |= queuedControl->m_control.m_flags2;
        m_ai.m_actionControl = m_control;
        m_ai.m_queuedControls.pop_front();
        found = true;
    }

    if (!found)
        m_control.m_flags2 |= m_ai.m_actionControl.m_flags2;

    if (m_attackOverrideType >= 0)
    {
        m_control.m_flags2 &= ~(cf2_defend_mask|cf2_attack_mask);

        if (m_attackAction == aa_releasing)
            m_attackOverrideType = -1;
        else if (m_attackAction != aa_readying || m_attackOverrideHold)
            m_control.m_flags2 |= getAttackControlFlagsFromType(m_attackOverrideType);
    }
    else if (m_defendOverrideType >= 0)
    {
        m_control.m_flags2 &= ~(cf2_defend_mask|cf2_attack_mask);

        if (m_defendAction != da_blocking && m_defendAction != da_parrying)
        {
            m_control.m_flags2 |= getDefendControlFlagsFromType(m_defendOverrideType);
            m_defendOverrideTimer.reset();
        }
        else if (m_defendOverrideDuration > m_defendOverrideTimer.getElapsedTime())
        {
            m_control.m_flags2 |= getDefendControlFlagsFromType(m_defendOverrideType);
        }
        else
        {
            m_defendOverrideType = -1;
        }
    }

    if (m_attackOverrideType == -2)
    {
        m_control.m_flags2 &= ~cf2_attack_mask;
        m_attackOverrideType = -1;
    }

    if (m_defendOverrideType == -2)
    {
        m_control.m_flags2 &= ~cf2_defend_mask;
        m_defendOverrideType = -1;
    }
}
 
There is another Bannerlord campaign multiplayer project that is still in heavy development. You can find more information about it here.

Many concepts are transversal, especially time management. I am pretty sure that the team has opted for continuous time. Part of the work involves handling war party events where players may join ongoing battles or find themselves trapped in a besieged town they strolled into, etc.
 
got rgl error called "exception access violation" with code 10016


The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{2593F8B9-4EAF-457C-B68A-50F6B8EA6B54}
and APPID
{15C20B67-12E7-4BB6-92BB-7AFF07997402}
to the user LAPTOP-1SDITEK6\daus SID (S-1-5-21-1414802737-2192527179-2729334624-1001) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
 
could you please show condition of ti_on_agent_fill_collision_capsule ? this trigger on what situation?
This trigger is needed when you are using very large or non-humanoid skeletons to correctly determine collisions of hits on an agent. A standard capsule is generated from two points - the position of the head bone and the middle between the positions of the feet bones. This trigger allows you to override this capsule.
 
got rgl error called "exception access violation" with code 10016


The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{2593F8B9-4EAF-457C-B68A-50F6B8EA6B54}
and APPID
{15C20B67-12E7-4BB6-92BB-7AFF07997402}
to the user LAPTOP-1SDITEK6\daus SID (S-1-5-21-1414802737-2192527179-2729334624-1001) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.
This doesn't seem to be a problem with WSE2. There is a problem with your system, try googling the solution.
 
Hi! :smile: Could you please show what agent_force_rethink does exactly?
Code:
    case agent_force_rethink:
        if (mbCheckAgent(intValues[0]))
        {
            mbAgent *agent = g_mission->getAgent(intValues[0]);

            if (agent->isBot())
            {
                agent->m_ai.m_lookTargetAgentNo = -1;
                agent->m_ai.m_behaviorTimer.decrease(10000.0f);
                agent->m_ai.m_movementTimer.decrease(10000.0f);
                agent->m_ai.m_actionTimer.decrease(10000.0f);
            }
        }

        break;
 
Hello.
The trigger ti_on_init_item on a hand armor its executed twice when wearing them, its there a way to differentiate the second execution from the first? handle the script in the first execution of the trigger, and do nothing on the second?
 
check is extra mesh

ti_on_init_item = -50.0 #can only be used in module_items triggers
# Trigger Param 1: agent id
# Trigger Param 2: troop id
# Trigger Param 3: item modifier
# Trigger Param 4: is extra mesh (used for gloves)
 
Hey so i am noticing that WSE 2 has the update thingy for me but when i click on it the update seems to be getting stuck at downloading mb_warband_wse2.pdb and was wondering is there anywhere i can manually download the update? since the auto updater thingy does not seem to be working for me.
 
Hey so i am noticing that WSE 2 has the update thingy for me but when i click on it the update seems to be getting stuck at downloading mb_warband_wse2.pdb and was wondering is there anywhere i can manually download the update? since the auto updater thingy does not seem to be working for me.
check header post
 
check is extra mesh

ti_on_init_item = -50.0 #can only be used in module_items triggers
# Trigger Param 1: agent id
# Trigger Param 2: troop id
# Trigger Param 3: item modifier
# Trigger Param 4: is extra mesh (used for gloves)
Many thanks, it worked
 
Have a nice day guys. Emm, in one modification, a really strange bug happened to me. Every time I'm in battle I shoot my musket at normal speed, but after 30 seconds muskets shoots fast as hell boy. Like late medieval machine gun boy. I know many mods are not compatible, but I just want to ask if anyone has a similar experience with any mod. This bug happened to me on an already older mod called Europe in Flames.
 
Have a nice day guys. Emm, in one modification, a really strange bug happened to me. Every time I'm in battle I shoot my musket at normal speed, but after 30 seconds muskets shoots fast as hell boy. Like late medieval machine gun boy. I know many mods are not compatible, but I just want to ask if anyone has a similar experience with any mod. This bug happened to me on an already older mod called Europe in Flames.
The first step is to check that this problem does not occur on the vanilla Warband engine.
 
Tested, this mod is designed for old Warband 1.153 + WSE 3.2.0 and will not work without errors until the mod developer updates it to a new version of Warband and WSE.
WSE2 compatible with mods developed for older versions of Warband, but not compatible with old WSE, because in new versions of the Warband new operations were introduced and WSE operation's ids shifted.
 
Last edited:
Back
Top Bottom