MZ Custom Shop UI with NPC Chat

There's a lot of really nice shop and general UI plugins, however most cost money and I don't have the budget to test them all.
Spoiler
1742715719821.png

This should be easy to do, its essentially Mjshi's NPC Dialogue Shop for MZ (I couldn't get it to work with FOSSIL)
Synrec's Shop Builder looks the closest to what I'm looking for, however outside opinions are always good!
Hiya!

This one seems to do what you were looking for almost exactly: https://nine-yusha.com/plugin-menuscreenshop/

It's in Japanese but I think there's nothing too complex that google translate and the like can't make clear in the instructions. I think you just need to make sure it has the requisite base plugin too so it all works.
Hiya!

This one seems to do what you were looking for almost exactly: https://nine-yusha.com/plugin-menuscreenshop/

It's in Japanese but I think there's nothing too complex that google translate and the like can't make clear in the instructions. I think you just need to make sure it has the requisite base plugin too so it all works.
Yeah, thats very in Japanese. I'll try and figure it out, however i would prefer something in English😅

Edit: Im working on translating it, however redistribution is prohibited EXCEPT for sample projects, so I make this my next long-term project
1742778559288.png
I've got something in the works. It's still a work in progress as the Buy/Sell functions aren't working properly yet. But I've got it set up so that selecting Chat will bring up a few topics to pick from, and they'll give you different answers in the chat window.

Features include
  • Parallax backgrounds: allowing you to draw the shop interior if you like, or you can just use whatever parallax you like.
  • Shop music: Allows you to play shop music, similar to Final Fantasy 1.
  • Shopkeep Portrait: Allows you to use a picture from the picture folder to show the shop keeper.
  • Chat options: Pick a chat option from the list, get a response back. It's all set in a call script before the shop initializes so it can be influenced by game variable/switches and conditional branches.
Things I still need to work on
  • Buy/Sell functionaliy.
  • Switch Chat and Cancel buttons.
  • Hide/move the touch UI buttons.
Give me a few days to hammer it all out.
customshop.png
I've got something in the works. It's still a work in progress as the Buy/Sell functions aren't working properly yet. But I've got it set up so that selecting Chat will bring up a few topics to pick from, and they'll give you different answers in the chat window.

Features include
  • Parallax backgrounds: allowing you to draw the shop interior if you like, or you can just use whatever parallax you like.
  • Shop music: Allows you to play shop music, similar to Final Fantasy 1.
  • Shopkeep Portrait: Allows you to use a picture from the picture folder to show the shop keeper.
  • Chat options: Pick a chat option from the list, get a response back. It's all set in a call script before the shop initializes so it can be influenced by game variable/switches and conditional branches.
Things I still need to work on
  • Buy/Sell functionaliy.
  • Switch Chat and Cancel buttons.
  • Hide/move the touch UI buttons.
Give me a few days to hammer it all out.View attachment 335526
I LOVE THIS!! KUDOS!!! I never would've thought about shop music, it makes so much sense too! Do you think you can make it compatible with PKD VPlayer? If not thats all good!
@SangHendrix also have something similar, check this.
@SangHendrix also have something similar, check this.
THIS IS SOOOOO CLOSE!!!!!! I gotta figure out if i can change the height and widths of windows and itll be perfect!!! Ill have to really poke around the script

