'AddEventHandlers' is unrecognized in map definition

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

'AddEventHandlers' is unrecognized in map definition

Post by Fishytza »

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.
Last edited by Fishytza on Fri Jun 22, 2018 5:45 am, edited 1 time in total.
User avatar
Rachael
Posts: 13557
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: 'AddEventHandlers' is unrecognized in map definition

Post by Rachael »

What version did this work, before?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: 'AddEventHandlers' is unrecognized in map definition

Post by _mental_ »

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?
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Re: 'AddEventHandlers' is unrecognized in map definition

Post by Fishytza »

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.)
User avatar
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

Post by Major Cooke »

EDIT: ZZYZX can comment on this but I don't think he intended it for individual maps.
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Re: 'AddEventHandlers' is unrecognized in map definition

Post by Fishytza »

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.
User avatar
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

Post by Major Cooke »

Wait for ZZYZX to comment on it first since he's the one who designed it. I'm dubious about it being a feature...
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: 'AddEventHandlers' is unrecognized in map definition

Post by ZZYZX »

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.
User avatar
Fishytza
Posts: 781
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: No Preference
Contact:

Re: 'AddEventHandlers' is unrecognized in map definition

Post by Fishytza »

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.
So handlers defined in a gameinfo block are like ACS scripts loaded via LOADACS?

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.
Post Reply

Return to “Closed Bugs [GZDoom]”