Wiki editing rules
Please donāt make any of the edits violate the TOS or FAQ, remember, anyone can see who edits a wiki and what part they edit.
Please be responsible!
Everyone, please donāt edit when it is being edited.
Ask before editing and tell me what youāre going to add.
Add yourself to the credits if you edited it and added something.
Donāt make credits using @ since you can only do that 10 times in a post.
Welcome to another guide! Today weāll make a credit card system!
This system still has some bugs in it, but I think it deserves to be published just because of how Awesome it is!
Block intensive in some parts
Why I made this
Now, for centuries (however long discovery and the forums lasted), they involved simple ways of earning money, finishing quests, destroying enemies, and discovering secret lands. And you used the money to buy items.
Now, I was looking at this stuff, and thought, Hey! Wouldnāt it be fun if I made the money system a little more realistic? , and so my quest to make a credit system began. I also thought it would be more fun, since alot of guides about games were like:
Donāt make it simple! Make it intensive and exciting to make sure your players have fun and not bored out!
Obviously, the money system has remained virtually the same, and I thought it was about time to, if not bring about a change, then offer another system for use.
Dictionairy
QC: Quick Check, Iāll use this to explain a real life situation to compare it with the items in Gimkit.
Now letās get into it!
Our Goal
I just wanted to state what we want to achieve before we actually start.
- Create an Updated Credit Card:
We want to be able to have the card updated whenever we spend money or when we pay back our owed money. We also want the card money, and a card + interest property. - Interest:
For this, we want a countdown on payments that checks to see if we havenāt paid back our money! There should be various statements that check all the possible scenarios. We want it to calculate the interest and add it to the card money owed. - Information:
Now, this isnāt that important, but if you want warnings, you should take this! Weāll make notifications that let us know when itās time to pay, how much we owe, if we didnāt pay, and the interest owed if we fail to pay.
What you could add
Now, this is a new guide on something that hasnāt been talked a lot about, so I myself went to go on as much as I could see fit possible, but thereās other things you can add too make it more realistic!
- IDās:
Technically, in the real world, every card has a unique ID, that letās the bank know who is paying for something. I would suggest checking out getrithekdās guide on IDās to get a basic understanding on how it might work. - Point System:
You technically get ācard pointsā whenever you do what you are supposed to do, like paying on time and stuff like that. The points can then be redeemed for free money! You could create a system for how many points is equal to how much redeemed money! - Beginning Card Money:
Usually, when you first ask for a credit card, the bank usually checks out your previous payments, like if you paid loans back on time or something. It would take a lot of work though to create all these other systems, so I would suggest just randomize a number between whatever numbers you choose, and use those numbers for the bank to figure out how much to give you. (ex: 150-275 points = 200$). You can even set a minimum point requirement, and if you donāt have it, the bank can reject it!
This will probably be a wiki because of 2 reasons.
- 1: I really want to make an actual TUG, since those are usually a wiki.
- 2: I also wanted all this stuff to pool together, so new users exploring this can have everything they need in one topic, instead of exploring other topics to fit their needs
Anyways, letās get started!
Money
Making the Card
Now, the first part is to give our credit card a limit. I chose 500, but you can pick a different number. For this, name your property moneyInCards and make it a number type.
Buying
This is pretty simple, now, in each part I will give a short explanation on what weāll try to accomplish.
- First, the most obvious, weāll want to subtract the money from our card.
- We also want to make sure that we donāt keep buying even when we reach out limit.
The block code is pretty simple so I shouldnāt have to explain anything.
The broadcast just opens a pop-up or notification saying that youāve reached your limit.
Earning Money
Technically, you pay back using your money, so, weāll recreate it.
- Since we would have to design jobs (and itās not the purpose of the guide), weāll give our lovely gim here a steady income.
- The money has to be updated whenever you pay back your owed money.
So, simple thing, make a property called yourMoney. Make it a number and set it to 0, or a beginning amount you want. Then, make a trigger that updates the property by a certain amount.
set property: yourMoney;
set value: yourMoney + 10;
Then you can just broadcast something that states your current amount, just so you can stay informed.
Interest
This is the biggest section of the guide, since the rest of the system involves interest. First, make a property called interestMinimumOwed. Make it a number property and set it to 0.
Timer
- Have one section of the timer be for buying, paying, and whatever else. Have the other section be a warning to pay back owed money.
- Identify if money is owed after timer is over and calculate interest and add it to owed money in total.
First, to make our timer, weāll use a counter and trigger! (Embarrassing: For 4 days I couldnāt figure out how to use the trigger so I had to useā¦ spasm shudder a repeater! )
Step 1: Base of Timer
Now, QC, usually, you have a repeating cycle of 45 or so days. That is when you can do whatever you want with your card, buy, repay, like whatever. Then, another part is when you have to pay back any already owed back money. So the counter and trigger will represent this.
Make the starting of the counter, 25 or whatever number you want it to be. Have it decrement on timeUntilRepayment, before you ask, you can make a button, trigger or even use a life-cycle that transmits on it to start decrementing. Now, also make a trigger that triggers on the channel, and also broadcast on timeUntilRepayment. Set a delay of 1. Now, you have a counter that goes down to 0!
Now, the thing is, this counter does swell keeping track of how much time is left, but, if this was involved into a bigger map where you ran around and stuff, you would not be able to see how much time is left! Yet alone, if you wanted to broadcast on certain markers, you would also need a property to be updated!
Step 2: Make it seen everywhere
For this, the best option is to use an overlay! Make it a text type, visible on game start, and you can set it to whatever position you want!
Then, make a property called timeUntilInterest+Repayment, now, sorry if you were confused, but the + isnāt adding time, but itās a combination of the time of whatever you want to do, and the time when you have to pay back. Anyways, make it a number property and set it to the value of your counter.
Remember our counter? Well, in the update property section, use that property to be updated.
Now make a block code section and put this in it.
Oh my! Look at all this block code! What does it all mean! Well, lucky for you, I can explain it, wonder how.
Well, Iāll break this down:
- First, weāll make a variable called interest+repayment that is the value of the property we just made earlier.
- Now, our if/else if/else statement just examines the time and makes the text to it.:
If:
This if checks to see if the timer is above 10 sec, in that case, the text says that the time until repayment is the value of the property timeUntilInterest+Repayment.
First Else/if:
This else if checks if the property is equal to 10, then broadcast on a channel. What that channel does is that it sends a notification warning you on how much money you owe. Hereās the calculation done.
Now, there are 2 calculations to be made.
- First, we subtract the interest from the money in cards
- Then we use that calculation to find the total owed money.
For the first one,
set property: moneyInCards;
set value: moneyInCards - interestMinimumOwed
Then, for saying how much much money you owe.
500 - moneyInCards
Second Else/if:
Now, this just checks if the counter reached negative 1, then it broadcasts on timeUntilRepayment, where it restarts our counter.
Else:
This just checks if the property is below 10, where it then says Time Until Interest instead, counting the time left.
Step 3: Calculating Interest
Now for the second part of code in the overlay! This ones a doozy so hold on tight!
Okay, so in the if statement, itās checking if the timer reaches 0 And the moneyInCards is Not equal to 500. So, this means itās checking if the timer is over and if you havenāt paid back everything.
The variable interestMinimum is the value of interestMinimumOwed
Now, for the calculation part, for solving it, we need a percentage, right? In this case, I choose 2, so 2/100 = .02, which is the same as 2%. Then, we want to multiple this by 500 - moneyInCards - interestMinimumOwed. So basically, letās say that you used 200 dollars, and you forgot to pay back, so following normal calculations, you would get 4 dollars. Now, you owe 204 dollars, which would technically mean you have 294 dollars, instead of 300, see? Now, when you start paying back, thatās 4 dollars extra! Hope that makes sense.
Now, we have to round, because not every number will be a whole number, we could come thing like 3.348888000003. So, we need to make a calculation to round it, so we make a variable called roundedCalculatedInterest, so, letās take the number I just used, 3.348888000003. Now, we multiply it by 100, 334.8888000003, then we round it, 335, then divide it by 100, 3.35. See? The final thing to do is to see the interestMinimumOwed property to the rounded value of the variable.
Then we broadcast on failedToPay.
Then, for the notification or pop-up, just say something like,
set text:
item 1: "You faiIed to pay! Now you have to pay $ "
item 2: get property interestMinimumOwed
item 3: " total!"
Paying Back Money
Now, the reason this isnāt going into money or interest is because itās a combination of both, at least as far as I believe, and so itās going to get its own section.
- Pay back money in increments
- Run statement to make sure we donāt over pay or under-pay
- Make sure we also pay back owed money
Step 1: Paying back
Okay, this part is pretty simple, grab a button, have it say something like āPay back $10ā, and then wire it to a trigger, make a block code in the trigger.
Step 2: Possible Outcomes
Now, there are a lot of different outcomes that we need to be watch out for.
- Empty Pockets!:
This one is the most simple, just check if your money - 10 < 0, then say, faiIed to pay.
QC, you canāt pay back your owed money! So you would technically try waiting until you gained more money to pay back. - Normal Payment:
Just check and see if when you pay back like 10 dollars, if itās lower than 500 + interest, then add 10 to your card, and -10 to your money. - Over-Payer:
If youāve reached out limit but keep trying to pay back more, keep a lock on the cards, set the moneyInCards to 500, we donāt want our users to be sneaky! - Almost there!:
Letās say you only have to pay 4! But you can only pay in 10, increments! So, a simple fix for this is to add 500 - moneyInCards to moneyInCards, confused? Lemme explain, you owe only 4 dollars, meaning you paid 496, so it sets the value of the property like this, 496 + (500-496) = 496 + 4 = 500.
And your done! I really hope you enjoyed this guide, and like I said, Iāll probably make this a wiki so that you guys can add more! Friends of Berk!
- camelCase
- underscors
- hyphens
- other:______ Put it in the poll!