valks-terraria-mods / merchantsplus Goto Github PK
View Code? Open in Web Editor NEWThe popular MerchantsPlus Terraria mod.
License: MIT License
The popular MerchantsPlus Terraria mod.
License: MIT License
Have a quick look at the following page on the wiki. https://github.com/valkyrienyanko/MerchantsPlus/wiki/Angler
The Angler's items, prices, conditions and slots were found in the following code. https://github.com/valkyrienyanko/MerchantsPlus/blob/master/Shops/ShopAngler.cs
The Angler's projectiles and loot were found in the following code.
https://github.com/valkyrienyanko/MerchantsPlus/blob/master/NPCs/Angler.cs
This is what needs to be done for the other merchants eventually.
If you want to get a better idea of how this mod functions, switch to 1.4.3 version of Terraria and download the "MerchantsPlus" mod from the workshop while you still can before August 1st (as that is when 1.4.3 is no more). Once in game, right click the guide and you will notice a custom UI on the left of your screen with 2 buttons. Click on the button on the left to open the custom shop for the guide.
Shops have been entirely changed in 1.4.4. This has completely broken this mod. Please switch over to the 1.4.4 branch when trying to solve this issue.
Note that all shops are opened from this part of the code.
https://github.com/Valks-Terraria-Mods/MerchantsPlus/blob/5735ab2a07e45f22947665f5e3a4b0b75883c7c5/UI/ShopUI.cs#L112C86-L137
How are we suppose to create a new custom shop when in order to open this shop we need to override from ModNPC::OnChatButtonClicked(bool firstButton, ref string shop)
and set shop equal to the shop we want to open. ModNPC is for custom NPCs but we are trying to add custom shops to existing vanilla NPCs like the merchant, guide, nurse and dyrad.
Or more simply put how do we make custom shop(s) appear when pressing a custom made button in 1.4.4.
The following line has been commented out because of a out of index bounds error that freezes the game. To reproduce this error, uncomment the line, notice the error in-game. Client.log can be found in C:\Program Files (x86)\Steam\steamapps\common\tModLoader\tModLoader-Logs
MerchantsPlus/Merchants/Shop.cs
Line 47 in 5735ab2
This line of code also gives an error and thus the reason it has been commented out.
MerchantsPlus/Merchants/Shop.cs
Line 50 in 5735ab2
Migration Guide (Shop Changes): https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#shop-changes-aka-declarative-shops
Declarative Shops PR: tModLoader/tModLoader#3219
The new way of creating custom shops: https://github.com/tModLoader/tModLoader/blob/e6caaaf678efd2a69deece4d72fdaecc4391bd26/ExampleMod/Content/NPCs/ExamplePerson.cs#L281-L309
How to open custom shops: https://github.com/tModLoader/tModLoader/blob/e6caaaf678efd2a69deece4d72fdaecc4391bd26/ExampleMod/Content/NPCs/ExamplePerson.cs#L276
How to modify existing shops: (although not very helpful because this mod adds shops to NPCs that originally did not have shops in the first place like the Guide and Nurse) https://github.com/tModLoader/tModLoader/blob/1.4.4/ExampleMod/Common/GlobalNPCs/ExampleNPCShop.cs
Describe the bug
I talk to the nurse to open her shop menu but whenever I do an action that would bring up the shop icon, it would show up for a short moment then disappear.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected to see the shop menu like every other NPC but the nurse's shop won't show up long enough for it to open up.
Please talk to me on discord (valk#3277) before attempting to modify the mod to how you see fit.
Mod needs changes to prices, NPC lore, NPC attacks as well as other things I can't think off hand right now.
Describe the bug
The merchant sells copper and iron ore for 1 gold each.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expected a much cheaper price.
Mod could use a descriptive readme and wiki underling everything about the mod.
Many items have unbalanced prices that need to be addressed as well as some conditions that need to be revised.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.