Custom Coin Counter
Custom Coin Counter
Here is a look at how you can make your own coin (or "Square") counters.
To do this, I used a hitbox trigger, which displays the number of coins and goes through a loop so that it always updates. You have to be careful with loops though; if they run too quickly (e.g. without a sleep function), the game will lag horrendously. I found this out the hard way.
Here is how the hitbox trigger looks:
Pretty self-explanatory. You can change the Sleep function to update however often you like. Something interesting I found out is that no matter how low you set the Sleep duration, the game won't lag; however, a sleep duration of say 1 or 2 makes Subtitles to read because they appear and disappear too quickly (play around with it yourself to see what I mean). Also, you need that Subtitle Off function otherwise subtitles will keep appearing on top of each other.
A couple other things I'll point out: Super Squares are kind of broken right now. Besides not having a sound effect, they won't automatically update the coin counter. You have to manually use the Add function to add the amount of coins you want. You can also customize the value of regular Squares by doing the exact same thing. (Just subtract 1 from however many coins you want to add, because Squares will add 1 by default.)
Here is a look at how you can make your own coin (or "Square") counters.
- Code: Select all
150x50~.61bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.149bX.130abaa.6aaac.9bX.129abaa2.6ac3.8bX.128abaa3.6ac4.7bX.127abaa4.6ac5.6bX.88aa19.6aa144.6aa144.6aa125~~~~0;128;1496;1;0;0~6:coinTracker;0;2;9999;9999;1;1;subtitle,2,Coins%3A%20%7B%24g_COINS%7D,100:sleep,10:subtitle_off:goto,0|40;208;1464;|40;368;1488;|40;400;1488;|40;400;1456;|40;368;1456;|44;1056;1480;add,g_COINS,g_COINS,5|40;560;1488;|40;592;1456;|40;624;1424;|40;655;1393;|40;688;1392;|40;720;1392;|40;752;1392;|40;784;1424;|40;816;1456;|40;848;1488;|40;1152;1472;add,g_COINS,g_COINS,74|40:coin1;1568;1472;move,coin2,1456,1424,1,0|40:coin2;1413;1658;move,coin3,1539,1424,1,0|40:coin3;1496;1658;move,coin4,1456,1488,1,0|40:coin4;1413;1722;move,coin5,1524,1456,1,0|40:coin5;1461;1690;|2:exit;1913;1701|6;-1;1304;9999;9999;0;1;branch,5,2,g_COINS,100:goto,0:camera,1,0,0,0,exit,0,0,10:move,exit,1904,1504,1,0:sleep,30:cameraoff~Custom%20Coin%20Counter~Bryan%20Pearson~3~4;0;0~0~4;0~0;0;3~1359203977~0.3
To do this, I used a hitbox trigger, which displays the number of coins and goes through a loop so that it always updates. You have to be careful with loops though; if they run too quickly (e.g. without a sleep function), the game will lag horrendously. I found this out the hard way.
Here is how the hitbox trigger looks:
- Subtitle: "Coins: {$g_COINS}"
- Sleep: 10 frames
- Subtitle Off
- Go to Line 1
Pretty self-explanatory. You can change the Sleep function to update however often you like. Something interesting I found out is that no matter how low you set the Sleep duration, the game won't lag; however, a sleep duration of say 1 or 2 makes Subtitles to read because they appear and disappear too quickly (play around with it yourself to see what I mean). Also, you need that Subtitle Off function otherwise subtitles will keep appearing on top of each other.
A couple other things I'll point out: Super Squares are kind of broken right now. Besides not having a sound effect, they won't automatically update the coin counter. You have to manually use the Add function to add the amount of coins you want. You can also customize the value of regular Squares by doing the exact same thing. (Just subtract 1 from however many coins you want to add, because Squares will add 1 by default.)