Flare Collection - Currencies

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Flare Currencies - A better way to manage currencies, v3.0

Darkness Falls, MIT License, Credit must be given to me.

free for commercial usage 

Download: Get The Script, Make sure to name the script: Flare-Currency.js

Screenshots:







Disclaimer

All code is written in ES6 and compiled to ES5, do not edit the distributed script file. Please see the source for making modifications and please read this section on building scripts.

This script should work with all or any other scripts that modify the shop in any way.

Flare Currency allows you to add up to 5 currencies to your game via the options menu when setting up a script.

When a currency is added you can add the following tags in enemy note tags, not troops.

<currencyToGain name: "Some Name" amount: x chance: 89>

  • name: The name of the currency, must match that of the currency you set up in the script options.
  • amount: The amount of the currency to reward.
  • chance: Optional. The percentage of which the enemy will drop the currency and its amount.
Currencies with out a percentage default to 100%. When you set the percentage you have to set 0-100 as an integer.

Currencies can have a variable amount, for example:

<currencyToGain name: "Some Name" amount: "1 ~ 34" chance: 89>This means that "Some Name" has a 89% chance to drop between 1 and 34 "coins"

Shops

Shops are easy to build in Flare Currencies.

It's quite amazing too.

So how do we make a shop? The first thing to do is to set up some items with the following tag:

<currencyShop belongsTo: "Sample Name" andCosts: 76>

 

That should real like english. We are saying this item belongs to a currency shop and a currency of: "Sample Name."

We also state that the it costs x of that currency.

So lets read it togetherFor the currency shop this item belongs to sample name and costs 76 of sample name.

The next things, for the currency information section is to then do:

<currencyShopEvent belongsTo: "currency Name">

In a comment for that event. What this does is:



As you can see we have an extra line: "There is a currency shop selling this item."

This tells the player that hey, there is a currency shop on this map.

So now that you went through your weapons, armors and items and added tags to stipulate which items belong to what currencies and how much they cost, how do you open said shop?

You create an event

FlareCurrencies.openShop("Sample Name", boolean)You have essentially opened a shop that is either purchase only (the boolean) or allows the user to sell items.

Selling items only works for items that belong to that currency shop. Items may have multiple different Currencies but currency shops only take items that belong to the specific currency you specified.

You cannot have multi currency based shops.

ATTN Developers

This shop is designed to be completely backwards compatible with your shop scripts. How ever if there is an issue Please file a bug report.

ATTN Users

This shop will be blank if the currency doesn't exist or no items have that currency.

Additional Information

You must keep the name and the description short. If you make them too long then they will go off the window and it will look broken.

Amount is not capped, you can have over 9,999 of any currency, but you cannot have any thing less then 0. any negative value that that takes the currency amount below 0 will cause your currency to default to 0.

Public API

  • FlareCurrencies.addAmount(currencyName, currencyAmount): Lets you add a specific amount to a currency, either negative or positive.
Example:FlareCurrencies.addAmount('Demon Teeth', 56);// Or:FlareCurrencies.addAmount('Demon Teeth', -56);
  • FlareCurrenies.openShop(currencyName, boolean): Lets you open a shop specific to that currency.
Example:

FlareCurrencies.openShop('Demon Teeth');// Or:FlareCurrencies.openShop('Demon Teeth', true); // Purchase only

  • FlareCurrencies.setAmountBasedOnVariableId(currencyName, variableId): Lets you set an amount positive or negative based on the currency name and the variables value.
Example:

// variable id 5 has an amount of 650FlareCurrencies.setAmountBasedOnVariableId('Demon Teeth', 5);// Demon Teeth currency now has a value of 650Yanfly Victory Aftermath Script

To see currencies spit out as "battle spoils" add the following to the option, "victory order": currency.

It can come in what ever order you want, how ever it must be present. For example:

exp custom drops currency

Once added, battles will have an additional battle spoils window showing the currencies you gained.

Yanfly Menu Manager Script

You don't have to do anything. It just works.

For Developers

I have a special treat for you.

You can mess around with currencies in your own scripts via: flareCurrency which is a global object. You can do the following with it:

  • flareCurrency.store(currencies) - This takes an array of objects, an example from the script:
