Jump to content
The Dark Mod Forums

Simple dialog interface


Mr Lemony Fresh

Recommended Posts

Hello, I'm planning an FM and I think given the nature of it's size it'd really benefit from a dialogue interface to add a a bit of immersion to an otherwise short mission. The dialogue will be used locate an item with the help of a shady character on the street, then to trick someone into thinking that you are someone else while giving them instructions to make some guards move away from that item.

I wonder If anyone would be willing to lend a hand? I need it to be something like the book interface but not obstructing your view, where the turn page button gives you more chat options but you can use the arrow keys to select a topic. And if possible activate actual speech coming from the NPC (with lip sink and audio from their direction)

 

The aim of the fan mission is to try and make the dark mod look especially good, so if you want to help and can script, that'd be great.

18588.png
Link to comment
Share on other sites

Hello, I'm planning an FM and I think given the nature of it's size it'd really benefit from a dialogue interface to add a a bit of immersion to an otherwise short mission. The dialogue will be used locate an item with the help of a shady character on the street, then to trick someone into thinking that you are someone else while giving them instructions to make some guards move away from that item.

I wonder If anyone would be willing to lend a hand? I need it to be something like the book interface but not obstructing your view, where the turn page button gives you more chat options but you can use the arrow keys to select a topic. And if possible activate actual speech coming from the NPC (with lip sink and audio from their direction)

 

The aim of the fan mission is to try and make the dark mod look especially good, so if you want to help and can script, that'd be great.

 

I don't know how to do guis, unfortunately. But I have to say the idea is a good one.

I'd really like to see a chat system, a similar like the one in oblivion. Technically, given the versatility of doom3 gui system, I think it would not be very difficult to make a gui with upper area for character text, middle area for normal 3dview of the character, and lower area for the chat options. The chat would start by frobbing an AI and work much like normal readables, ie. if you walk away the chat goes away. Heck, you could probably set up shady characters selling you items for loot during the mission like in deus ex with this.

 

With a system like this a mapper could have a player-AI conversation without recruiting voice-actors since the actor text could be also done as a readable only. I can only imagine the possiblities of missions where you combine stealth and well chosen words to gain your objectives.

 

If you manage to pull this one off, I'd love to see a tutorial how it is made, I'm fascinated by the entire idea.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

middle area for normal 3dview of the character, and lower area for the chat options

 

Well I was thinking, just have everything on the bottom of the screen, and when the character speaks, the text is something personal to that character, like an associated colour, or a font that looks like their handwriting. Or to simplify it, when talking to another person, they have one colour, and when you talk, you have another so that the whole thing can be below the NPC and so that you can see them and the background clearly, but not so much above the character so that your eyes don't have to dart around the screen.

 

EDIT: also, initially i was thinking about Oblivion when i brought this up, but i realised that time stops and you zoom in on their face when you speak to them which is probably not characteristic of the sneaky and dynamic gameplay.

Edited by Mr Lemony Fresh
18588.png
Link to comment
Share on other sites

I won't have time to do any work on this but always willing to offer advice if I have any. It is possible to do the following:

 


  •  
  • Tag a character so you have something to frob, eg, a shoulder tag.
  • Have a prepared text entity that displays prepared text when triggered by that tag, eg, "Would you like to buy 1. Water arrows, 2. broadheads, 3. blackjack"
  • Have eg, 3 speak entities in the inventory, 1, 2, 3 so you select your response by frobbing the 'use' key while you have say 'select 2' selected in the inventory.
  • These entities call a script which has to detect which character's tag was frobbed and which number you chose.
  • The script displays an appropriate text "I want broadheads"
  • The script triggers a conversation so the character carries out an animation and places some broadheads on the counter. Or more simply the broadheads are just spawned on the counter.

 

But to extend that simple model it could get very complicated.

Link to comment
Share on other sites

Well, there are interactive GUIs in D3, so no need to work with inventory entities. I don't know how they are created though. My best bet would be to check D3 mods on moddb. Maybe there is a mod that did something similar, so you can have a look at how they implemented it...

 

But this is an interesting project... :)

Link to comment
Share on other sites

