Such like when talk to someone and CreateMission in Dialog.
---------------------------
public override void OnMissionModeChange(MissionMode oldMissionMode, bool atStart)
{
if (!atStart)
{
foreach (Agent agent in base.Mission.Agents)
{
if (agent.IsHuman)
{
agent.SetAgentExcludeStateForFaceGroupId(_disabledFaceId, agent.CurrentWatchState != Agent.WatchState.Alarmed);
}
}
// Change
if (oldMissionMode == MissionMode.Conversation)
{
if (// some condition)
{
Task.Delay(2000);
PlayerEncounter.LocationEncounter.CreateAndOpenMissionController(LocationComplex.Current.GetLocationWithId(Helper.LocationNames.tavern), null, null, null);
}
}
}
}
Here is Exception. And do you need more info about?
Exception information
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: TaleWorlds.CampaignSystem
CallStack:
[LIST=1]
[*]at void TaleWorlds.CampaignSystem.GameState.MenuContext.HandleStates()
[*]at void TaleWorlds.CampaignSystem.GameState.MapState.EnterMenuMode()
[*]at void TaleWorlds.CampaignSystem.GameMenus.GameMenu.ActivateGameMenu(string menuId)
[*]at void TaleWorlds.CampaignSystem.Encounters.PlayerEncounter.Init(PartyBase attackerParty, PartyBase defenderParty, Settlement settlement)
[*]at void TaleWorlds.CampaignSystem.EncounterManager.StartPartyEncounter(PartyBase attackerParty, PartyBase defenderParty)
[*]at void TaleWorlds.CampaignSystem.Party.MobileParty.TaleWorlds.CampaignSystem.Map.IMapEntity.OnPartyInteraction(MobileParty engagingParty)
[*]at void TaleWorlds.CampaignSystem.EncounterManager.HandleEncounterForMobileParty(MobileParty mobileParty, float dt)
[*]at void TaleWorlds.CampaignSystem.EncounterManager.HandleEncounters(float dt)
[*]at void TaleWorlds.CampaignSystem.Campaign.Tick()
[*]at void TaleWorlds.CampaignSystem.GameState.MapState.OnMapModeTick(float dt)
[*]at void TaleWorlds.CampaignSystem.GameState.MapState.OnTick(float dt)
[*]at void TaleWorlds.Core.GameStateManager.OnTick(float dt)
[*]at void TaleWorlds.Core.Game.OnTick(float dt)
[*]at void TaleWorlds.Core.GameManagerBase.OnTick(float dt)
[*]at void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch2(Module this, float dt)
[/LIST]
I test follow code a map trigger in single player mode. and web server did not received request.
(1, [
(send_message_to_url_advanced, "@http://localhost:14725/", 'str_empty_string', "script_es_process_url_response", "script_es_process_url_response", 1),
]),
your op name is wrong.
# script_es_spawn_horse
("es_spawn_horse", [
(store_script_param_1, ":horse_item_id"),
(try_begin),
(gt, ":horse_item_id", 0),
(item_get_type, ":item_type", ":horse_item_id"),
(eq, ":item_type", itp_type_horse),
(spawn_horse, ":horse_item_id"),
(return_values, reg0),
(else_try),
(try_end),
]),
After We use another Warband Dedicated Sever(Mod files is old). The problem disappeared miraculously.
for curAgent in game.agentsI() do local is_alive = game.agent_is_alive(curAgent)
local is_human = game.agent_is_human(curAgent)
local is_ai = game.agent_is_non_player(curAgent)
if is_alive and is_human and is_ai then
game.remove_agent(curAgent)
end
end
mesh_mp_ingame_menu = 6
create_mesh_overlay = 911 # (create_mesh_overlay, <destination>, <mesh_id>),
15:23:12 - SCRIPT ERROR: Illegal lvalue in statement
15:23:12 - - Lua (line 0, opcode 911, modifier 0x0)
15:23:12 - - (line 0, opcode 5113, modifier 0x0)
local temp = 0
local overlay_id = game.create_mesh_overlay(temp, game.const.meshes.mesh_mp_ingame_menu)
ok. I will test it again after download the latest version.