Skip to content

A few questions for those who write dialogues

chimericchimeric Member Posts: 1,163
edited September 2016 in General Modding
Hello.

1) How do I handle journal entries? Is there a tutorial? I know about the Add... and Erase... actions, but there is more.

2) How to introduce randomness in dialogues? I can use a RandomNum trigger, but it doesn't work within SetGlobal, you have to give a definite number there. But what if I want to set a Global to 1 or 2, randomly? That's one thing; and just directly - random. mutually exclusive display options for reply lines? If I put a RandomNum(2,1) in front of one, a RandomNum(2,2) in front of another reply line, is it a common check for both or will the engine roll separately to see if the first one appears, then to see if the second one appears?

3) Just to make sure: no way to color or emphasize the lines, is there?

4) I get a compile problem in Weidu with COMPILE EVALUATE_BUFFER with a dialogue that does compile in DLTC and works in the game. I can import the .d file in DLTC, it makes a .dlg out of it, but if I click "Check Dialogue," it gives me this window:



That points to a particular node, but there is nothing wrong or special about it - it just sets a variable, gives a couple of items, the same functions that work elsewhere in the dialogue. Have you run into this error? What's up?

yyy.jpg 79.4K

Comments

  • ArdanisArdanis Member Posts: 1,736
    1) IIRC there's a WeiDU function added to handle new journal format

    2) SetGlobalRandom()

    3) If you have SoD, check strref 69033. Colors are defined in bgee.lua

    4) That really depends on what exactly you're trying to complie
  • argent77argent77 Member Posts: 3,478
    The recolored strings are a cool new feature.

    @Ardanis Is it possible to change font styles as well (bold, italic, underlined)? Something like this would be even more useful.
  • chimericchimeric Member Posts: 1,163
    1) Thanks. I'd rather do without Weidu where I can, though. I just need the basic record quest - record quest header and record completed quest - record completed quest record functions.

    2) Thanks!

    3) Only SoD?

    4) Well, that's the problem. It's nothing special in that branch - it ends the dialogue, sets one global, which is set, gives two items, which are given, and 50 XP. No parsing errors, syntax problems, just that odd message.
  • AquadrizztAquadrizzt Member Posts: 1,069
    If you are writing dialog, you basically have to use WeiDu.
  • chimericchimeric Member Posts: 1,163
    edited September 2016
    No I don't. People have written dialogues for years without any Weidus. But I do use it for installation and compatibility, since it can create TLK strings. That's 90% of what I will ever need from Weidu. I don't need advanced functions, nothing. My problem now is that I have a .d file that works just fine and converts to a DLG, if I use DLTC for it, but Weidu doesn't want to compile it.
    Post edited by chimeric on
  • chimericchimeric Member Posts: 1,163
    edited September 2016
    This is what DLTCEP writes in the background after that error:

    Incorrect variable: GLOBALSPRITE_IS_DEAD (block #2:Action object #1(1)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #2:Action object #2(2)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #3:Action object #0(0)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #3:Action object #1(1)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #3:Action object #2(2)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #4:Action object #0(0)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #4:Action object #1(1)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #4:Action object #2(2)) Titleless journal string reference: 0 for block #4:EraseJournalEntry(I:STRREF*)(263) Action was: EraseJournalEntry(0) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #5:Action object #0(0)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #5:Action object #1(1)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #5:Action object #2(2)) Titleless journal string reference: 0 for block #5:AddJournalEntry(I:Entry*,I:Type*JourType)(173) Action was: AddJournalEntry(0,QUEST_DONE) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #6:Action object #0(0)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #6:Action object #1(1)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #6:Action object #2(2)) Incorrect variable: GLOBALQEEBIELUCK (block #0:SetGlobalRandomPlus(S:Name*,S:Area*,I:Count*,I:Size*,I:Plus*)(364)) Incorrect variable: GLOBALSPRITE_IS_DEAD (block #0:Action object #0(0))

    A sample from a long list of complaints. The journal entry I haven't done right yet, but I will. This GLOBALSPRITE_IS_DEAD thing is mysterious, though. And Incorrect variable: GLOBALQEEBIELUCK (block #0:SetGlobalRandomPlus(S:Name*,S:Area*,I:Count*,I:Size*,I:Plus*)(364)) is probably DLTCEP's way of saying that it doesn't recognize one of the newer functions @Ardanis suggested (thanks), SetGlobalRandom(). I don't know why it writes it as ...Plus. Anyway, DLTCEP is an old tool, but everything works in the game, so how do I figure out just why Weidu refuses to do COMPILE on this .d file?

    That error is the worst part, but about the colored text: I hear it can be done in basic BGEE after 2.0. How?
    Post edited by chimeric on
  • ArdanisArdanis Member Posts: 1,736

    @Ardanis Is it possible to change font styles as well (bold, italic, underlined)? Something like this would be even more useful.
    If it is, then I haven't heard of it...

    This is what DLTCEP writes in the background after that error:
    Without seeing .d contents it's hard to say what is wrong.

    is probably DLTCEP's way of saying that it doesn't recognize one of the newer functions @Ardanis suggested (thanks), SetGlobalRandom()
    SGRP is basically an extension of SGR and shares the ID value with it, so when the script is decompiled it will autiomatically transform into the latest entry. In simpler terms, it works as it should.

    about the colored text: I hear it can be done in basic BGEE after 2.0. How?

    Wrap the part of the string you want coloured in tags ^X text goes here ^- where X is the font color code defined in bgee.lua file.
  • argent77argent77 Member Posts: 3,478
    Ardanis said:

    about the colored text: I hear it can be done in basic BGEE after 2.0. How?

    Wrap the part of the string you want coloured in tags ^X text goes here ^- where X is the font color code defined in bgee.lua file.
    You can even specify colors directly in hexadecimal notation. Use ^0xAABBGGRR text goes here ^- where AA is alpha (and should always be FF), BB is blue, GG is green and RR is red.

  • chimericchimeric Member Posts: 1,163
    The error with the .d filed turned out to be my fault, I sorted it out. Now the journal is the only obstacle to my getting a little mod out. It's strange - the scripts for quests in the game just use the basic action and a string, which refers to a text with a header, plus QUEST or QUEST_DONE. But when I do the same (only I put the string itself in the .d file, of course, not a reference number), I get a message that Miscellaneous information was added or some such, and the texts just show as 0's.
  • chimericchimeric Member Posts: 1,163
    Bump. @argent77 , this is the explanation you gave me about how to color text. ^0xFF??????, and ^ again to close. Now I've gotten around to actually using it. But after FF in the beginning, there remain 2 characters for blue, green and red each. How is that supposed to work? Why only 2 digits for each?
  • ArdanisArdanis Member Posts: 1,736
    It's hexadecimal format, i.e. two characters (not just digits) can cover the value range from 0 to 255.
  • chimericchimeric Member Posts: 1,163
    edited February 2017
    Okay, in that case I know what my color code is. Right from http://www.color-hex.com. A neat site, that one. Thanks!

    P.S. The hex code worked to color the message the right way, but it's still for the whole text block. The other ^ doesn't do anything. Maybe it's supposed to be a whole-text function?
  • argent77argent77 Member Posts: 3,478
    The closing tag for colored text is "^-".
  • chimericchimeric Member Posts: 1,163
    All right! Very nice.
Sign In or Register to comment.