Jump to content
The Dark Mod Forums

Geep

Contributor
  • Posts

    1105
  • Joined

  • Last visited

  • Days Won

    58

Posts posted by Geep

  1. 7 hours ago, datiswous said:

    wonder what this core script is for then

    Looks like it waits for something (a wheel?) probably wall-mounted to rotate 360 degrees in the x plane before opening the associated door. Since it hard-codes that rotating object as func_static_1858, this script is intended for 1 particular FM. (Lots of FMs have a func_static_1858... of ones I have on my hard drive, I didn't see a likely "wheel" candidate.)

    • Like 1
  2.  

    5 hours ago, MirceaKitsune said:

    As I'm planning to use this in my upcoming FM: Can I have a reminder of how the newly added debrief GUI is defined? The information doesn't seem to be on the wiki yet.

    I guess look at comments in tdm_gui01.pk4/guis/mainmenu_custom_defs.gui

    • Thanks 1
  3. I think what's of most interest here is Stone font, the default for subtitles, and its calculated width-compressed value.

    The TDM scaling factor for subtitles is no longer 0.25, instead 0.24. So any actual displayed string length is now shorter than what this utility calculates, by about (24.0/25.0). "About" because calculated results is rounded to int.

    Beyond that, when I updated Stone 24pt for 2.11, I tried really hard to not have to change the underlying xskip values of any character. But to be absolutely correct, it would be good to review the xskip spacing array embedded in this program, against the current DAT/REF file xskip values.

    Probably the scale factor should be an optional parameter for this utility. I'll put an update of this program on my list of things to look at in 2025. For now, just do the 24/25 recalc.

     

  4. 6 hours ago, datiswous said:

    Also is there a way to set the distance of the sound at which the subtitles are shown? I thought there was an idea to decrease the range, so that you don't see subtitles from sounds that you aren't supposed to really hear.

    I don't recall that idea being implemented, whether based on distance or volume. I think - to an approximation - if you can hear the sound when it starts playing, however faintly, then you get the subtitle.

    Otherwise, there's a problem. Suppose you have a distant guard running towards you... you want to trigger the subtitle even when faint, rather than lose it entirely. Perhaps there's some way to make it work OK. Dunno.

    Otherwise, for now, if you aren't suppose to hear the sound, maybe in some cases you can set its shader's max distance to be smaller.

  5. stgatilov

    5 hours ago, datiswous said:

    Possibility to only show a subtitle once, although the sound is played from multiple sources.

    Quote

    In this specific situation multiple speakers are placed and played at the same time.

    I presume the speaker sources have overlapping max distance spheres, and all are triggered to start at the same moment. If the player is in an overlap location when triggering happens (and so can hear the same monologue start from multiple sources, although probably without realizing it), then multiple subtitles appear.

    If the player is in a non-overlap location when triggering happens, but moves into an overlap location while the monologue continues, I'm guessing the extra subtitle would not appear. (Could be wrong about this.)

    In any event, this is a common speaker setup (although most often with looping sounds). @stgatilov would know better, but I think a reasonable restriction would be to enforce a prohibition on multiple subtitle slots starting the same subtitle (i.e., sharing a subtitle path/name) "at the same time" (e.g., a frame or 2), irrespective of source.

    Probably that would be enough. Don't want to have to calculate whether sources are part of an overlap. Or look at whether sources are distinct and/or static (see next pp).

    In my subtitle test FMs, I have a single static sound source, but if desired can trigger multiple recurrences of the same monologue with multiple button presses. The button presses and so monologue instances are offset in time. I see that as a feature, not a bug. So the prohibition on duplicate subtitles "at the same time" would be appropriately constrained.

    If you had two nearby instances of the same guard model, and they emitted the same bark at *exactly* the same moment, you'd only see one subtitle. Probably rare and not a problem.

    We'd have to rethink that if there was choral singing.

    • Like 1
  6. On 9/17/2024 at 8:55 PM, ERH+ said:

    What this script error means?:
    "...EnterFunction: locals stack overflow"

    In general in programming, it often indicates you've called a function from within itself (e.g., recursively), and didn't provide any way to stop the recursion. Sometimes more than 1 function is involved in the endless call chain.

  7. On 9/13/2024 at 5:20 PM, MirceaKitsune said:

    Edit: Doesn't work. I set the ragdoll team to 5 and AI team to 2, the wiki page indicates they are neutral. The ragdoll still makes AI alert when the map starts.

    Could you make the ragdoll a friend instead of a neutral? Maybe that would work.

  8. A Proposal to Drop the 12pt Size of Fonts (in DATs & DDS’s) from TDM 2.13 Distribution

    I’d like to suggest distributing only 24pt and 48pt sizes going forward. Reasons are as follows:

    12pt is little used. It appears that none of the readable or sign prefabs come with a .gui with a textscale value (i.e., under 0.15) that would invoke 12pt glyphs.

    Engine wouldn’t care if it’s dropped. If an FM-specific .gui used a textscale that would ordinarily invoke a font’s 12pt glyphs, but those files are not present, it would automatically switch over to 24pt instead. This is a well-worn functionality.

    12pt coverage of codepoints is unimpressive. Generally, ASCII-only at best.

    Provided 12pt glyphs are often worse-looking than scaled-down 24pt glyphs, particularly on modern screens. The traditional case for 12pt was that, when generated from TTF, it could take advantage of small-scale “hinting” to make better tiny bitmaps. Maybe some fonts do that successfully; I just looked at 12pt Camberic in detail, and there are a number of glyphs that are crap. Nowadays, with higher-rez screens than Doom days, passing it through the 12pt bitmap before scaling to the screen seems like a quality bottleneck.

    It’s not worth the effort to make 12pt fonts better. This is the most important point. Tweaking glyphs and expanding codepoint coverage (e.g., for missing or European characters) is slow work. That effort with DATs & DDS’s is better spent on 24 & 48pt.

  9. On 6/8/2024 at 6:34 PM, MirceaKitsune said:

    readables only allowed english characters, everything else will appear as a rectangle

    For a new FM, if you limit yourself to readables that use Stone, Carleton, Carleton_condensed, or (more limited) Treasure_map, then your translation can include and show European characters. However, that won't help your dream...

    On 6/8/2024 at 6:34 PM, MirceaKitsune said:

    My dream with creating a multi city hub FM was to allow the player to travel to different countries by ship. Part of the plan was having a few readables written in relevant languages, granted I can use Google Translate to obtain a few sentences in an Asian or Arabic or other language.

    The translation system is to show the language the user-selects, not what the mapper wants at particular locations. Probably you'd have to burn text into images instead, like an in-game map. And then you can have Asian, Arabic, and the artist formerly known (and I guess known again) as Prince.

  10. Refont v 2.1 is released, and available through Refont/Downloads.

    The main changes are detailed in that wiki article's much-revised section on "Errors, Warnings, and Auto-Corrections".
    Briefly, better code for these issues was first ported from datBounds, then reworked to boost coverage and consistency. Testing and incremental improvements of this was done by DAT --> REF conversions while I marched through TDM's 2.12 font corpus.

    Highlights:

    • Checks that font metric values are in expected ranges.
    • Checks if character bounds (s, t, s2, t2) expressed as 0..1 floats, can be expressed exactly as 0..256 ints.
    • Distinguishes between minor & major warnings. Minor = very-slightly-off conversion from float to int.
    • Cross-checks of (s2-s) vs imageWidth, (t2-t) vs imageHeight vs height.
    • Always generate REF character bounds values (i.e., coord_s, etc.) as ints, never as decimals.
    • When generating a REF file, for certain problematic line items, optionally append a comment starting with "// WARNING:".
    • Adds options -scaling_ok, -no_warn_comments.
  11. Example of handle use follows.

    You might consider using the atdm_message entity, and showing the map through that. It has the advantage of already having a "show" time-out-if-not-clicked mechanic. Caveat: I didn't test this code

    "classname" "atdm:gui_message"
    "name" "atdm_gui_message_my_map"
    "comment" "Slide of map. 'show' is maximum seconds if user doesn't click. 'lines' & 'text' are ignored."
    "gui" "guis/my_map.gui"
    "show" "10"

    A script to use it might be like:

    void show_map() // called from some external trigger
    {
       sys.trigger($atdm_gui_message_my_map);
       tdm_gui_message e = $atdm_gui_message_my_map;
       // Can takes awhile for the overlay handle to be created and for e.gui to be non-zero.
       // If spawnarg "delay" is zero, the default, a 0.1 second delay is imposed.
       float handlenum = 0;
       while(handlenum == 0)
       {
           handlenum = e.gui; // 10 is default overlayHandle for atdm:gui_message layer
           sys.wait(0.1);
       }
       //sys.println("Handle Num: " + handlenum);
       // MAP IS NOW SHOWING
       float map_done = 0;
       while(map_done == 0)
       {
        // NOT SHOWN: your code here to calculate xdisp, ydisp;
        $player1.setGuiFloat(handlenum, "dispx", xdisp);
        $player1.setGuiFloat(handlenum, "dispy", ydisp);
        sys.wait(0.1);
        map_done = $player1.getGuiFloat(handlenum, "MyMapDone");
       }
    }

    Where associated my_map.gui is

    windowDef MyMapSlide
    {
        visible 1
        rect 0,0,640,480 // x, y, w, h. Origin upper-left
        backcolor 0, 0, 0, 1

        // Map clicked:
        onAction {
           set "MyMapSlide::visible" "0";
           set "gui::MyMapDone" "1";
        }

        windowDef MyMapArt {
            visible 1
            rect 0,0,640,480 // x, y, w, h.
            background    "guis/assets/my_map_art"
            // If you wanted map to have a transparent perimeter, you could base it on a standard asset like "guis/assets/readables/scroll"
            // In that case, adjust rect, which can be bigger than the parent if you want to reduce transparent perimeter.
        }

        windowDef Player_position {
        // NOT SHOWN: your code to read "gui::xdisp" and "gui::ydisp" to show player position
        }
    }

     

×
×
  • Create New...