most of the interactive gui's in doom 3 are related to getting information from a computer, playing the turkey basher game in the rec room, accessing the pda and using buttons,and opening those pass coded martain buggy weapon cabinets.

Edited by stumpy
Link to comment
Share on other sites

Exactly, I had a look around earlier and found out that there's a pretty functional one in the wrathchild mod

 

Click here for to see what i mean

 

However, 1: It looks funny the way it is appearing in real time as though We're looking through a new aged shop window, 2: It'd look COMPLETELY out of place in the dark mod.

18588.png
Link to comment
Share on other sites

 I'm also new to gui scripting and I think guys like rich_is_bored or some other programmers could have done this in their sleep. But as they are obviously not interested, I've tried something myself, which might look somewhat complicated, and sometimes redundant, but it's late at night and I thought it could be like a starting point for you.

 

The gui itself has two problems. One is the huge cursor and the hand symbol. Somewhere at doom3world I remember reading about getting this fixed by setting nocursor 0 and menugui 1, the second problem is the moving of the whole screen while trying to choose an option on the gui.

 

Anyway, I'm putting my files here in the spoiler for you to have a look:

 

simpledialog.gui

 

 

windowDef Desktop

{

    rect        0,0,640,480

    visible        1

   

    windowDef npcMsg

    {

        rect        200,40,240,240

        visible        1

              forecolor     0.9, 0.9, 0.9, 1

              text         "gui::npctextmsg"

              textscale     0.25

        textalign    1

              font         "fonts/medusa"

        backcolor    0.75294125,0.75294125,0.75294125,0.3

        bordersize    1

        bordercolor    0,0,0,1

    }

   

    windowDef playerMsg1

    {

        rect        200,280,240,40

        visible        1

              forecolor     0.9, 0.9, 0.9, 1

              text         "gui::playertextmsg1"

              textscale     0.25

        textalign    1

              font         "fonts/medusa"

        backcolor    0.75294125,0.75294125,0.75294125,0.3

        bordersize    1

        bordercolor    0,0,0,1

        onACtion {

            runScript    "btnPlayerMsg1"

        }

    }

   

    windowDef playerMsg2

    {

        rect        200,320,240,40

        visible        1

              forecolor     0.9, 0.9, 0.9, 1

              text         "gui::playertextmsg2"

              textscale     0.25

        textalign    1

              font         "fonts/medusa"

        backcolor    0.75294125,0.75294125,0.75294125,0.3

        bordersize    1

        bordercolor    0,0,0,1

        onACtion {

            runScript    "btnPlayerMsg2"

        }

    }

   

    windowDef playerMsg3

    {

        rect        200,360,240,40

        visible        1

               forecolor     0.9, 0.9, 0.9, 1

              text         "gui::playertextmsg3"

              textscale     0.25

        textalign    1

              font         "fonts/medusa"

        backcolor    0.75294125,0.75294125,0.75294125,0.3

        bordersize    1

        bordercolor    0,0,0,1

        onACtion {

            runScript    "btnPlayerMsg3"

        }

    }

}

 

 

 

simpledialog.script

 

 

float     gui;        // handle for the gui Overlay

float     pagecounter;    // helps keeping track of position in the text tree

float    lasttree;    // same as above and exit criterion

 

string gui_name = "guis/simpledialog.gui";

 

// text content, xxx0 is AI-Text, xxx1-3 are possible answers

// page 0 - filled at first start

string msg0;

string msg1;

string msg2;

string msg3;

// page 1

string t10 = "Sorry, I took you for someone else I knew a long time ago. My stomeache is empty my strange friend and I need someone helping me to fill it. Will you be so kind?";

string t11 = "Why would I want to do that? I barely have enough for myself!";

string t12 = "Let me give you everything I have. I will just grab it again from someone else.";

string t13 = "I have to go. Goodbye!";

string t20 = "Yes of course, I should have known that from the start. Do you want to buy a dictionary?";

string t21 = "In my profession I don't need many words.";

string t22 = "Lorem ipsum bla bla bla?";

string t23 = "Is this some new high-tech stuff?";

string t30 = "Are you sure?";

