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!

PlayerEntered event does not fire when adding a new player

Postby Nash » Sat Mar 14, 2020 2:25 am

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Rachael » Sat Mar 14, 2020 2:37 am

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
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Nash » Sat Mar 14, 2020 2:50 am

Should I make a suggestion for this? Probably a new event to ensure compatibility; NewPlayerEntered? PlayerAdded?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby Rachael » Sat Mar 14, 2020 2:55 am

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
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

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

Postby Nash » Sat Mar 14, 2020 3:54 am

Added runnable example file, requesting thread moved to Bugs
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

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

Postby phantombeta » Sat Mar 14, 2020 9:17 am

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
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

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

Postby Caligari87 » Thu Mar 04, 2021 4:18 pm

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
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

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

Postby Nash » Thu Mar 04, 2021 11:59 pm

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.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest