Re: Strife's Dialog System - UDMF Flavor

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.

Re: Strife's Dialog System - UDMF Flavor

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.

Re: Strife's Dialog System - UDMF Flavor

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:
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;
         }
      }
   }
}

Re: Strife's Dialog System - UDMF Flavor

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

Re: Strife's Dialog System - UDMF Flavor

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:
Conversation {
   id = 2;
   Page {
      Name = "\c[Yellow]Student";
      Dialog = "\c[Tan]Dude, this spring break is totally a drag.";
      Goodbye = "\c[Brick]Whatever.";
   }
}

Re: Strife's Dialog System - UDMF Flavor

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:
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?

Re: Strife's Dialog System - UDMF Flavor

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:
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?

Re: Strife's Dialog System - UDMF Flavor

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.

Re: Strife's Dialog System - UDMF Flavor

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.