TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 24 of 24

Thread: Book text alignment

  1. #1
    Master Builder 2018
    Registered: Jul 2008

    Book text alignment

    I am suddenly unable to center a line of text on a page of a book. I was using the PosterScroll object with parch3 book art, though I have since tried parch and parch2 as well. I've tried using ParchEd and just doing it by hand, but no matter how many spaces I indent the text (using the space bar), it always remains justified to the left margin. Other lines of text are being moved from the left margin, but not the first line, or title, which is what I want centered. I've opened it in Notepad++ and checked for any special characters, page breaks, End of Line symbols, etc. but all that is there are the expected End of Line symbols at the end of each line of text.

    For reference, it should look like this:

    TITLE
    Subtitle

    Body text...

    But instead it looks like this:

    TITLE
    Subtitle

    Body text...


    The subtitle can be moved over from the left margin, though I haven't managed to get it centered yet, but the title will not budge from the left margin.

    I tried using a book object and changing the model name to match the open scroll, and that didn't work either. I tried using the PBOOK book art on the scroll, but that just crashed dromed.
    I've centered text countless times in the past and have never run into any such thing. I'm hoping someone has some ideas.

  2. #2
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    I don't know. But you might insert some funny looking ANSI Code characters to move the text.

    Code:
    ```````MyText```````

  3. #3
    Member
    Registered: Apr 2011
    Location: Montpellier, France
    I usually just add a dot as the first character then add spaces to move the text to the center.
    It would basically look like this.

    Code:
    .           TITLE
               Subtitle

  4. #4
    Master Builder 2018
    Registered: Jul 2008
    Both good suggestions, thanks. I'll probably resort to one, but wish I knew what was causing this. Never saw it before.

  5. #5
    Member
    Registered: Dec 2011
    Location: Ferrol - Spain
    Unna, I“d like to have these characters for Spanish:

    ü
    æ


    Can you do it for me?

  6. #6
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Dragonsreach
    It's not up to Unna, it's a question of whether or not the book font supports them.

  7. #7
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    Supported are the ANSI characters 1-127 (standard ASCII) and the extended character set (128-255)

    means, you can also have other characters as usual. This works for example

    Code:
    „„„„„„„„„ MyText „„„„„„„„
    But some others won't work. Just try it.

  8. #8
    Member
    Registered: May 2002
    Location: Texas
    If you have only one page in your book you could create a new book with the centered text added directly to the book image.

  9. #9
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: Dragonsreach
    It would be easier and use less resources to place the text as a decal on a blank page, wouldn't it?

  10. #10
    Master Builder 2018
    Registered: Jul 2008
    Either of those would work, yes. But this is for the update of The Scarlet Cascabel, and we're still sticking with the original contest rules. Just cause, lol.

  11. #11
    Member
    Registered: Jun 2007
    Location: Russia
    Guys, what about the character = 255 (0xFF) for text alignment? AFAIK, it looks just like the whitespace.

    BTW, the matter of text alignment is very important for those who translate FMs. Wish there was a way to check all FM readables at once, either by pressing a special key combination, or by clicking a hidden area in the game's menu, or by loading a tiny hidden level that includes all FM readables in a tiny room...

  12. #12
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    To find a list of readables, you have to load the mission in DromEd.

    Hit F5, mark object (-1)
    Hit query
    -->Book-->Text
    -->Book-->Art (if there is one)
    This is the list of book objects and the str names.

  13. #13
    Member
    Registered: Jun 2007
    Location: Russia
    You mean I can watch readables there, in DromEd, the same way as it would be in the game? I'm afraid, I'm no DromEd user .
    I suppose, it'll be difficult enough for FM authors to create a tiny level with all FM readables?

  14. #14
    Dóttirin klęšist oft móšur möttli
    Registered: Apr 2015
    You can note the book object number and jump to the object (key: F8). Go in game mode there and read it.

    This a very basic task in DromEd. You can learn it in a couple of minutes, just try it.

  15. #15
    Member
    Registered: Jun 2007
    Location: Russia
    Hmm... I'll try.

  16. #16
    Member
    Registered: May 2002
    Location: Texas
    Quote Originally Posted by MoroseTroll View Post
    Guys, what about the character = 255 (0xFF) for text alignment? AFAIK, it looks just like the whitespace.

    BTW, the matter of text alignment is very important for those who translate FMs. Wish there was a way to check all FM readables at once, either by pressing a special key combination, or by clicking a hidden area in the game's menu, or by loading a tiny hidden level that includes all FM readables in a tiny room...
    I tried that a few days ago and it actually generates a character in Thief. IIRC it was like this: ė

  17. #17
    Member
    Registered: Jun 2007
    Location: Russia
    Yikes! Sorry, I didn't know that .

  18. #18
    Member
    Registered: Apr 2011
    NewDark added the 'notrim' option so that you can do leading whitespace easily. Just add the option in your readable (I always put it before the text, but I think it works after it as well), and then Thief won’t steal all your spaces from in front of your title.

    Support for leading whitespaces, in order to for example center a page title, has also been added but is not enabled
    by default in order to not break any existing content. It has to be enabled for each book .STR that wants to use it
    by adding a "no_trim" value like this:

    no_trim: "1"

  19. #19
    Member
    Registered: Apr 2011
    Quote Originally Posted by MoroseTroll View Post
    Wish there was a way to check all FM readables at once, either by pressing a special key combination, or by clicking a hidden area in the game's menu, or by loading a tiny hidden level that includes all FM readables in a tiny room...
    First, make a note of the book text and book art for each readable in the mission in notepad or on paper or whatever (for example, using the query Unna described to find them).

    Then later you can check any of them quickly from the console in Dromed. Go into game mode, press : to open the console, and type:

    test_book_ex bookname,artname

    This will reload the .str file before displaying it, so you can alt-tab back and forth to your editor to tweak the text, and back to the game check the book again easily. When coming back to the game, use Ctrl+P to open the console instead of : and it’ll keep the last command so you don’t even have to type it again while tweaking that book.

  20. #20
    Member
    Registered: Apr 2006
    Location: France, Paris
    Thanks for the tips vfig, i'll try it.

    I've requested a new config variable in cam_ext.cfg for Le Corbeau on the french forum, I pray the Builder he'll implement it :

    ;used for FM translators, reload the readable file (including subtitle file) each time you click on a readable in the game. Translators can edit/correct text file and test the result immediatly in the game
    force_readeable_reload

  21. #21
    Member
    Registered: Oct 2004
    Location: Ireland/Poland
    ;used for FM translators, reload the readable file (including subtitle file) each time you click on a readable in the game.
    That would be useful not only for translators. It could potentially open a possibility to create dynamic content of readables, by modifying the text files directly. Not sure if this would work for the New Dark, of course, but Squirrell allows for I/O operations, so theoretically this could work...

  22. #22
    Member
    Registered: Apr 2006
    Location: France, Paris
    Quote Originally Posted by PinkDot View Post
    It could potentially open a possibility to create dynamic content of readables, by modifying the text files directly. Not sure if this would work for the New Dark, of course, but Squirrell allows for I/O operations, so theoretically this could work...
    Not sure of that. The trigger routine would be the player action (use key) and not the file modification itself. I imagine the easiest way to code would be something like this :

    If Selected.object.type = Readable and Player.Action = Use_Key
    reload_readable(Selected.object)
    display(Selected.object)
    Endif.

    Text file would be refreshed in memory ONLY when player is clicking on a book in game.
    I don't think he would use a routine that would check every 100ms if any text file has been modified.

    What exactly do you have in mind ? I don't see what could be the result by using dynamic readables in game... Ascii animations ?

  23. #23
    Member
    Registered: Oct 2004
    Location: Ireland/Poland
    What exactly do you have in mind ? I don't see what could be the result by using dynamic readables in game... Ascii animations ?
    I didn't mean realtime updates. More like level randomization. Let's say, a code to a safe is randomized on a game start. And there exists a scroll, that contains this code or some hint at least. And the text of that scroll would be changed along with the randomized code, by the same script.

    Or maybe some kind of a log with entries added based on the player actions...

    Or a magic book, that displays a different content after certain events...

    I'm sure people would come up with some interesting applications. I've seen somebody mentioned dynamic readables before.

    Having said that, I do see how unsafe it could become to allow Squirrel to change game files on the fly... I wonder if anyone tried that already...

  24. #24
    Member
    Registered: Apr 2006
    Location: France, Paris

    toggle_book_autoreload

    @PinkDot : Ok I see now with your examples what could be done.

    @vfig : I've tested and it worked, really nice feature.
    I didn't test with test_book_ex command.
    Instead I've put command toggle_book_autoreload in StartUp.cmd :
    - you don't have to type this command each time you open DromEd
    - every readable is reloaded in DromEd when you activate the book in game mode. (seems not working with on screen text, only book/scroll)

    thanks to Lady R and Sensut post : https://www.ttlg.com/forums/showthread.php?t=140892
    Last edited by Apiai; 10th Feb 2020 at 10:52.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •