Shanjaq / uhexen2

GitHub clone of SVN repo svn://svn.code.sf.net/p/uhexen2/code/trunk (cloned by http://svn2github.com/)
12 stars 1 forks source link

Feature request: bottom plaques #45

Closed Inky-Inky closed 2 years ago

Inky-Inky commented 3 years ago

Hello,

In Portal Of Praevus, in the "Single player" menu there is a "View intro" option at the bottom. It runs a nice "cutscene" which is actually a prerecorded demo. A distinctive feature of this demo is that it features plaques which appear at the bottom of the screen, unlike the usual plaques which are always centered on the screen.

I may very likely be wrong, but I wonder whether that specific behavior might be decided in this code, found at line 303 in engine/h2shared/screen.c:

static void SCR_CheckDrawCenterString (void)
{
    if (! SCR_CheckDrawCenterString2())
        return;
#if !defined(H2W)
    if (intro_playing)
    {
        Bottom_Plaque_Draw(scr_centerstring);
        return;
    }
#endif  /* H2W */
    SCR_DrawCenterString ();
}

Shall I kindly ask for a way to trigger that behavior not only from the engine hard coded rule above but also from the plaque's properties (why not a spawnflags value or whatever?) to allow mappers to take advantage of bottom plaques in game as well? I'm very much aware that by requesting this feature I'm only selfishly looking after my own interests because my campaign is all about storyline, dialogs and texts and having them constantly block the view is a pain in the ass, especially during dialogs and cutscenes.

Yet my hope is that some further mappers may take advantage of this newly open track in the future, who knows.

Thank you very much for your indulgence towards this capricious request. With all my respect and admiration, Inky

Inky-Inky commented 3 years ago

If I'm correct in guessing that the code above is responsible for the plaque drawing position and that scr_centerstring actually contains the text message to print, it seems to me that an even more simple way to trigger a bottom plaque (easier than plaque entity settings, I mean) would be to simply start the text with an underscore '_' in the strings.txt file.

My memories about coding in C++ are 20 years old so I cannot swear that's the correct syntax, but I imagine changing SCR_CheckDrawCenterString in something like that (I put comments to explain, in case the tentative syntax is wrong and confusing):

static void SCR_CheckDrawCenterString (void)
{
    if (! SCR_CheckDrawCenterString2())
        return;
#if !defined(H2W)
    if (intro_playing || scr_centerstring[0] == '_') /* If the intro is running or the first character in the message is an underscore */
    {
        if (scr_centerstring[0] == '_') /* If the first character in the message is an underscore, let's skip it and start printing the message from the second character */
            scr_centerstring++;
        Bottom_Plaque_Draw(scr_centerstring);
        return;
    }
#endif  /* H2W */
    SCR_DrawCenterString ();
}

If relevant, that solution would need minimum efforts.