Login

Fancade Wiki

make article more consistent

... ...
@@ -1,8 +1,9 @@
1
Fancade 1.6 adds a new script block called [[Menu Item]] and a currency named [[Coins]]. This page is a guide on how to use them.
1
Update [1.6.6](https://www.fancade.com/wiki/version-history#fancade-1-6-6) added a script block called [[Menu Item]] and a currency named [[Coins]]. This page is a guide on how to use them.
2 2
3 3
Currently the only way to access the shop is by winning or losing.
4 4
5 5
## Coins
6
6 7
To use the coins, just take a number variable and connect it to the `Coins` input in the score block.
7 8
8 9
[[/uploads/Captura_de_pantalla_2021-06-02_143144.png]]
... ...
@@ -11,17 +12,18 @@ When you play-test the game you should see the coin counter at the corner of the
11 12
12 13
[[/uploads/Captura_1.png]]
13 14
14
*Note: When making a game, you can give yourself free coins to test your upgrade shop. They won't count as coins in the actual game though.*
15
*Note: When making a game, you can give yourself free coins to test your upgrade shop. They won't count in the published game though.*
15 16
16 17
## Menu items
17
To use the menu items, first take a block out of the inventory, and after placing it in the floor you will see two kinds of inputs: a Picture input and a Variable input.
18
19
To add items to the shop, take as many Menu Item blocks as you need, and after placing them in the floor you will see two inputs: a Picture input and a Variable input.
18 20
19 21
[[/uploads/Captura_de_pantalla_2021-06-02_142338.png]]
20 22
21 23
The Picture input is the object that will be displayed for the corresponding item in the Shop.
22 24
23 25
The Variable input uses a variable to save the current state of the upgrade.
24
You will need to use a saved variable (!Var) for this or it'll be completely useless.
26
You have to use a saved variable (!Var) for this or it'll be completely useless.
25 27
26 28
There's also other options when you select the block:
27 29
... ...
@@ -35,31 +37,27 @@ If there's no Variable connected to the Variable input then it'll show as a titl
35 37
36 38
[[/uploads/Captura_4.png]]
37 39
38
Buy Limit: this sets the amount of times that object can be upgraded. For example: let's say you set it on Max 2.
39
40
[[/uploads/Captura_5.png]]
41
42
The corresponding object in the shop system will have to be upgraded 2 times to be maxed out.
40
Buy Limit: this sets the amount of times that object can be upgraded. e.g. say you set it on Max 2; the corresponding object in the shop will max out after two upgrades.
43 41
44 42
[[/uploads/Captura_6.png]]
45 43
46
If you leave it as On/Off, you'll be able to upgrade it once, and toggle it on and off, like an extra mode or a cheat code.
47
If the connected Variable is \-1, that means OFF. You can set it to \-1 or 1 to avoid the purchase.
44
If you leave it in ON/OFF, you'll be able to buy it once, and toggle it on and off.
45
This can be used to activate an extra mode or a cheat code.
46
If the connected Variable is anything but 0, the item is set as bought, skipping the purchase entirely. Setting it to \-1 will set it to OFF.
48 47
49 48
[[/uploads/Captura_7.png]]
50 49
51
But if you set it to No Limit ( which is behind 100) then the upgrade will have no limit and you will be able to buy it how many times you want.
50
But if you set it to No Limit, the upgrade will have no limit of purchases and you will be able to buy it however many times you want.
51
52 52
*Note: "No Limit" comes after Max 100 in that menu.*
53 53
54 54
[[/uploads/Screenshot_20210609-192759.png]]
55 55
56 56
Price Type: This changes the price of the upgrade after you've bought it.
57 57
58
- **Fixed**: the price will stay on the same amount of coins every time you buy the upgrade.
59
60
- **Linear**: If it is on 10 Linear, then the price will increase by 10 coins each time you buy the upgrade.
61
62
- **Double**: the price doubles each time you buy the upgrade.
58
- **Fixed**: the price will stay the same, no matter how much you buy it.
59
- **Linear**: the price starts at the set amount, and increases by that amount for each purchase.
60
- **Double**: the price starts at the set amount, and doubles each time you buy the upgrade.
63 61
64 62
And you even get a bigger price if you keep clicking after 10 Double! The existing prices are 100, 1k (1,000) and 10k (10,000) and all of them have the same options except for 10k, which only has the fixed option.
65 63
... ...
@@ -67,27 +65,26 @@ And you even get a bigger price if you keep clicking after 10 Double! The existi
67 65
68 66
## Variables
69 67
70
The [[menu item]] has the input called variable, this input can only accept number variable type inputs and not number value type inputs. Though this maybe the case you can somehow do sorcery with it by using the same variable before the menu item and giving that variable a value.
71
72
- For example you use the variable `!var` and given it a value of 2 before feeding it to a menu item (with a setting of `max 5` /`price 100`/ `price double`) the upgrade will be then immediately upgraded to level 2 with a price of 400 for the next upgrade.
68
The Variable input in the Menu Item block can only accept number variables, but you can initialize said variable beforehand so that the upgrade starts in a certain level.
73 69
74
- Playing with it's variable is not as simple as it is though. setting the value of the variable before the menu item means overwriting the existing value of the variable, one work around to it is by using [[max]] math block which outputs the higher number, that means on start being the variable having value of 0 feeding it to max with the other input of it having value of 2 the max will output the 2 and will feed it back to variable, then if the variable has a value of 3 now with the same case with max the max will output 3 as it is higher than 2 and will feed 3 back to itelf preventing value overwrite. This method though is not absolute as it doesn't work with on/off type items, in this case if blocks and truth values will be the one to help.
70
If for example you set a variable to 2 before feeding it to a menu item with settings Max 5 and Double 100, the upgrade will then be pre-set to level 2 with a price of 400 coins for the next upgrade.
75 71
76
With this in mind you can try to get more complex and have your shop with items that can be bought/upgraded interestingly.
72
Playing with the variable isn't as simple as that though. Setting the value of the variable means overwriting it's existing value. One possible workaround is by using the [[Min]] and [[Max]] blocks. With this in mind you can make your shops more complex and varied; it allows you to have items already set or preupgraded, and can ease testing/debugging.
77 73
78 74
## How to use the bought upgrades
79 75
80
To use these, take the saved variable (!Var) you sticked into the Variable input and use it in whatever you want. Normally the variables are equal to the upgrade level of the certain upgrade. For example, if used a Max 5 upgrade then the variable can be equal to the values of 0 through 5. If used a On/Off upgrade, the variable can only equal \-1, 0 or 1. If used a No Limit upgrade, the variable can equal 0 through 16777216 because float rounding
81
rounds down the next number. (pedanticism)
76
To use the upgrades, just take the value of the variable you used for the item and use it in whatever you need. The variables' values depend on the current upgrade type and it's value.
77
For example:
78
- If set to "Max **n**", the variable can be between 0 and **n**, inclusive.
79
- If set to "ON/OFF", the variable can only equal \-1, 0 or 1.
80
- If set to "No Limit", the maximum value of the variable depends on your system's maximum exactly-represented integer for floating point numbers. You will never need to worry about this last one, as that number is *really big* (the maximum unsigned 32-bit number is [4,294,967,295](https://en.wikipedia.org/wiki/4,294,967,295)).
82 81
83 82
## Limits
84 83
85
- 6 Pages
86
- 100 Items (including Titles)
84
6 pages and 100 items (including titles).
87 85
88 86
## Buggy effects of negative numbers
89 87
90
Negative values do work with other settings besides on/off, but they change the button to look like OFF. It still works, and the calculation that generates the price just uses the negative number.
88
Negative values do work with other settings besides on/off, but they change the button to look like OFF. They still work, and the algorithm that calculates the price runs like usual.
91 89
For example, 10 \* 2^\-2 for 10 Double and other fractions are rounded down, here to 2.
92
Linear Prices will actually give you coins on level \-2 and less
93
because of this.
... ...
\ No newline at end of file
0
Linear Prices will actually give you coins on level \-2 and less because of this.
... ...
\ No newline at end of file
Fancade Wiki