Strife's Dialog System - UDMF Flavor

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Re: Strife's Dialog System - UDMF Flavor

Postby ramon.dexter » Mon Nov 09, 2020 12:39 am

Zergeant wrote:
tetssian wrote:hello again and thanks again for the help Vostyok, but now i was wondering is it possible to play a sound when you dont have the neccesary item or you end a dilog, im making the RE4 merchant just for fun but well i cant seem to put a sound when the transaction ends or fail and second is it possible that even if you fail or end the transaction the dialog doesnt close and return to the fist dialog? cause i try to put the closedialog in false or true but it doesnt make anything it just close the dialog and dont call the page i ask for, even if closedialog doesnt show at all it just end the dialog instead of continue it. BTW thank youy zeargent for the advice in named dialogs

You can try putting A_PlaySound in the Yes and No states, which respectively corresponds to a successful or failed transaction, see the Conversation States on the first page for more information.
I haven't experimented much with merchant actors so far, but I don't think there is a way to keep the dialog open when attempting to buy items currently.


It is completely possible. I'n on tablet, so I cannot properly write code example. But if you want to buy, not close dialog and stay on the same page, you just simply put into nextpage the number/name of the shop page, and make Closedialog = false.
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Strife's Dialog System - UDMF Flavor

Postby Vostyok » Mon Nov 09, 2020 3:06 am

I did some testing, and the above is true. In some situations, nextpage will override Closedialog entirely. It seems that the order of the statements is important.
User avatar
Vostyok
Picture by RetroMuffin34 <3
 
Joined: 17 Jan 2015
Location: New Eden
Discord: Vostyok#3164

Re: Strife's Dialog System - UDMF Flavor

Postby ramon.dexter » Mon Nov 09, 2020 5:01 am

The order of statements is not important at all. All that matters is function 'Closedialog' set to 'false'. Setting the same to 'true' causes to close the conversation by a option with function set to true.
edit: In fact, the dialogue system don't care if you have any giveitem="" functions in the dialog choice. The main control is from the closedialog=true/false function.

I have set-up many shops in a way that when player buys a item, the conversation closes. This is good for buying weapons. And I have many shops that don't close when buying an item (good for buying bigger amounts of items like ammo or health, without the need to start the conversation to buy each one item).

For the order of functions - I have not tested it to be 100% sure, but as I'm making the conversations, some are copy pasted, yet some are manually written. The order of funtions varies and the conversation just works as I have set it up.

Here is nice exaple of fully working one-page shop:
Code: Select allExpand view
Conversation {
   ID = 3;
   Page {
        pageName = "SH_energyAmmoVendor_opener";
      Name = "Technician";
      Dialog = "\c[white]\c[white]Hello, how may I serve you?";
      Panel = "M_FALSP2";
      Goodbye = "\c[red]Goodbye";
      Choice {
         Text = "Buy Night Eye Device";
         NextPage = "SH_energyAmmoVendor_opener";
         CloseDialog = true;
         DisplayCost = true;
         YesMessage = "Here it is!";
         NoMessage = "Not enough gold!";
         GiveItem = "NightEyeDevice";
         Cost {
            item = "coin";
            amount = 50;
         }
      }
      Choice {
         Text = "Buy Blaster Turret";
         NextPage = "SH_energyAmmoVendor_opener";
         CloseDialog = true;
         DisplayCost = true;
         YesMessage = "Here it is!";
         NoMessage = "Not enough gold!";
         GiveItem = "blasterTurret_item";
         Cost {
            item = "coin";
            amount = 75;
         }
      }
      Choice {
         Text = "Buy Flight Harness";
         YesMessage = "Here you go!";
         NoMessage = "Not enough gold!";
         GiveItem = "jetpack_item";
         NextPage = "SH_energyAmmoVendor_opener";
         DisplayCost = true;
         Cost {
            Item = "coin";
            Amount = 80;
         }
      }
      Choice {
         Text = "Buy Personal Shield";
         YesMessage = "Here you go!";
         NoMessage = "Not enough gold!";
         GiveItem = "shieldModule";
         NextPage = "SH_energyAmmoVendor_opener";
         DisplayCost = true;
         Cost {
            Item = "coin";
            Amount = 150;
         }
      }
   }
}
User avatar
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Strife's Dialog System - UDMF Flavor

