Page MenuHomeFeedback Tracker

Addeventhandler (Killed, Deleted,Fired) on Active Mines returns -1
Closed, ResolvedPublic

Description

Failure to add any Eventhandler to a Active Mine (asset). Singleplayer and Multiplayer.
Return -1

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Operating System Version
6.1.7601 SP 1
Category
Explosives
Steps To Reproduce
  1. Place a AT Mine or any other.
  2. Try to add an Eventhandler to the mine with: (cursor is pointed at mine)
cursorobject addEventHandler ["Killed", {diag_log "!!!Works!!!"}];
  1. Get the return of -1 which is not even documentated on https://community.bistudio.com/wiki/addEventHandler

  1. It is the same for addMPeventhandler.
Additional Information

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.

Event Timeline

Sergadra created this task.May 21 2018, 4:02 PM

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/

Sergadra changed Severity from Block to Minor.Oct 24 2018, 5:59 PM
Wulf closed this task as Resolved.Nov 7 2018, 4:08 PM
Wulf claimed this task.
Wulf added a subscriber: Wulf.

Hello.

Talked to the devs and they say that this is correct behaviour.