View Single Post
Author Message
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 02-26-2024 , 16:42   [L4D2] CoOp: Determine non-finale map success/fail
Reply With Quote #1

For finale maps, there is a finale_win (and mission_lost) event that can be checked to determine finale success.

There does not appear to be a map_win event (which I define as at least one survivor successfully made it to the checkpoint, closed the door, and triggered a changelevel to the next map in the campaign).

I thought at first that if OnMapEnd was reached it would be a success (because if mission_lost is triggered, OnMapEnd will not trigger), but that only works most of the time. There are at least two scenarios I can think of that cause problems... OnMapEnd is triggered when a new lobby connects, and OnMapEnd is triggered when a vote passes to change to a new map/campaign. It is also possible that lobby/vote connections go directly to any map in the campaign.

In either round_start or OnMapStart I want to determine if the previous map was a success, or if we got here from a new lobby connect, map vote change, or anything else that might changelevel without a map_win.

I am thinking when the ending checkpoint door is closed I may have to determine if all alive survivors are in the ending checkpoint and set an appropriate global variable to indicate a map_win, then check the value of that variable in round_start and/or OnMapStart.

Any better ideas?
__________________

Last edited by Mystik Spiral; 02-27-2024 at 07:17.
Mystik Spiral is offline