avoitishin / xray-16

XRAY 16 Engine Modifications
Other
10 stars 6 forks source link

Game Over and Death Cam #25

Closed revolucas closed 7 years ago

revolucas commented 9 years ago

Is anyone else having an issue with the game_over tutorial not triggering on death since the commit where FP_DEATH define was added?

avoitishin commented 9 years ago

Is that what you have in Actor.cpp?

if (IsGameTypeSingle())
    {
#ifdef FP_DEATH
        cam_Set(eacFirstEye);
#else
        cam_Set(eacFreeLook);
#endif // FP_DEATH
        CurrentGameUI()->HideShownDialogs();

        /* avo: attempt to set camera on timer */
        /*CTimer T;
        T.Start();
        if (!SwitchToThread())
        Sleep(2);
        while (true)
        {
        if (T.GetElapsed_sec() == 5)
        {
        cam_Set(eacFreeLook);
        start_tutorial("game_over");
        break;
        }
        }*/
        /* avo: end */

        start_tutorial("game_over");
    }
revolucas commented 9 years ago

Yes, that is what I have in Actor.cpp. The reason I'm asking this question is because I tried my compiled binaries on untouched CoP with no gamedata (except gulag_general.script changes) and do not see the game over screen there either. It seems to be the cause of the build and I'm confused as to why because Actor.cpp looks fine. Could this not be triggering at all because of the fake death mechanics you added? Because in Freelook cam (FP_DEATH undefined) I noticed there is no actor corpse.

EDIT: Nevermind, I didn't realize that that killing actor in on_actor_before_death is now mandatory if you want to see the real game_over screen. The information about killing the actor in this callback needs updated. There is a typo. level:object_by_id should be level.object_by_id and the example is killing the killer instead of the actor. This is what the example should look like:

db.actor:kill(db.actor, true)
avoitishin commented 9 years ago

Does it really matter who kills an actor? Example is just a simple showcase on how to do it. BTW - i think sent you PM some time ago on COC forums about this :)