localize attachments
commited
commit
3820c834a32b729d61ca5d236c195c83d6d2f09e
... | ... | @@ -41,34 +41,35 @@ Every script block counts as 1 script towards the total limit. It does not matte |
41 | 41 | |
42 | 42 | A wire split counts as 1 script towards the limit. Thus the script in image A adds 4 scripts (3 script blocks + 1 wire split) to the counter. |
43 | 43 | |
44 |  |
|
44 | [[/uploads/Screenshot_20210618-113313_Fancade.png]] |
|
45 | 45 | |
46 | 46 | But wire splits are defined as "n to 1" and "1 to n". This basically means, no matter how large the split is, it will add only 1 script to the counter. The script in image B adds 10 scripts (9 script blocks + 1 wire split) to the counter. |
47 | 47 | |
48 |  |
|
48 | [[/uploads/Screenshot_20210618-113424_Fancade.png]] |
|
49 | 49 | |
50 | 50 | The same applies in case of joining. The script in image C counts as 4 scripts, whereas the script in image D counts as 10 scripts. |
51 | 51 | |
52 |  |
|
53 |  |
|
52 | [[/uploads/Screenshot_20210618-113611_Fancade.png]] |
|
53 | [[/uploads/Screenshot_20210618-113747_Fancade.png]] |
|
54 | 54 | |
55 | 55 | #### Pointer dereferencing |
56 | 56 | |
57 | 57 | This section will be easier to understand if you are somewhat familiar with the concept of pointers. If you are not, you can think of them as an address. Specifically, a memory address, that points to a variable. |
58 | 58 | When a pointer is dereferenced, i.e. converted to value, it counts as 1 script. In image E, the Get Variable block outputs a pointer, which is then dereferenced to a value for the Negate block. Thus the script adds 3 scripts (2 script blocks + 1 pointer dereference) to the counter. |
59 | 59 | |
60 |  |
|
60 | [[/uploads/Screenshot_20210618-113952_Fancade.png]] |
|
61 | 61 | |
62 | 62 | This behaviour, when combined with wire splitting, results in a peculiar quirk where adding another script block can actually consume less script limit than without that block. In the following picture, case 1 adds 8 scripts (4 script blocks + 1 wire split + 3 pointer dereferences) to the counter. Almost half of them are just from dereferencing. To avoid that, in case 2 another script block is added to dereference the pointer before the split. Thus case 2 only adds 7 scripts (5 script blocks + 1 wire split + 1 pointer dereference) to the counter. |
63 |  |
|
63 | ||
64 | [[/uploads/Screenshot_20210618-130458_Fancade.png]] |
|
64 | 65 | |
65 | 66 | Known script blocks that output a pointer are all the Get Variable and List Element blocks. |
66 | 67 | |
67 |  |
|
68 | [[/uploads/Screenshot_20210618-192013_Fancade.png]] |
|
68 | 69 | |
69 | 70 | Known script blocks that accept a pointer as input are the Variable inputs of the List Element blocks, the Variable input of the Menu Item block and, increment and decrement block. |
70 | 71 | |
71 |  |
|
72 | [[/uploads/Screenshot_20210619-091908_Fancade.png]] |
|
72 | 73 | |
73 | 74 | #### Inside custom scripts |
74 | 75 |