Bots trigger ENTER scripts but not PlayerEntered events

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
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Bots trigger ENTER scripts but not PlayerEntered events

Post by Marisa the Magician »

This probably is unimportant because, y'know, bots, but still...

Provided here is a tiny wad that prints when a player enters/respawns/dies/disconnects both through an event handler and through acs.

Here's a sample of what's happening: Everything works as expected EXCEPT PlayerEntered on ZScript doesn't get called for bots.

Code: Select all

MAP01 - Entryway

16 bots read from bots.cfg
[ZScript] Player Marisa entered.
[ACS] Player Marisa entered.
]addbot
V234 joined the game
[ACS] Player V234 entered.
You got the chaingun!
V234 was mowed down by Marisa's chaingun.
[ZScript] Player V234 died.
[ACS] Player V234 died.
[ZScript] Player V234 respawned.
[ACS] Player V234 respawned.
]removebots
[ZScript] Player V234 disconnected.
[ACS] Player V234 disconnected.
Removed all bots
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Bots trigger ENTER scripts but not PlayerEntered events

Post by Rachael »

Bots being added to the game is in fact a hack that is added in due to the fact that there is no actual late-join mechanism in the game. Fixing this would be as simple as adding the event to one of the lower-level calls that result from the "addbot" command after the bot definition is parsed and the bot is selected and before G_DoReborn().
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Bots trigger ENTER scripts but not PlayerEntered events

Post by Rachael »

User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Bots trigger ENTER scripts but not PlayerEntered events

Post by Marisa the Magician »

I noticed that this isn't 100% fixed. The PlayerEntered event is getting called for bots before their playerinfo has a mo attached. This... is kind of a problem.
User avatar
Rachael
Posts: 13965
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Bots trigger ENTER scripts but not PlayerEntered events

Post by Rachael »

Does this fix it?
User avatar
Marisa the Magician
Banned User
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Bots trigger ENTER scripts but not PlayerEntered events

Post by Marisa the Magician »

Yeah, that did the trick!
Post Reply

Return to “Closed Bugs [GZDoom]”