Postby tetssian » Tue Nov 10, 2020 8:38 pm

ok this could work, i will try it and see if i manage to get it work, i will ask again if i have trouble
tetssian
 
Joined: 30 May 2012

Re: Strife's Dialog System - UDMF Flavor

Postby KaseyZombieRoo » Tue Nov 24, 2020 3:57 am

I seen that the topic of how to change colors came up earlier in this thread. I spent the past couple days trying to figure it out, cause my current dialogue-heavy wad has lots of red/orange walls that the default bright red text blends in with. So the default colors had to go.

Then I realized that simple TEXTCOLO works for me, especially since then I can have certain speakers have different colors. I def felt dumb, since I used that before on simple HUDMessages and prints.

I figured I'd post this example for others who wanted to change the colors in their projects:

Code: Select allExpand view
Conversation {
   id = 2;
   Page {
      Name = "\c[Yellow]Student";
      Dialog = "\c[Tan]Dude, this spring break is totally a drag.";
      Goodbye = "\c[Brick]Whatever.";
   }
}
User avatar
KaseyZombieRoo
 
Joined: 24 Nov 2020
Operating System: Windows Vista/7/2008 64-bit

Re: Strife's Dialog System - UDMF Flavor

Postby Zergeant » Tue Dec 01, 2020 3:21 pm

KaseyZombieRoo wrote:I seen that the topic of how to change colors came up earlier in this thread. I spent the past couple days trying to figure it out, cause my current dialogue-heavy wad has lots of red/orange walls that the default bright red text blends in with. So the default colors had to go.

Then I realized that simple TEXTCOLO works for me, especially since then I can have certain speakers have different colors. I def felt dumb, since I used that before on simple HUDMessages and prints.

I figured I'd post this example for others who wanted to change the colors in their projects:

Code: Select allExpand view
Conversation {
   id = 2;
   Page {
      Name = "\c[Yellow]Student";
      Dialog = "\c[Tan]Dude, this spring break is totally a drag.";
      Goodbye = "\c[Brick]Whatever.";
   }
}

This is a good finding, mind if I include it in OP next time I make an update?
User avatar
Zergeant
 
Joined: 31 Aug 2010
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Postby Vostyok » Tue Dec 22, 2020 6:45 pm

I have noticed an issue. I wonder if anyone else has encountered this. Following the example in the OP, I have been using item checks to link to separate pages.

I have created a token for tracking quests completed. I want different responses to be displayed depending on how many quests the player has completed. I have used this code:

Code: Select allExpand view
link=57;
      ifitem
      {
       item = "MoralityToken";
       amount = 6;
       }


However, it appears that the Amount identifier does not seem to be recognised = the check passes regardless of how many of the item you hold.

Might this be a minor typo in the OP?
User avatar
Vostyok
Picture by RetroMuffin34 <3
 
Joined: 17 Jan 2015
Location: New Eden
Discord: Vostyok#3164

Re: Strife's Dialog System - UDMF Flavor

Postby NicoTheGoat » Wed Dec 30, 2020 7:35 am

Vostyok wrote:However, it appears that the Amount identifier does not seem to be recognised = the check passes regardless of how many of the item you hold.
Might this be a minor typo in the OP?


IfItem is supposed to check the amount field, but the check is broken (checking for 'Count', not 'Amount'). I've submitted a PR that fixes this, so this (hopefully) won't be a problem for much longer.
User avatar
NicoTheGoat
 
Joined: 29 Dec 2019
Discord: emmy#4389
Github ID: nicothegoat
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)

Re: Strife's Dialog System - UDMF Flavor

Postby KaseyZombieRoo » Wed Feb 10, 2021 9:06 pm

Zergeant wrote:This is a good finding, mind if I include it in OP next time I make an update?


Sorry for the delay, forgot I posted that till just now. I posted it for anyone who could use the info, so it's all good to go on the OP.
User avatar
KaseyZombieRoo
 
Joined: 24 Nov 2020
Operating System: Windows Vista/7/2008 64-bit

Previous

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests