Login

Fancade Wiki

Updated Fancade Web.md (markdown)

... ...
@@ -142,8 +142,46 @@ The command line is opened by the TAB key and can be used for quickly adding blo
142 142
| h `Prefab Name` | Adds a block of type `Prefab Name` to the hotbar | |
143 143
| find `Variable Name` OR `Prefab Name` | Find and focus on use of `Prefab Name` or `Variable Name` | Use Enter to keep searching for the next block. |
144 144
| ren `Old Variable Name` , `New Variable Name` | Renames a variable | |
145
| tg `Toggle Name` | Toggles an option (DebugPhysics is the only option available for now which draws colliders in edit-play mode) | Only available in beta version |
146
| cl `Level Number` OR n (next) OR p (previous) | Changes level | Only available in beta version |
145
| tg `Toggle Name` | Toggles an option (DebugPhysics is the only option available for now which draws colliders in edit-play mode) | |
146
| cl `Level Number` OR n (next) OR p (previous) | Changes level | |
147
| EditorScript | Open editor script editor | Only available in beta version |
148
149
### Editor Scripting (Beta only)
150
151
In the beta version, there is an experimental editor scripting editor available that can be used for things like auto-tiling. The editor is opened by the `EditorScript` command in the command line.
152
153
Editor scripts are written in Javascript (ECMAScript E5/E5.1), and here are some code examples:
154
155
```
156
// Find prefab by name
157
// var prefabIndex = findPrefab('MyPrefab'); // Returns 0 if not found
158
159
// Set block at position (x, y, z) in level or open block
160
// setBlock(x, y, z, prefabIndex); // prefabIndex == 0 means empty
161
162
// Get block at position (x, y, z) in level or open block
163
// var prefabIndex = getBlock(x, y, z);
164
165
// Update changes after using setBlock()
166
// updateChanges(); // Time-consuming, don't do this after each call to setBlock()
167
168
// Log printout (only for strings and numbers for now)
169
// log("Found a prefab " + prefabIndex);
170
171
// Get size of level or open block
172
// var size = getSize(); // Returns an array [x, y, z]
173
174
// Get number of levels
175
// var count = getLevelCount();
176
177
// Get current level index
178
// var levelIndex = getLevel();
179
180
// Change level
181
// setLevel((levelIndex + 1) % count);
182
183
```
184
147 185
148 186
### Misc
149 187
Fancade Wiki