string t31 = "I am!";

// page 2

string t110 = "Get lost then!";

string t111 = "I surely will!";

string t120 = "That is very kind of you, young man. I have to go now.";

string t121 = "Wait a moment, where are my presents?";

string t122 = "Hmpf...";

string t210 = "Creo que voy a llamar a la policia ahora mismo...";

string t211 = "I am really having trouble talking to you. I think I will leave.";

string t220 = "That is not real latin.";

string t221 = "How would you know that?";

string t222 = "Whatever";

string t230 = "Please, leave me alone and never talk to me again.";

string t231 = "(Flee)";

// page 3

string t2210 = "I know a lot of things. Things you really would like to know.";

string t2211 = "Please tell me more!";

// page 4

string t22110 = "I doubt you're worth it.";

string t22111 = "I'll pay you!";

// page 5

string t221110 = "How much?";

string t221111 = "More than you ever possessed!";

// page 6

string t2211110 = "Oh, nice. I once was a king and had plenty of gold, you know.";

string t2211111 = "I knew it! From the first moment i saw you. Let me know your name.";

// page 7

string t22111110 = "I'm sick of this conservation. I think we've proven the point of it, right?";

string t22111111 = "Huh?";

string t22111112 = "Yes. Get me out of here.";

 

// called by ai-frob in map and btnPlayerMsg-functions

void showSimpleDialogGui() {

    // making sure, default msg-values appear after leaving and reentering gui by frobbing

    if ( gui == 0 && pagecounter == 0 && lasttree == 0 ) {

        msg0 = "Wolle Packung Rose kaufe?";

        msg1 = "What?";

        msg2 = "Sorry, I don't speak your language.";

        msg3 = "No, thank you!";

    }

    // exit gui when conversation is over

    if ( lasttree == 0 && pagecounter != 0 ) {

        $player1.destroyOverlay( gui );

        pagecounter = 0;

        gui = 0;

        return;

    }

    // clean old gui every time an answer is clicked

    if ( gui != 0 ) {

        $player1.destroyOverlay( gui );

    }

    // create new gui and fill it with text

    gui = $player1.createOverlay( gui_name, 10 );

    $player1.setGuiString( gui, "npctextmsg", msg0 );   

    $player1.setGuiString( gui, "playertextmsg1", msg1 );

    $player1.setGuiString( gui, "playertextmsg2", msg2 );

    $player1.setGuiString( gui, "playertextmsg3", msg3 );

}

 

void btnPlayerMsg1() {

    // user clicked first answer on page 1, so we show the following dialog of page 2

    if ( pagecounter == 0 ) {

        msg0 = t10;

        msg1 = t11;

        msg2 = t12;

        msg3 = t13;

        lasttree = 10;

    }

    // user clicked t11 OR t21 OR t31

    if ( pagecounter == 1 ) {

        if ( lasttree == 10 ) {

            msg0 = t110;

            msg1 = t111;

            msg2 = "";

            msg3 = "";

            lasttree = 110;

        }

        if ( lasttree == 20 ) {

            msg0 = t210;

            msg1 = t211;

            msg2 = "";

            msg3 = "";

            lasttree = 210;

        }

        if ( lasttree == 30 ) {

            lasttree = 0;

        }

    }

    // t111 OR t121 OR t211 OR t221 OR t231

    if ( pagecounter == 2 ) {

        if ( lasttree == 110 || lasttree == 120 || lasttree == 210 || lasttree == 230 ) {

            lasttree = 0;

        }

        if ( lasttree == 220 ) {

            msg0 = t2210;

            msg1 = t2211;

            msg2 = "";

            msg3 = "";

            lasttree = 2210;

        }

    }

    if ( pagecounter == 3 ) {

        if ( lasttree == 2210 ) {

            msg0 = t22110;

            msg1 = t22111;

            msg2 = "";

            msg3 = "";

            lasttree = 22110;

        }

    }

    if ( pagecounter == 4 ) {

        if ( lasttree == 22110 ) {

            msg0 = t221110;

            msg1 = t221111;

            msg2 = "";

            msg3 = "";

            lasttree = 221110;

        }

    }

    if ( pagecounter == 5 ) {

        if ( lasttree == 221110 ) {

            msg0 = t2211110;

            msg1 = t2211111;

            msg2 = "";

            msg3 = "";

            lasttree = 2211110;

        }

    }

    if ( pagecounter == 6 ) {

        if ( lasttree == 2211110 ) {

            msg0 = t22111110;

            msg1 = t22111111;

            msg2 = t22111112;

            msg3 = "";

            lasttree = 22111110;

        }

    }

    if ( pagecounter == 7 ) {

        if ( lasttree == 22111110 ) {

            lasttree = 0;

        }

    }

    pagecounter += 1;

    showSimpleDialogGui();

}

 

