Author: Ferase
Category: Library
Danmakufu Version: ph3
Tags: player addon addon passive equipment ability um cards dnhcard ph3sx unconnected marketeers
Last updated at: October 10 2021, 11:03 PM

File Size: 7.6 MB
Downloads: 24


HOTFIX 1 v1.3 (10/10/21 5:53 PM CST):
- Added the ability to set which keys will control active card usage and cycling. Supports both virtual keys and normal keys (default keys are still C and V)
---- VK_USER1 and VK_USER2 are no longer the default, as it was brought to my attention that these keys aren't read properly in most scripts and players. That said, while they can still be set as the use/cycle keys, I do not recommend you do so for the sake of compatibility

UPDATE v1.3 (10/10/21 1:12 PM CST):
- Moved the DNHCard folder out of the example player's folder
---- This was done to better account for people who want to include DNHCard with more than one player. For more information on what exactly was done and how to include DNHC_Hook.dnh in this way, check the included README.txt. Comments inside of Default_Player_Rumia_DNHCard.dnh have also been updated
- Added new options into UserSettings.dnh
---- Enable/disable random card pulling for the card shop menu
---- Explicitly define cards that will appear before the random cards
------- If random cards are off, only these and the default cards (now renamed to after cards) will be presented
- Sped up the default card scrolling animation a little
- Some miscellaneous optimizations and improvements to the overall code

----------

NOTE:
This project is ongoing, and therefore there will likely be a number of updates to fallow that improve upon this library.

----------

This is DNHCard, an addon for player scripts in Danmakufu ph3sx that mimics the card shop from Touhou 18: Unconnected Marketeers.

Using this library, you can create and modify item, active, equipment, and passive cards that will appear in a callable shop menu. Creating a card is fairly easy, and included in this pack are many pre-made cards and templates for you to look through and familiarize yourself with how this system works. There is also a readme file that explains the process in greater detail.

Included with this script is a very slightly modified version of the Default Rumia player found in all copies of DNH ph3sx. It is only included as an example of how to attach DNHCard to a player script and what is required for them to work (at the moment, the only thing that needs to be added to any given player script aside from the include is a NotifyEvebtAll in EV_GRAZE. Look in either the readme or the comment at the top of Default_Player_Rumia_DNHCard.dnh for specific parameters).

That said, in order for this library to work properly, it must be run from a player script as either an include or using LoadScript/StartScript (he former works more consistently, though). It can be run from any other type of script, but cards that use player functions such as CreatePlayerShotA1 will throw an undefined variable error if they are not run from a player script, among other problems. The readme delves more into this as well.

One final thing to note is that there is currently no built-in price system, so all cards can just be obtained without the requirement of money items. I might implement this in the future by making money an item in an item script, but I'm not too sure on this.

----- INCLUDED CARDS -----

Item Cards:
- Blank Card (Defualt card; automatically disabled for now due to it being broken)
- Life Card (Default card)
- Spell Card (Default card)
- Money Comes and Goes On Its Own (Default card; no currently coded function)
- Ringo-Brand Dango (Default card; no currently coded function)
- Phoenix Tail

Active Cards:
- Esteemed Authority
- Keystone of Endurance
- Moon of Madness
- Screen border

Equipment Cards:
- Ancient Magatama
- Annoying UFO
- Back Door
- Half-Half Ghost
- Shikigami Type: Yakumo (Custom)

Passive Cards:
- Danmaku Ghost
- Princess Kaguya's Secret Stash

There are also 4 template cards inside of the DNHCard/cards/example folder, and because they are in this directory, they will never appear in the card shop menu. They are purely for your own reference when creating custom cards, so use these as a base to make the process a bit easier!

----- USER MODIFICATION & SETTINGS -----

DNHCard has a UserSettings.dnh file that provides the developer with options to change the font, set the parameters of HUD icons, and define what cards can be included. While these exist, I should note that this project was converted into a more variable state for this release, and therefore there might be some things that you would not be able to change without going into the menu code itself. While I don't see any immediate things that would need to be implemented as a setting right now that isn't one already, this could change as I receive feedback and work more on tidying up this project. On that note, if there's a function you want added, let me know via my Discord account shown at the bottom of this description.

----- TO DO -----

- Find a more universal and less hacky way to handle card icons instead of having them be managed by the card scripts themselves
- Fix the Blank Card (if it's possible)
- Clean up some of the menu code and add some more in-code comments
- Add more user settings
---- More card icon options (position, scale, etc.)
---- Explicit card arrangement options
------- Possibly add a way to give the user the ability to explicitly set what cards will appear in the menu per each call?
---- Maybe more if I think of or get suggested anything else
- Add more cards to the base lineup (maybe)

----- DISCLAIMER-----

This pack contains graphics and sounds from Touhou 8 and Touhou 18, and are therefore owned by ZUN and Ki-san. It is recommended that you replace these with resources you either own the rights to or were given explicit permission to use. I've only included them as-is for referential purposes and keeping a degree of stylistic consistency.

----- CONTACT -----

If you have questions, run into some bugs, have some feedback, or need to reach out in any way, I can be reached via my Discord account, Ferase#4246.

I will note that if you'd want to use this in a project, you don't have to ask for permission, though I would be happy if you added this project in the credits of your work or its upload page description.

----- CHANGELOG-----

RELEASE v1.0

HOTFIX 1 v1.0
- Fixed an issue where the Keystone of Endurance didn't contain a certain
variable declaration

UPDATE v1.2 HOTFIX 1 (10/9/21 12:17 PM CST):
- Cards now have a toggleable and configurable scrolling animation within the card shop menu
- Added translation options for the cards on the shop menu within UserSettings.dnh
- Fixed a bug with Active Card indexing that caused the HUD icons to not match which card was selected

HOTFIX 1 v1.2 (10/9/21 3:25 PM CST):
- The card scrolling animation will no longer break if Interpolate_Factor is set below 0.15
- Fixed a few random smoothing issues with the scrolling animation
- Re-declared every setting in UserSettings.dnh to be the proper type of variable (e.g. let defaultCard[] is now string[] = defaultCard[], etc.)

UPDATE v1.3 (10/10/21 1:12 PM CST):
- Moved the DNHCard folder out of the example player's folder
---- This was done to better account for people who want to include DNHCard with more than one player. For more information on what exactly was done and how to include DNHC_Hook.dnh in this way, check the included README.txt. Comments inside of Default_Player_Rumia_DNHCard.dnh have also been updated
- Added new options into UserSettings.dnh
---- Enable/disable random card pulling for the card shop menu
---- Explicitly define cards that will appear before the random cards
------- If random cards are off, only these and the default cards (now renamed to after cards) will be presented
- Sped up the default card scrolling animation a little
- Some miscellaneous optimizations and improvements to the overall code

HOTFIX 1 v1.3 (10/10/21 5:53 PM CST):
- Added the ability to set which keys will control active card usage and cycling. Supports both virtual keys and normal keys
---- VK_USER1 & VK_USER2 are no longer the default, as it was brought to my attention that these keys aren't read properly in most scripts and players. That said, while they can still be set as the use/cycle keys, I do not recommend you do so for the sake of compatibility