(Ill still translate LLChurch's plugins)
customshopimage.jpg
Ok it's done. in the zip folder i've provided the plugin along with a couple of shop parallaxes i made out of battlebacks. There's no setup required, just active the plugin in the plugin manager.

How to use:

In the event that handles your shop, add the following call script


JavaScript:
$gameSystem.setShopConfig({
    ownerPicture: "People1_5",          // Picture file in img/pictures/
    ownerPictureX: 430,               // X position of the shopkeeper picture
    ownerPictureY: 106,               // Y position of the shopkeeper picture
    parallax: "Shop1",       // Parallax background file in img/parallaxes/
    music: "Town8",               // Background music file in audio/bgm/
    defaultChat: "Welcome to my shop!", // Default message shown in the chat window
    chatOptions: [                    // Array of chat options
        { text: "How's business?", response: "It's been great lately!" },
        { text: "Any special deals?", response: "Check out my rare items!" },
        { text: "Tell me about yourself", response: "I'm just a humble merchant..." }
    ]
});

This is just a basic example. You can have as many chat options as you want just add

{ text: "CHAT_OPTION", response: "RESPONSE_TEXT_HERE" }

just make sure all but the last line has a comma at the end your you'll get syntax errors.


Further more, you can get more fancy with the chat options. Specific chat options have the ability to turn on/off switches and control variables. (just be careful not to divide by zero)

JavaScript:
chatOptions: [
        {
            text: "How's business?",
            response: "It's been great lately!",
            variable: { id: 1, value: 1, operation: "set" }, // Sets variable 1 to 1
            switch: { id: 1, value: true } // Sets switch 1 to true
        },
        {
            text: "Any special deals?",
            response: "Check out my rare items!",
            variable: { id: 1, value: 2, operation: "multiply" } // Multiplies variable 1 by 2
        },
        {
            text: "Tell me about yourself",
            response: "I'm just a humble merchant...",
            variable: { id: 1, value: 1, operation: "add" } // Adds 1 to variable 1
        }
    ]


And even more advanced, and a bit experimental, are event triggers. Makes things happen when you leave the shop if certain criteria are met. For example, if you spend X amount of gold, or buy a certain item you can trigger a specific common event once you leave the shop. This feature may still be in need of more testing. Paste this after the chatOptions.

JavaScript:
    events: [
        { condition: { totalGoldSpent: 500 }, eventId: 1 }, // Trigger event 1 when 500 gold is spent
        { condition: { itemBought: { type: 0, id: 1 } }, eventId: 2 }, // Trigger event 2 when item ID 1 is bought
        { condition: { variable: { id: 1, value: 1 } }, eventId: 3 }, // Trigger event 3 when variable 1 is 1
        { condition: { switch: { id: 1, value: true } }, eventId: 4 } // Trigger event 4 when switch 1 is true
    ]

You can have as many as you want, just always make sure to add a comma at the end of each bracket except for the last one.

And finally, here's an example of the whole call script set up as a visual aid.


Code:
$gameSystem.setShopConfig({
    ownerPicture: "SHOP_OWNER_PICTURE",
    ownerPictureX: 430,
    ownerPictureY: 106,
    parallax: "PARALLAX_IMAGE_FILE",
    music: "BGM_FILE",
    defaultChat: "DEFAULT_CHAT_WHEN_ENTERING_SHOP",
    chatOptions: [
        {
            text: "CHAT_OPTION_1",
            response: "OWNER_RESPONCE_1",
            variable: { id: 1, value: 1, operation: "set" }, //example variable handle
            switch: { id: 1, value: true } //example switch handle
        },
        {
            text: "CHAT_OPTION_2",
            response: "OWNER_RESPONCE_2",
            variable: { id: 1, value: 2, operation: "multiply" }
        },
        {
            text: "CHAT_OPTION_3",
            response: "OWNER_RESPONCE_3",
            variable: { id: 1, value: 1, operation: "add" }
        },
        {
            text: "CHAT_OPTION_4",
            response: "OWNER_RESPONCE_4",
            variable: { id: 1, value: 2, operation: "divide" }
        }
    ],
    events: [
        { condition: { totalGoldSpent: 500 }, eventId: 1 }, // Calls common event 001 if you spend 500 gold.
        { condition: { variable: { id: 1, value: 1 } }, eventId: 3 } //Calls common event 003 if Variable 001 == 1
    ]
});

Message me if you have any questions
View attachment 335671Ok it's done. in the zip folder i've provided the plugin along with a couple of shop parallaxes i made out of battlebacks. There's no setup required, just active the plugin in the plugin manager.

Message me if you have any questions
You should also host this on itch.io as a lot of people could use it. I get a lot of downloads for my plugins there even if no one comments.
View attachment 335671Ok it's done. in the zip folder i've provided the plugin along with a couple of shop parallaxes i made out of battlebacks. There's no setup required, just active the plugin in the plugin manager.

How to use:

In the event that handles your shop, add the following call script


JavaScript:
$gameSystem.setShopConfig({
    ownerPicture: "People1_5",          // Picture file in img/pictures/
    ownerPictureX: 430,               // X position of the shopkeeper picture
    ownerPictureY: 106,               // Y position of the shopkeeper picture
    parallax: "Shop1",       // Parallax background file in img/parallaxes/
    music: "Town8",               // Background music file in audio/bgm/
    defaultChat: "Welcome to my shop!", // Default message shown in the chat window
    chatOptions: [                    // Array of chat options
        { text: "How's business?", response: "It's been great lately!" },
        { text: "Any special deals?", response: "Check out my rare items!" },
        { text: "Tell me about yourself", response: "I'm just a humble merchant..." }
    ]
});

This is just a basic example. You can have as many chat options as you want just add

{ text: "CHAT_OPTION", response: "RESPONSE_TEXT_HERE" }

just make sure all but the last line has a comma at the end your you'll get syntax errors.


Further more, you can get more fancy with the chat options. Specific chat options have the ability to turn on/off switches and control variables. (just be careful not to divide by zero)

JavaScript:
chatOptions: [
        {
            text: "How's business?",
            response: "It's been great lately!",
            variable: { id: 1, value: 1, operation: "set" }, // Sets variable 1 to 1
            switch: { id: 1, value: true } // Sets switch 1 to true
        },
        {
            text: "Any special deals?",
            response: "Check out my rare items!",
            variable: { id: 1, value: 2, operation: "multiply" } // Multiplies variable 1 by 2
        },
        {
            text: "Tell me about yourself",
            response: "I'm just a humble merchant...",
            variable: { id: 1, value: 1, operation: "add" } // Adds 1 to variable 1
        }
    ]


And even more advanced, and a bit experimental, are event triggers. Makes things happen when you leave the shop if certain criteria are met. For example, if you spend X amount of gold, or buy a certain item you can trigger a specific common event once you leave the shop. This feature may still be in need of more testing. Paste this after the chatOptions.

JavaScript:
    events: [
        { condition: { totalGoldSpent: 500 }, eventId: 1 }, // Trigger event 1 when 500 gold is spent
        { condition: { itemBought: { type: 0, id: 1 } }, eventId: 2 }, // Trigger event 2 when item ID 1 is bought
        { condition: { variable: { id: 1, value: 1 } }, eventId: 3 }, // Trigger event 3 when variable 1 is 1
        { condition: { switch: { id: 1, value: true } }, eventId: 4 } // Trigger event 4 when switch 1 is true
    ]

You can have as many as you want, just always make sure to add a comma at the end of each bracket except for the last one.

And finally, here's an example of the whole call script set up as a visual aid.


Code:
$gameSystem.setShopConfig({
    ownerPicture: "SHOP_OWNER_PICTURE",
    ownerPictureX: 430,
    ownerPictureY: 106,
    parallax: "PARALLAX_IMAGE_FILE",
    music: "BGM_FILE",
    defaultChat: "DEFAULT_CHAT_WHEN_ENTERING_SHOP",
    chatOptions: [
        {
            text: "CHAT_OPTION_1",
            response: "OWNER_RESPONCE_1",
            variable: { id: 1, value: 1, operation: "set" }, //example variable handle
            switch: { id: 1, value: true } //example switch handle
        },
        {
            text: "CHAT_OPTION_2",
            response: "OWNER_RESPONCE_2",
            variable: { id: 1, value: 2, operation: "multiply" }
        },
        {
            text: "CHAT_OPTION_3",
            response: "OWNER_RESPONCE_3",
            variable: { id: 1, value: 1, operation: "add" }
        },
        {
            text: "CHAT_OPTION_4",
            response: "OWNER_RESPONCE_4",
            variable: { id: 1, value: 2, operation: "divide" }
        }
    ],
    events: [
        { condition: { totalGoldSpent: 500 }, eventId: 1 }, // Calls common event 001 if you spend 500 gold.
        { condition: { variable: { id: 1, value: 1 } }, eventId: 3 } //Calls common event 003 if Variable 001 == 1
    ]
});

Message me if you have any questions
I think you dropped the wrong file
1743218924952.png
I think you dropped the wrong
I think you dropped the wrong file
View attachment 335861
Oops, i sure did. delete that one. And redownload. I fixed the file in my previous post.
Wowowow! All of y'alls help has been awesome! Even helping me finally start learning this forsaken code! Thank you guys so much!

@InFecTioN This is phenomenal! Obviously i could ask for a million more details, but those really arent necessary. Im not sure how parameters work, if those can be implemented for fine tuning and menu dimensions, but its nothing expected for you to do! And i 1000% agree with AquaEcho, this should absolutely be on itch.io! Chance to make money on your skills! (id love to send you some sort of dono for your work)

I do still want to translate most LL_Church plugins, as a lot of similar i know cost money in English. Making stuff easier access scratches that "kid on the internet" part of my brain. I may put it on itch (for free, after asking the dev) if i can, if not lmk if any of yall wanna be pinged when i make a thread here!


Update! I made a quick edit of a screenshot for how id prefer the layout, however im gonna try and do it myself!

Shop.gif

Original thread: https://forums.rpgmakerweb.com/threads/custom-shop-ui-with-npc-chat.176491/