void btnPlayerMsg2() {

    if ( pagecounter == 0 ) {

        msg0 = t20;

        msg1 = t21;

        msg2 = t22;

        msg3 = t23;

        lasttree = 20;

    }

    // t12 OR t22

    if ( pagecounter == 1 ) {

        // t12

        if ( lasttree == 10 ) {

            msg0 = t120;

            msg1 = t121;

            msg2 = t122;

            msg3 = "";

            lasttree = 120;

        }

        if ( lasttree == 20 ) {

            msg0 = t220;

            msg1 = t221;

            msg2 = t222;

            msg3 = "";

            lasttree = 220;

        }

    }

    if ( pagecounter >= 2 ) {

        lasttree = 0;

    }

    pagecounter += 1;

    showSimpleDialogGui();

}

 

void btnPlayerMsg3() {

    if ( pagecounter == 0 ) {

        msg0 = t30;

        msg1 = t31;

        msg2 = "";

        msg3 = "";

        lasttree = 30;

    }

    // t13 OR t23

    if ( pagecounter == 1 ) {

        if ( lasttree == 10 ) {

            lasttree = 0;

        }

        if ( lasttree == 20 ) {

            msg0 = t230;

            msg1 = t231;

            msg2 = "";

            msg3 = "";

            lasttree = 230;

        }

    }

    if ( pagecounter >= 2 ) {

        lasttree = 0;

    }

    pagecounter += 1;

    showSimpleDialogGui();

}

 

 

 

 

 

simpledialog.map (frobbing ai runs script)

 

 

Version 2

// entity 0

