PlayerEntered event does not fire when adding a new player

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

PlayerEntered event does not fire when adding a new player

Post by Nash »

In the following scenario:

1) With a mod that has a PlayerEntered event. Player 1 starts a single player game. Event fires off as expected
2) Save the the game, then quit
3) Start a 2 player game, load up the saved game
4) The PlayerEntered event does not fire for Player 2.

My question is if such a scenario is deliberately not supported?
You do not have the required permissions to view the files attached to this post.
Last edited by Nash on Sat Mar 14, 2020 3:54 am, edited 1 time in total.
User avatar
Rachael
Posts: 13913
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: PlayerEntered event does not fire when adding a new play

Post by Rachael »

I don't think lack of support for this is deliberate, however I also don't think it's something easily accounted for. I don't think when the event system was designed, such a scenario ever crossed anyone's mind.

This is yet another way I think that the event system as a whole is showing some of its weaknesses. You really have to account for every little thing, and that's simply not possible because it's really easy to come up with ways that are less conventional - such as this.
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: PlayerEntered event does not fire when adding a new play

Post by Nash »

Should I make a suggestion for this? Probably a new event to ensure compatibility; NewPlayerEntered? PlayerAdded?
User avatar
Rachael
Posts: 13913
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: PlayerEntered event does not fire when adding a new play

Post by Rachael »

I think it's best to report it as a bug., but it will call into question whether the scenario you described should be directly supported or not. (Which is a good thing, don't worry)
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: PlayerEntered event does not fire when adding a new play

Post by Nash »

Added runnable example file, requesting thread moved to Bugs
User avatar
phantombeta
Posts: 2159
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: PlayerEntered event does not fire when adding a new play

Post by phantombeta »

I believe this happens for the same reason as this bug report.
I don't think we can trivially change where it's called from without breaking existing mods, so it might be a better idea to have a boolean that indicates whether to use the old behaviour or the new one. Or we could just straight up use the versioning system to choose that, that should work too.
User avatar
Caligari87
Admin
Posts: 6225
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him

Re: PlayerEntered event does not fire when adding a new play

Post by Caligari87 »

Does using PlayerSpawned() mitigate the problem? I'm not sure if it's directly related but I made the PR to have an event that more closely exactly mimicked the behavior of the ACS ENTER script type (only firing when the player has a pawn existing in the game world).

EDIT: Good grief. I got linked from elsewhere and didn't realize I was bumping a year-old thread, sorry :oops:

8-)
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: PlayerEntered event does not fire when adding a new play

Post by Nash »

I was the one who inquired Cali about this issue, so I'll take the blame. :) The reason is I'd like to know if the PlayerSpawn() thing Cali added actually solves the issue with "late player spawning not firing PlayerEntered event" that phantombeta is describing.

Return to “Bugs [GZDoom]”