[    {        name: currency["Currency One Name"],        description: currency["Currency One Description"],        icon: currency["Currency One Icon Index"],        amount: 0    },    {        name: currency["Currency Two Name"],         description: currency["Currency Two Description"],        icon: currency["Currency Two Icon Index"],        amount: 0    },    {        name: currency["Currency Three Name"],        description: currency["Currency Three Description"],        icon: currency["Currency Three Icon Index"],        amount: 0    },    {        name: currency["Currency Four Name"],        description: currency["Currency Four Description"],        icon: currency["Currency Four Icon Index"],        amount: 0    },    {        name: currency["Currency Five Name"],        description: currency["Currency Five Description"],        icon: currency["Currency Five Icon Index"],        amount: 0    },];

  • flareCurrency.setStoreFromLoad(store) - Takes an instance of the above example which is gathered from loading a Saved game.
  • flareCurrency.getCurrencyStore() - Gets the above store at its current state.
Not Public.

This class is not meant to be given to the end user as a public api. It is for developers. End users haveFlareCurrencies as a public class they can access for events.

Regarding Enemies:

Enemies have some extra keys added to them thats been around since 1.0 of the script. Lets look at them now.

- enemyCurrencyRewardData - Contains information about the various currencies this enemy can reward. This is generated on game start.

- gainCurrenciesOnBattleWin  - Contains name of currency and a boolean of true or false.

Both of the above are arrays of objects. 

FAQ:

Somethings broken ...

Please take a screen shot of the error. If the console is open take a screen shot of that too. What were you doing before it crashed. What scripts do you currently have active (and their order)?

Can you add ... ?

Yes I can. Please explain what you want in detail, any additional information such as screen shots, example images and so on.

I have issues with a shop script what do I do?

Regarding shop scripts

A lot of shop scripts change the core functionality of the shop its self. Mine builds on top of the shop, making sure to call the parent shop scene if no currency has been passed in. This can cause issues with other shop scripts that blow away or radically and destructively change how the shop is being created when the user speaks to an event to activate the shop.

If you have shop issues please take a screen shot of the issue and link me to the shop script that is causing issues. Also make sure that you try placing it above or below my script.

Current incompatible scripts:

- Detailed Shop Script
 
Last edited by a moderator:

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
112
First Language
English
Primarily Uses
RMMV
Just a few questions, and if the answer is no, they become suggestions.

Can "amount" for enemy drops be a random integer between X and Y? Or a calc to change that amount based on a variable or luck? This way enemies can drop variant amounts of each currency, and perhaps based on your luck or increase or decrease based other game setting that may change as you play?

Any way to give/take a player currency directly with a script/plugin command, for treasure chests or story events?

And a way to check currency in a conditional branch?
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Just a few questions, and if the answer is no, they become suggestions.

Can "amount" for enemy drops be a random integer between X and Y? Or a calc to change that amount based on a variable or luck? This way enemies can drop variant amounts of each currency, and perhaps based on your luck or increase or decrease based other game setting that may change as you play?

Any way to give/take a player currency directly with a script/plugin command, for treasure chests or story events?

And a way to check currency in a conditional branch?
Suggestions:

- Luck I can implement.

- I can also add a "variable amount" option.

Game Settings: What specific settings are you looking for? aside form those suggested.

And a way to check currency in a conditional branch? Not as of now, I can give you a getAmount(currency name) api to call in conditional branches.

Any way to give/take a player currency directly with a script/plugin command, for treasure chests or story events?
FlareCurrencies.addAmount("currency Name", +/- X) This allows you to add, subtract currencies based on name.

You would do something like: FlareCurrencies.addAmount("Sample Name", 40)  or FlareCurrencies.addAmount("Sample Name", -40)
 

pandore06

Villager
Member
Joined
Nov 10, 2015
Messages
26
Reaction score
0
First Language
French
Want to ask you for one thing how to make it appear in Yanfly main menu manager ?
 

pandore06

Villager
Member
Joined
Nov 10, 2015
Messages
26
Reaction score
0
First Language
French
I have not used her script. I can look into this for the next release.
Thanks you very much this long time i waiting for a plugins like your =) now i will waiting for the new realase
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Version 2.0 has been released. Please read the OP carefully.

Notable changes include:

Breaking - All currency tags for battles have been changed. We now use:

<currencyName name:"Name", amount: 10, chance: 90>It reads the same, with an additional piece of information: amount can be variable, "1 ~ x" means a random number between 1 and x.  per is now chanced to chance. it means the same thing and is optional.

Non breaking - When setting up currencies if you do not have a currency name, we wont draw that info to the list of currencies.

Also, you can now have 1 or x (up to 5) currencies instead of me saying, these other 4 default to sample values.

Updated compatibility with Yanfly menu

You don't have to do anything, Currencies just works in the menu.

Questions, comments, concerns:

Please make sure to read the OP before asking questions that might be answered. Other wise, please submit all requests, questions and concerns and comments below. 
 
Last edited by a moderator:

SpacemanFive