{

"classname" "worldspawn"

// primitive 0

{

brushDef3

{

( 0 0 1 -352 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -512 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 0.25 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -512 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 1.875 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 -160 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 -64 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0.25 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 0 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.375 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 288 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 1

{

brushDef3

{

( 0 0 1 -288 ) ( ( 0.00390625 0 15.75 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -576 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -512 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 1.625 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 0 ) ( ( 0.00390625 0 1.75 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 0 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 0 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 512 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 2

{

brushDef3

{

( 0 0 1 -288 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.25 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -512 ) ( ( 0.00390625 0 0.75 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -576 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 2.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 0 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 0.25 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 -64 ) ( ( 0.00390625 0 15.75 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 64 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 512 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 1.625 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 3

{

brushDef3

{

( 0 0 1 -448 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -512 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 15.75 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -512 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 2.25 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 -64 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 -64 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.75 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 0 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.75 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 1 0 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 4

{

brushDef3

{

( 0 0 1 -288 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -448 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -512 ) ( ( 0.00390625 0 0.5 ) ( 0 0.00390625 1.625 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 0 ) ( ( 0.00390625 0 2.25 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 -128 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 0 ) ( ( 0.00390625 0 15.75 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 64 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 5

{

brushDef3

{

( 0 0 1 -288 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.75 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -512 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -448 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 1.625 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 0 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 15.75 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 -64 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 -64 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 0 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

}

// entity 1

{

"classname" "info_player_start"

"name" "info_player_start_1"

"angle" "180"

"origin" "448 224 32"

}

// entity 2

{

"classname" "atdm:ambient_world"

"name" "light_1"

"_color" "0.40 0.40 0.40"

"light_center" "0 0 0"

"light_radius" "384 384 320"

"nodiffuse" "1"

"noshadows" "1"

"nospecular" "1"

"origin" "256 192 256"

"parallel" "0"

"texture" "lights/ambientlightnfo"

}

// entity 3

{

"classname" "atdm:ai_townsfolk_beggar_armed"

"name" "atdm_ai_townsfolk_beggar_armed_1"

"frobable" "1"

"origin" "224 224 16"

"frob_action_script" "showSimpleDialogGui"

}

 

 

 

 

 

I'm not quite sure if setting a global variable named "gui" is a wise thing...

Link to comment
Share on other sites

I'm glad to see someone interested in helping, but the problem is, neither me nor jdude know anything about scripting (I dunno maybe jdude knows a little :huh:) So even with what you've given me, I still wouldn't have the faintest clue of what to do with it, which is a shame since you seemed to have put quite a bit of work into it.

 

Unless you'd be a pal and help implement it ;) It's for a good cause! :P

 

Otherwise, thanks for going to the trouble.

 

maybe I can just go around hounding different programmers until I get one that wants to help, that's how I got jdude doing the mapping :)

18588.png
Link to comment
Share on other sites

I doubt I'm on the right way with this, depending what you have on your mind.

 

The script is very limited and has to be adjusted to a special dialog. I would have no idea how to adjust it to your needs like e. g. multiple characters, letting it automatically disappear when walking away, etc. Adding large nested dialogs could get very confusing, too. Another annoyance is the string length limit of 128 chars.

 

The solution might be somewhere in the readables-system, but I obviously have no clue what I'm talking about, as I'm not a programmer.

 

Update

 

I rewrote my script and it is now able to talk to more than one person and also get stuff from them (not yet finished)

 

The whole text goes as a key/value pair in an entity.

 

Only very minor changes in simpledialog.gui, mainly in the script and the map now has two guys and of course some written text to test.

 

simpledialog.gui

windowDef Desktop

{

rect 0,0,640,480

visible 1

menugui 1

 

windowDef Monstermessage

{

rect 200,40,240,240

visible 1

forecolor 0.9, 0.9, 0.9, 1

text "gui::monstermessagetext"

textscale 0.25

textalign 1

font "fonts/medusa"

backcolor 0.75294125,0.75294125,0.75294125,0.3

bordersize 1

bordercolor 0,0,0,1

}

 

windowDef Playermessage1

{

rect 200,280,240,40

visible 1

forecolor 0.9, 0.9, 0.9, 1

text "gui::playermessagetext1"

textscale 0.25

textalign 1

font "fonts/medusa"

backcolor 0.75294125,0.75294125,0.75294125,0.3

bordersize 1

bordercolor 0,0,0,1

onAction {

runScript "FirstAnswer"

}

}

 

windowDef Playermessage2

{

rect 200,320,240,40

visible 1

forecolor 0.9, 0.9, 0.9, 1

text "gui::playermessagetext2"

textscale 0.25

textalign 1

font "fonts/medusa"

backcolor 0.75294125,0.75294125,0.75294125,0.3

bordersize 1

bordercolor 0,0,0,1

onAction {

runScript "SecondAnswer"

}

}

 

windowDef Playermessage3

{

rect 200,360,240,40

visible 1

forecolor 0.9, 0.9, 0.9, 1

text "gui::playermessagetext3"

textscale 0.25

textalign 1

font "fonts/medusa"

backcolor 0.75294125,0.75294125,0.75294125,0.3

bordersize 1

bordercolor 0,0,0,1

onAction {

runScript "ThirdAnswer"

}

}

}

 

simpledialog.script

string guiName = "guis/simpledialog.gui";

 

float guiHandle;

float dialogHistory;

float fMsg0Key;

float fMsg1Key;

float fMsg2Key;

float fMsg3Key;

 

string msg0;

string msg1;

string msg2;

string msg3;

string msg0Key;

string msg1Key;

string msg2Key;

string msg3Key;

string monsterName;

 

void showSimpleDialogGui() {

// (re-)set the root of our entity that contains all the text as keyvalue at first start

if ( guiHandle == 0 ) {

msg0Key = "0";

msg1Key = "1";

msg2Key = "2";

msg3Key = "3";

}

// fill messages with text in entity arguments

msg0 = $simpledialog.getKey( monsterName+msg0Key );

msg1 = $simpledialog.getKey( monsterName+msg1Key );

msg2 = $simpledialog.getKey( monsterName+msg2Key );

msg3 = $simpledialog.getKey( monsterName+msg3Key );

// get items from monster

if ( monsterName == "sonny" && dialogHistory == 220 ) {

$player1.addInvItem ( $broadhead1 );

}

if ( monsterName == "larry" && dialogHistory == 210 ) {

$player1.addInvItem ( $ropearrow1 );

}

// close gui if the monster has nothing more to say

if ( msg0 == "" ) {

$player1.destroyOverlay( guiHandle );

dialogHistory = 0;

guiHandle = 0;

return;

}

// clean old gui every time an answer is clicked

if ( guiHandle != 0 ) {

$player1.destroyOverlay( guiHandle );

}

// create new gui

guiHandle = $player1.createOverlay( guiName, 10 );

// display the messages in the gui

$player1.setGuiString( guiHandle, "monstermessagetext", msg0 );

$player1.setGuiString( guiHandle, "playermessagetext1", msg1 );

$player1.setGuiString( guiHandle, "playermessagetext2", msg2 );

$player1.setGuiString( guiHandle, "playermessagetext3", msg3 );

}

 

// called by clicking in gui

void FirstAnswer() {

fMsg0Key = dialogHistory*10+10;

fMsg1Key = dialogHistory*10+11;

fMsg2Key = dialogHistory*10+12;

fMsg3Key = dialogHistory*10+13;

dialogHistory = fMsg0Key;

msg0Key = fMsg0Key;

msg1Key = fMsg1Key;

msg2Key = fMsg2Key;

msg3Key = fMsg3Key;

showSimpleDialogGui();

}

 

void SecondAnswer() {

fMsg0Key = dialogHistory*10+20;

fMsg1Key = dialogHistory*10+21;

fMsg2Key = dialogHistory*10+22;

fMsg3Key = dialogHistory*10+23;

dialogHistory = fMsg0Key;

msg0Key = fMsg0Key;

msg1Key = fMsg1Key;

msg2Key = fMsg2Key;

msg3Key = fMsg3Key;

showSimpleDialogGui();

}

 

void ThirdAnswer() {

fMsg0Key = dialogHistory*10+30;

fMsg1Key = dialogHistory*10+31;

fMsg2Key = dialogHistory*10+32;

fMsg3Key = dialogHistory*10+33;

dialogHistory = fMsg0Key;

msg0Key = fMsg0Key;

msg1Key = fMsg1Key;

msg2Key = fMsg2Key;

msg3Key = fMsg3Key;

showSimpleDialogGui();

}

 

// called by frobbing a monster

void Sonny() {

monsterName = "sonny";

showSimpleDialogGui();

}

void Larry() {

monsterName = "larry";

showSimpleDialogGui();

}

 

simpledialog.map

Version 2

// entity 0

{

"classname" "worldspawn"

"editor_drLastCameraPos" "386.328 220.826 126.796"

"editor_drLastCameraAngle" "-4.5 186.6 0"

// primitive 0

{

brushDef3

{

( 0 0 1 -192 ) ( ( 0.015625 0 0 ) ( 0 0.015625 62 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -320 ) ( ( 0.015625 0 6 ) ( 0 0.015625 1 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -512 ) ( ( 0.015625 0 1 ) ( 0 0.015625 5.5 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 -320 ) ( ( 0.015625 0 8 ) ( 0 0.015625 4 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 128 ) ( ( 0.015625 0 1020 ) ( 0 0.015625 1 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 256 ) ( ( 0.015625 0 0 ) ( 0 0.015625 1019.5 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 160 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 15.5 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 1

{

brushDef3

{

( 0 0 1 -160 ) ( ( 0.015625 0 63 ) ( 0 0.015625 62 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -352 ) ( ( 0.015625 0 2 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -512 ) ( ( 0.015625 0 3 ) ( 0 0.015625 4.5 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 0 ) ( ( 0.015625 0 7 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 -224 ) ( ( 0.015625 0 1020 ) ( 0 0.015625 1018.5 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 256 ) ( ( 0.015625 0 1022 ) ( 0 0.015625 1018.5 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 320 ) ( ( 0.00390625 0 255.5 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 2

{

brushDef3

{

( 0 0 1 -160 ) ( ( 0.015625 0 0 ) ( 0 0.015625 61 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -320 ) ( ( 0.015625 0 3 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -544 ) ( ( 0.015625 0 1 ) ( 0 0.015625 10 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 0 ) ( ( 0.015625 0 8 ) ( 0 0.015625 1 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 128 ) ( ( 0.015625 0 63 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 32 ) ( ( 0.015625 0 0 ) ( 0 0.015625 1018.5 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 512 ) ( ( 0.00390625 0 0.25 ) ( 0 0.00390625 1.125 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 3

{

brushDef3

{

( 0 0 1 -480 ) ( ( 0.015625 0 0 ) ( 0 0.015625 58 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -320 ) ( ( 0.015625 0 6 ) ( 0 0.015625 63 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -512 ) ( ( 0.015625 0 1 ) ( 0 0.015625 9 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 -32 ) ( ( 0.015625 0 8 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 128 ) ( ( 0.015625 0 1020 ) ( 0 0.015625 63 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 256 ) ( ( 0.015625 0 0 ) ( 0 0.015625 63 ) ) "textures/common/caulk" 0 0 0

( 0 0 1 0 ) ( ( 0.00390625 0 2 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 4

{

brushDef3

{

( 0 0 1 -160 ) ( ( 0.015625 0 1 ) ( 0 0.015625 62 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -672 ) ( ( 0.015625 0 6 ) ( 0 0.015625 1018.5 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -512 ) ( ( 0.015625 0 1023 ) ( 0 0.015625 4.5 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 0 ) ( ( 0.015625 0 9 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 96 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 256 ) ( ( 0.015625 0 66 ) ( 0 0.015625 1018.5 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -128 ) ( ( 0.00390625 0 1 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 5

{

brushDef3

{

( 0 0 1 -160 ) ( ( 0.015625 0 0 ) ( 0 0.015625 63 ) ) "textures/common/caulk" 0 0 0

( 0 1 0 -320 ) ( ( 0.015625 0 5 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -736 ) ( ( 0.015625 0 1 ) ( 0 0.015625 4.5 ) ) "textures/common/caulk" 0 0 0

( 0 0 -1 0 ) ( ( 0.015625 0 8 ) ( 0 0.015625 63 ) ) "textures/common/caulk" 0 0 0

( 0 -1 0 128 ) ( ( 0.015625 0 1021 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( -1 0 0 224 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/common/caulk" 0 0 0

( 1 0 0 -256 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 254.625 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

// primitive 6

{

brushDef3

{

( 0 0 1 -128 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 1 0 -272 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.9375 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 1 0 0 -288 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.9375 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 0 -1 112 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 0 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( 0 -1 0 176 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.9375 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

( -1 0 0 256 ) ( ( 0.00390625 0 0 ) ( 0 0.00390625 255.9375 ) ) "textures/darkmod/wood/boards/polished_shiny" 0 0 0

}

}

}

// entity 1

{

"classname" "info_player_start"

"name" "info_player_start_1"

"angle" "180"

"origin" "448 224 32"

}

// entity 2

{

"classname" "atdm:ambient_world"

"name" "light_1"

"_color" "0.40 0.40 0.40"

"light_center" "0 0 0"

"light_radius" "192 384 192"

"nodiffuse" "1"

"noshadows" "1"

"nospecular" "1"

"origin" "384 224 128"

"parallel" "0"

"texture" "lights/ambientlightnfo"

}

// entity 3

{

"classname" "atdm:ai_townsfolk_beggar_armed"

"name" "Sonny"

"frob_action_script" "Sonny"

"frobable" "1"

"origin" "320 176 16"

}

// entity 4

{

"classname" "func_static"

"name" "simpledialog"

"larry0" "Hello, my name is Larry!"

"larry1" "Hello Larry!"

"larry10" "I'm telling you the entity key numbers of this dialog. Think about it beforehand, the current one is >larry10<"

"larry11" "Tell me this number"

"larry110" "You just clicked >larry11<"

"larry111" "Tell me this number"

"larry1110" "You just clicked >larry111<"

"larry1111" "One more time, please."

"larry11110" "You just clicked >larry1111<"

"larry11111" "This could have been the beginning of a wonderful conversation."

"larry11112" "I still don't know what this is all about."

"larry11113" "Let's end this by clicking on the key named >larry11113<"

"larry1112" "Enough of this."

"larry112" "Tell me this number"

"larry1120" "You clicked >larry112<"

"larry1121" "Bye!"

"larry113" "OK, I got it."

"larry12" "Tell me this number"

"larry120" "You just clicked >larry12<"

"larry121" "zzzZZzzzzZZZZzzzzZZZZZ"

"larry13" "Tell me this number"

"larry130" "You just clicked >larry13<"

"larry131" "I like this so much I will immediately fix this broken gui"

"larry2" "Do you have something for me?"

"larry20" "Do you want a rope arrow?"

"larry21" "Yes"

"larry210" "It's in your pocket. Bye!"

"larry211" "Thank you!"

"larry22" "No"

"larry3" "Bye bye, Larry!"

"model" "simpledialog"

"origin" "288 224 48"

"sonny0" "Hello, my name is Sonny!"

"sonny1" "Hello Sonny!"

"sonny10" "I don't talk much. Larry does all the talking for me..."

"sonny11" "Now that was a simple dialog."

"sonny2" "Do you have something for me?"

"sonny20" "Do you want a broadhead arrow?"

"sonny21" "No"

"sonny22" "Yes"

"sonny3" "Bye bye, Sonny!"

// primitive 0

{

brushDef3

{

( 0 0 1 -16 ) ( ( 0.03125 0 1.5 ) ( 0 0.03125 2.5 ) ) "textures/common/nodraw" 0 0 0

( 0 1 0 -16 ) ( ( 0.03125 0 29.5 ) ( 0 0.03125 0 ) ) "textures/common/nodraw" 0 0 0

( 1 0 0 -16 ) ( ( 0.03125 0 1.5 ) ( 0 0.03125 0 ) ) "textures/common/nodraw" 0 0 0

( 0 0 -1 -16 ) ( ( 0.03125 0 1.5 ) ( 0 0.03125 29.5 ) ) "textures/common/nodraw" 0 0 0

( 0 -1 0 -16 ) ( ( 0.03125 0 2.5 ) ( 0 0.03125 0 ) ) "textures/common/nodraw" 0 0 0

( -1 0 0 -16 ) ( ( 0.03125 0 30.5 ) ( 0 0.03125 0 ) ) "textures/common/nodraw" 0 0 0

}

}

}

// entity 5

{

"classname" "atdm:ai_townsfolk_beggar_armed"

"name" "Larry"

"frob_action_script" "Larry"

"frobable" "1"

"origin" "320 272 16"

}

// entity 6

{

"classname" "atdm:ammo_broadhead"

"name" "broadhead1"

"origin" "295.184 184 144.816"

"rotation" "0 0 -1 0 1 0 1 0 0"

}

// entity 7

{

"classname" "atdm:ammo_ropearrow"

"name" "ropearrow1"

"origin" "294.184 208 144.816"

"rotation" "0 0 -1 0 1 0 1 0 0"

}

 

Edited by dumpkin
Link to comment
Share on other sites

Cool, is there some way I can see load it up and see the results?
I don't know if I understand what you mean, but if you're asking what to do with the text in the spoilers:

 

1. Create a folder called "guis" in your doom3/darkmod/ path.

2. Create an empty textfile in it which is called "simpledialog.gui". Copy the spoilered text under simpledialog.gui in it and save.

3. Create an empty textfile in doom3/darkmod/maps/ called "simpledialog.script". Copy the spoilered script text in it. Watch the ending isn't .txt but .script

4. Do like above but with a file called "simpledialog.map"

5. Start darkmod open console, dmap simpledialog, map simpledialog, et voila (hopefully)

Edited by dumpkin
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 2 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...