CSCA Currency System Unofficial Bugfix Edition

This is an UNOFFICIAL bugfix version of Casper667's CSCA Currency System, meant for general compatibility with many scripts it otherwise does not work well with at all.


It's unofficial because I have tried to get in touch with Casper through official channels and I have yet to be able to (his email seems to be dead for starters), and based on a search of Google, he has become a ghost. His scripts have been in dire need of support, and since this is the case, after discussion with site staff, I have been allowed to post this topic.


Do note all the original conditions still apply (insofar as they can be obeyed, as explained above), as found here:


http://www.caspergaming.com/terms_of_use.html


The original script is from here:


http://www.caspergaming.com/ScriptRedirect.php?dir=Scripts/Ace&file=CSCA_CurrencySystem&ext=txt


And, assuming his site's commercial license payment system still works, you MUST use that to use this script in a commercial game, as per his original terms.


This is a modified version of Casper's script meant to work with many Yanfly scripts, as well as Black Morning's Icon Module, but it must be loaded towards the bottom of your script list.


Here are specific instructions for making it work with certain scripts that my modifications alone will not fix:


Blackmorning's Icon module: All lines regarding the display of the gold icon must be commented out or removed (recommend the former). Otherwise, both scripts will work but will have clashing overlapping gold icons.


Yanfly's Victory Aftermath: This script works with my modified version just fine, but has the problem of displaying garbage characters for the gold entry in the victory drops screen, so make sure it's above the currency script and comment out this line in the script:


draw_currency_value(@gold, text, rect.x, rect.y, rect.width)


(this should be line 1100)


If done properly, gold and other currency gained after a battle will be rendered as under the stock engine interface. It will render silently in the background of the victory drops screen immediately afterwards, but will not display due to the commented out line (the first line will be blank in said screen), due to otherwise producing garbage characters if not commented out.


Do note I'm no experienced coder, and my fixes are UGLY, mostly removals and commenting out of lots of code that otherwise will cause many Yanfly scripts especially to horrendously break to the point of game crashes. These fixes otherwise preserve the essentials of the currency script, except gold will no longer tint the numerical value for it yellow (removed for compatibility with scripts that alter the gold value/text) in menus.


Regardless, I have tested this bugfix version under various conditions and unless I missed something, it should be 500% more compatible with other scripts than it was before. And assuming Casper shows back up and fixes things instead, I urge everyone to use his fixes instead of mine.

View attachment CSCA Currency System GethN7 Custom.txt
I know that you tried to ask for permission, and talked with the staff members here, but at the very least, you should mark what you changed and where in the script.


Ideally, you should extract your changes from the original script and make it a patch/addon, instead of posting his modified script fully.


If you are not yet experienced enough to make your changes into a patch/addon, let me know, and I will do it for you. Well, if you mark the places you changed, and what you changed in the script.


I'm just telling this, because people usually don't restrict the making of addons/patches for their code, so that would be fully legal and with zero possibility of getting into any kind of trouble.
I know that you tried to ask for permission, and talked with the staff members here, but at the very least, you should mark what you changed and where in the script.


Ideally, you should extract your changes from the original script and make it a patch/addon, instead of posting his modified script fully.


If you are not yet experienced enough to make your changes into a patch/addon, let me know, and I will do it for you. Well, if you mark the places you changed, and what you changed in the script.


I'm just telling this, because people usually don't restrict the making of addons/patches for their code, so that would be fully legal and with zero possibility of getting into any kind of trouble.



Believe me, I tried, but I do not have the skill to extract changes and make a patch, and if you want to see my changes, check all the commented out sections in what I uploaded.


And I'm well aware patches/addons are fine, but there is no way to do that in this case, since the changes involve cherrypicked removals of certain code from being executed from the original script for compatibility reasons, and the changes are extensive enough a simple patch wouldn't cover it. Worse, I was afraid to outright remove anything specific that might call on another script, as Casper's scripts tend to include hooks to his other scripts for interdependent function, and this script has add-on capability with several of his other scripts.


And if Casper ever wants me to take this down, I will comply immediately, this is merely a stopgap solution to the fact all official avenues of communication have been down with him for months on end, the scripts are incredibly broken as is, and there has been no support whatsoever forthcoming from the source itself.
If what you changed are only those removed lines, they all can be solved with simple overwrites.


The only thing which seems tricky (and really, it only seems tricky, but it's not) is the price method from Window_ShopBuy.


Basically, you removed any modifications from CSCA Currency script from that method, which renders that method actually useless in the script.


I am not sure why exactly you did this, because that method just modifies the price IF the user of the script set a modifier for the current currency. So that part is completely in the hand of the developer, and in my opinion, it should not be removed from the script at all. That part is the foundation of making an in-game economy with currencies which worth less or more based on the settings of the currencies.


But if you really want to remove it from the code, you can overwrite it with the default price method from the engine. This requires that this script and the patch you make be placed as high on the script list as it can, to avoid compatibility issues with other scripts modifying that method.


Basically, if I noticed all the removed lines, this should include all of your changes:

Spoiler
class Window_ShopBuy < Window_Selectable

def price(item)
@price[item] # Calling the original method instead.
end

def csca_currency_affordable?(item)
return true # Always true, so won't affect anything.
end

def draw_price(rect, item, align)
# Removed!
end

end



But again, I would not remove the modifications made by the Currency script in the price method. If the developer don't want any price mods, the modification value can always be set to 1 in the script's settings, and that will render any price changes based on the currency used non-existent in the game.
If what you changed are only those removed lines, they all can be solved with simple overwrites.


The only thing which seems tricky (and really, it only seems tricky, but it's not) is the price method from Window_ShopBuy.


Basically, you removed any modifications from CSCA Currency script from that method, which renders that method actually useless in the script.


I am not sure why exactly you did this, because that method just modifies the price IF the user of the script set a modifier for the current currency. So that part is completely in the hand of the developer, and in my opinion, it should not be removed from the script at all. That part is the foundation of making an in-game economy with currencies which worth less or more based on the settings of the currencies.


But if you really want to remove it from the code, you can overwrite it with the default price method from the engine. This requires that this script and the patch you make be placed as high on the script list as it can, to avoid compatibility issues with other scripts modifying that method.


Basically, if I noticed all the removed lines, this should include all of your changes:

Spoiler
class Window_ShopBuy < Window_Selectable

def price(item)
@price[item] # Calling the original method instead.
end

def csca_currency_affordable?(item)
return true # Always true, so won't affect anything.
end

def draw_price(rect, item, align)
# Removed!
end

end



But again, I would not remove the modifications made by the Currency script in the price method. If the developer don't want any price mods, the modification value can always be set to 1 in the script's settings, and that will render any price changes based on the currency used non-existent in the game.



Okay, that's actually a good idea, but I need to make sure it works well with all the Yanfly scripts that interact with these methods as well (the source of tons of crashes). Also, I noted the same discrepancy you did on the ShopBuy segment, and I discovered the commenting out of that section, harmless though it seems, fixes a lot of hassles with Yanfly's scripts, which also make some profound changes, namely the following Yanfly scripts:


Shop Engine


Battle Engine


Victory Aftermath


If you'd like to use my changes as a base for making a fix that won't be a possible permissions issue, I'd be happy to help.

Original thread: https://forums.rpgmakerweb.com/threads/csca-currency-system-unofficial-bugfix-edition.65286/