'AddEventHandlers' is unrecognized in map definition
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
'AddEventHandlers' is unrecognized in map definition
Tested with GZDoom 3.1.0 and GZDoom g3.2pre-552-g765646e
What it says in the title. 'EventHandlers' works but 'AddEventHandlers' does not. Is this intentional?
EDIT: Attachment removed.
What it says in the title. 'EventHandlers' works but 'AddEventHandlers' does not. Is this intentional?
EDIT: Attachment removed.
Last edited by Fishytza on Fri Jun 22, 2018 5:45 am, edited 1 time in total.
Re: 'AddEventHandlers' is unrecognized in map definition
What version did this work, before?
Re: 'AddEventHandlers' is unrecognized in map definition
I think it's a documentation error: AddEventHandlers shouldn't work for maps.
What's the difference between those two keywords if map definitions are not inherited?
What's the difference between those two keywords if map definitions are not inherited?
Re: 'AddEventHandlers' is unrecognized in map definition
I believe 'EventHandlers' clears previous event handlers while 'Add', uh, adds to the existing ones. The point being I'd like to use a map specific handler without compromising any handlers from mods. (Granted, I haven't tested whether previous handlers are kept or not when using 'EventHandlers' in map definition. Too tired atm.)
- Major Cooke
- Posts: 8175
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: 'AddEventHandlers' is unrecognized in map definition
EDIT: ZZYZX can comment on this but I don't think he intended it for individual maps.
Re: 'AddEventHandlers' is unrecognized in map definition
Okay, so, after a quick test, any handlers defined in maps don't seem to erase the ones defined in a gameinfo block. So I guess this was a [Not a bug] situation. Still, the wiki should be updated to reflect that.
- Major Cooke
- Posts: 8175
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: 'AddEventHandlers' is unrecognized in map definition
Wait for ZZYZX to comment on it first since he's the one who designed it. I'm dubious about it being a feature...
Re: 'AddEventHandlers' is unrecognized in map definition
Map-local event handlers should be the same as BEHAVIOR. That is, if you implement your own handler, it should remove all old defined handlers for this map.
And if you specify map block and don't specify event handlers, there should be none. (I'm not sure it's like this right now)
If I could I'd probably also erase map-local event handlers between archives, so that if map and event handler are defined in separate archives (not including maps in PK3) event handlers should not work.
Now, global (the ones that have AddEventHandlers) handlers are intended for global processing and multiple mods can stack them, because they don't require specific map to function.
That's the point basically.
And if you specify map block and don't specify event handlers, there should be none. (I'm not sure it's like this right now)
If I could I'd probably also erase map-local event handlers between archives, so that if map and event handler are defined in separate archives (not including maps in PK3) event handlers should not work.
Now, global (the ones that have AddEventHandlers) handlers are intended for global processing and multiple mods can stack them, because they don't require specific map to function.
That's the point basically.
Re: 'AddEventHandlers' is unrecognized in map definition
So handlers defined in a gameinfo block are like ACS scripts loaded via LOADACS?ZZYZX wrote:Map-local event handlers should be the same as BEHAVIOR. That is, if you implement your own handler, it should remove all old defined handlers for this map.
In any case the current behavior is as such: map-local handlers are loaded along with any handlers in a gameinfo block, doesn't matter if gameinfo declares them via 'EventHandlers' or 'AddEventHandlers'; They will be loaded alongside the ones in a 'Map' block regardless.
This is exactly what I want though since, in my case, the event handler I am using is intended for one map only (it uses WorldThingSpawned()). And I rather it doesn't nullify a mod's event handlers in that mod's gameinfo definition.
(I'll say again, it currently doesn't, which is preferred.)
The whole confusion on my part stems from the fact that the wiki (at the time) stated that 'AddEventHadlers' was usable in a map block which is why this thread exists in the first place.