Meteor Mage
Veteran
Joined
Jun 25, 2013
Messages
207
Reaction score
24
First Language
English
Primarily Uses
RMMZ
This plugin looks absolutely invaluable to a project I'm working on, which takes place in a science fantasy world where there are different nations which each use their own currencies. Thank you!

There's something I'm wondering about though, why is the amount of currencies limited to a maximum of five?
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
5 currencies is what fits nicely in the currency window when you open up currencies from the menu.
 

pandore06

Villager
Member
Joined
Nov 10, 2015
Messages
26
Reaction score
0
First Language
French
Thank you for this a big hug for you <3
 

SpacemanFive

Meteor Mage
Veteran
Joined
Jun 25, 2013
Messages
207
Reaction score
24
First Language
English
Primarily Uses
RMMZ
5 currencies is what fits nicely in the currency window when you open up currencies from the menu.
Ah. I can understand that, but not everyone will be using the same resolution, or want to be limited to just five.

For example, the project I'm working on will default to a bit bigger window size, with options for bigger or smaller resolutions. It will also probably have more nations or groups with their own currencies than the limit. What do I do then?

Would it work at all to have the window scroll if you have more than five currencies? I know it's possible, since I've got that set up for the equipment screen in my current project. I just don't know how much work it'd be for you to set it up that way, so I don't know how reasonable a request it is.
 
Last edited by a moderator:

Rainfall

Veteran
Veteran
Joined
Nov 21, 2012
Messages
42
Reaction score
6
First Language
English
Its kind of sad that it is not usable for commercial projects.

But a really good plugin nonetheless!
 

SpacemanFive

Meteor Mage
Veteran
Joined
Jun 25, 2013
Messages
207
Reaction score
24
First Language
English
Primarily Uses
RMMZ
Its kind of sad that it is not usable for commercial projects.

But a really good plugin nonetheless!
Wait, it isn't? I missed that, then.

Dang. I was really looking forward to being able to use this plugin. I don't want to have to request someone else make something similar just so people can use it in commercial games...
 
Last edited by a moderator:

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Hi actualy i got a problems the Currencies didn't appear in my menu : ===>  http://puu.sh/lmZkw/dc05f6ddf5.jpg

there those plugins a i used : ==>  part 1: http://puu.sh/lmZoy/d7e934e74d.png

part 2:   http://puu.sh/lmZoW/eb703b66ed.png

If u  can help me =s
Hmm, Non english should not affect the script. What happens if you disable all scripts and then start turning them on one by one, can you pinpoint exactly where it goes wrong?  If you can narrow down where it goes wrong based on your scripts that would help a lot. :)

Wait, it isn't? I missed that, then.

Dang. I was really looking forward to being able to use this plugin. I don't want to have to request someone else make something similar just so people can use it in commercial games...
I don't mine making it available in commercial games. It is MIT after all.

Ah. I can understand that, but not everyone will be using the same resolution, or want to be limited to just five.

For example, the project I'm working on will default to a bit bigger window size, with options for bigger or smaller resolutions. It will also probably have more nations or groups with their own currencies than the limit. What do I do then?

Would it work at all to have the window scroll if you have more than five currencies? I know it's possible, since I've got that set up for the equipment screen in my current project. I just don't know how much work it'd be for you to set it up that way, so I don't know how reasonable a request it is.
I was thinking about this, I could make the currencies window a "selectable" window allowing scrolling to happen. it would take some work, not a lot.

Terms have been updated to allow for comercial usage
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Commercial Use is allowed. Please credit me, if your game is popular enough and makes a significant amount of money I may reach out for a very tiny percentage.
This is not appropriate (and very devious of you to put it in such small print too).


You are either allowing commercial use for free, allowing commercial use for a set payment (which could be a set % of revenue, and is that before or after expenses are taken out?), or not allowing commercial use at all. Please decide, and update your terms accordingly, as well as terms on any other of your scripts where you've said the same thing.
 
Last edited by a moderator:

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
@Shaz, let me know thats acceptable. I think it follows what you have stated.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Can I just check something, because people use terms in different ways

Strictly speaking, "total revenue" means revenue before the deduction of any costs i.e. gross, not net.

Is that what you intend?
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Yes. Is that going to be an issue? I doubt any ones project will ever get that high in sales for an RPG Maker game, but if it ever does ... Id like a very tiny slice of that. I don't think thats greedy oO
 
Last edited by a moderator:

Esperia

Nasuverse Maniac
Veteran
Joined
Nov 5, 2015
Messages
35
Reaction score
13
First Language
Spanish
Primarily Uses
Can you add a feature in which certain currencies are only usable in certain shops? Like for example that way I could make it

look like each country has it's own currency and doesn't accept foreign currency?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top