Page MenuHomeFeedback Tracker

EventHandler "Loaded" not firing
Closed, ResolvedPublic

Description

I am talking about https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#Loaded

I have added this to a mods init.sqf:
handle1 = addMissionEventHandler ["Loaded",{systemchat "BLAH"}];

After savegame load, the systemchat entry is not displaying. The event is not triggered, code is not starting. I think, the eventhandler is 100% broken.

I have seen some people reporting it.
Eg. https://forums.bistudio.com/forums/topic/157192-missioneventhandlerloaded-never-fired/

You would make modders/missionmakers lives way easier - because survival of savegames without that eventhandler is a tricky thing.

Details

Severity
None
Resolution
Not A Bug
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce
  1. Add code to an init.sqf or appropriate place:

handle1 = addMissionEventHandler ["Loaded",{systemchat "BLAH"}];

  1. Start mission, save mission, reload mission.
  2. No text appearing in systemchat area bottom left.

Event Timeline

tortuosit updated the task description. (Show Details)
tortuosit edited Steps To Reproduce. (Show Details)

The EH works fine, I have just tested it. What you have to realise that no event handler will fire if you add it after event it supposed to monitor. This EH monitors loading of the game from save and you are adding it after the game loaded.

I suggest you create a function with preInit = 1; which will execute in pre init, so that when the game is loaded from save the EH exists.

This comment was removed by tortuosit.

It's working from preinit, thx.

BIS_fnc_KK closed this task as Resolved.Dec 8 2019, 7:24 AM
BIS_fnc_KK changed Resolution from Open to Not A Bug.