Failure to add any Eventhandler to a Active Mine (asset). Singleplayer and Multiplayer.
Return -1
Description
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7
- Operating System Version
- 6.1.7601 SP 1
- Category
- Explosives
- Place a AT Mine or any other.
- Try to add an Eventhandler to the mine with: (cursor is pointed at mine)
cursorobject addEventHandler ["Killed", {diag_log "!!!Works!!!"}];
- Get the return of -1 which is not even documentated on https://community.bistudio.com/wiki/addEventHandler
- It is the same for addMPeventhandler.
I am working on a Database also for Mines which have to update if Mine is picked(EH deleted) up or Exploded(EH killed). Without a working Eventhandler it gets somewhat frustrating to do it properly.
I am not sure if this is intended or not.
I am using right now:
[_mine] spawn {params ["_mine"]; waituntil {sleep 1; not alive _mine};systemchat "DEAD";};
to check if they are picked up or deleted. So it seems like the main function is here, but it is not possible to add event handlers.
If it is a bug you might want to consider to make own Eventhandlers for mines instead of existing one if they make sense. Like:
Mine_exploded
Mine_disarmed
I would personally classify it as a block because you can't do scripting like intended with this issue.
Please correct it if this is not the right severity. I was pending between minor block an major. Minor seemed to innocent for this, major to hard and block seemed right because it blocks a intended function.
Status | Assigned | Task | ||
---|---|---|---|---|
Resolved | Wulf | T129113 Addeventhandler (Killed, Deleted,Fired) on Active Mines returns -1 | ||
Resolved | Wulf | T131058 SetVariable on Active Mines does not Work | ||
Acknowledged | Adam | T83628 Missing event handler for detection of explosives |
Event Timeline
I just found out that Mines aren't Assets in the normal sense but Ammunition which makes it impossible to place Eventhandlers and SetVars on them. It seems intended but also in the modern sense uninetended.
Maybe it just needs to be overworked? This would make it to a feature request or is it still a minor bug?
A Source:
https://forums.bohemia.net/forums/topic/177071-mine-namespace-cannot-setvariable-to-a-planted-mine/