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.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

Thanks Zergeant, much much appreciated.
User avatar
Zergeant
Posts: 107
Joined: Tue Aug 31, 2010 7:19 am
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Post by Zergeant »

No problem, the more answered questions the better.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

I've got a little problem here, hoping someone can help. My merchant is in perfect working order except for one thing..... he give you everything for free! It's making the second map of my game extremely easy, as if you run out of food or bullets you can just head back to the merchant and get lots of free stuff. I need currency, and I need a way to make it count. Any suggestions or help please?
User avatar
Zergeant
Posts: 107
Joined: Tue Aug 31, 2010 7:19 am
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Post by Zergeant »

I might edit the tutorial to explain that, but for now you can visit the Zdoom Wiki (https://zdoom.org/wiki/Universal_Strife_Dialog_Format) which explains and contains a code example on how to do that.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

Any update on how to make merchants take currency for items instead of just giving them away for free? And how to program different levels of currency? IE; Some coins, paper notes which are worth more etc... think of the original Spyro the Dragon trilogy on PS1 with gems and their value... how do we program something like this into the merchants and the game as a whole?
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Strife's Dialog System - UDMF Flavor

Post by ramon.dexter »

Well, I'm using my currency. Based on strife coins, but not inherited. You don't need to inherit coins - the coin itself does not have any kind of code in it, any code is pointing to it, so you really dont need to inherit it.

The merchant script is pretty clearly described here:

Code: Select all

conversation
{
    ID = 1; (ID is better, it is not directly connected to specified actor)
    page
    {
         name = "MY ACTOR";
         dialog = "Hello, what can I do for you?";
         choice
         {
             text = "I need a crossbow.";
             giveitem = <item sold by merchant>; "anyitem"
             nextpage = 1;
             cost
             {
                 item = <you item>; => "coin" / "bubble" / anything
                 amount = 10; =>the actual cost of item
             }
         }
    }
}
User avatar
Zergeant
Posts: 107
Joined: Tue Aug 31, 2010 7:19 am
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Post by Zergeant »

Hidden Hands wrote:Any update on how to make merchants take currency for items instead of just giving them away for free? And how to program different levels of currency? IE; Some coins, paper notes which are worth more etc... think of the original Spyro the Dragon trilogy on PS1 with gems and their value... how do we program something like this into the merchants and the game as a whole?
Just like ramon.dexter mentioned, you just utilize the cost block to define a currency and the amount the player needs. If you need another example check the updated first post, I've updated the Additional Content section to cover how to make an item cost money or... well additional items.

And yes, I've updated the first post to cover 3 new features, including the much requested Bye responses!

One thing that I couldn't cover was the "drop" feature, causing the actor to drop an item via the conversation block instead of DECORATE/ZScript. It has changed from taking an integer pointing to a mObj into taking strings pointing to classnames. Curiously enough it broke the conversation for me, I will update my GZDoom and edit my reply if that fixes it. If not, I'll contact Graf and see what's up.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

I'm having a serious problem with this currency LANGUAGE code. I've followed exactly what you have put (goodbye responses and also the cost code) but now, NPC's are not interactable, shopkeepers say that items cost something but still give the stuff away for free, goodbye responses are still showing up as the default ones and finally some items have been removed from the shop completely (ie; a gun that costs 40 currency).

What on Earth has happened to my code? Why isn't it working? I've attached a couple screenshots of my code.
Attachments
codeexample2.png
codeexample2.png (5.11 KiB) Viewed 2108 times
codeexample.png
User avatar
Zergeant
Posts: 107
Joined: Tue Aug 31, 2010 7:19 am
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Post by Zergeant »

It's hard to tell from a few screenshots, but I'd recommend downloading the most recent build of GZDoom via Here and see if that fixes it.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

Still have the problem. I'm actually in GZdoombuilder and Slade3 but ZDOOM II UDMF format. Does this work on this? All the other stuff has so far.
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Strife's Dialog System - UDMF Flavor

Post by ramon.dexter »

Please, paste here your WHOLE dialog lump. I§s hard to tell what§s wrong.

Also, the language lump is best for randomized dialogues. If yu want something special, like the shopkeeper, I can advice you to not use the language lump. You just have to write down the whole dialogue as you want it.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Strife's Dialog System - UDMF Flavor

Post by Hidden Hands »

I just wanted to ask - out of interest - if you meet an NPC and they have a key that you need to get through a door for a price, and you buy it, how can you make that NPC stop trying to sell it to you again when you speak to them again? How can I change the dialog for after the transaction?

As for pasting the whole code, I will do that shortly. Thank you. It's very strange that the goodbyes aren't working out. Hopefully it will help.
User avatar
Zergeant
Posts: 107
Joined: Tue Aug 31, 2010 7:19 am
Location: Sweden

Re: Strife's Dialog System - UDMF Flavor

Post by Zergeant »

Check Additional Content section, I'm sure both the If-Player-Carries-Item and Exclude Choice feature will achieve that effect.
User avatar
ramon.dexter
Posts: 1520
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Strife's Dialog System - UDMF Flavor

Post by ramon.dexter »

Wow, nice new features! I was aware of the iftem - link thing, but the include and exclude blocks are completely new to me, and it's nice! Also, the goodbye definition is a thing. now I can make fully localized content with full translation, no "bye" anymore.
User avatar
Leon_Portier
Posts: 62
Joined: Sun Feb 12, 2017 3:30 pm
Location: Dark side of Bavaria

Re: Strife's Dialog System - UDMF Flavor

Post by Leon_Portier »

Is the actor the classname, the Tid or something else?
I just cant get the conversation to innitiate, so I figured there must I have done wrong.
Help is very appreciated. :)

Non-working map + Screenshots:
https://www.dropbox.com/s/yrgl3x3kydozt ... d.zip?dl=0

Im using GZDooM 2.4.0x64, Slade 3.1.1.4 and GZDooMBuilder v2.3.02787
Code:
(Edit: added "conversation")
Spoiler:
Last edited by Leon_Portier on Tue Apr 18, 2017 11:11 am, edited 2 times in total.
Post Reply

Return to “Tutorials”