Inspect: Difference between revisions
→Advanced mode: Fix links to limits page
Nikitaivanov (talk | contribs) (Created page with "Displays the value given to the input, allowing you to see the value in a variable. [[File:]] == Importance == This block is essential for debugging your games, as it allows you to know what value your variables have at all times. So you can see if a position is correct, or if a loop it's reaching the desired number. If you connect its only input to a variable or value block, the data will be printed on its top. [[File:]] == Types of inspect == There are 5 differen...") |
(→Advanced mode: Fix links to limits page) Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Block | |||
|image=Inspect Number.png | |||
|type=s | |||
|folder=values | |||
|input1={{Port|e|Before}} | |||
|input2={{Port|?|Value}} | |||
|output1={{Port|e|After}} | |||
}} | |||
[[ | Displays the value given to the input, allowing you to see values of [[variables]] or results of scripts. | ||
This block is essential for debugging your games, as it allows you to know what value your variables have at all times. | |||
This block is essential for debugging your games, as it allows you to know what value your variables have at all times. So you can see if a position is correct, or if a loop it's reaching the desired number. | So you can see if a position is correct, or if a loop it's reaching the desired number. | ||
If you connect its only input to a variable or value block, the data will be printed on its top. | If you connect its only input to a variable or value block, the data will be printed on its top. | ||
{{Image|Inspect debug.jpeg}} | |||
== Types of inspect == | == Types of inspect == | ||
Line 14: | Line 21: | ||
There are 5 different inspect blocks, each one for a different type of value. | There are 5 different inspect blocks, each one for a different type of value. | ||
{{Image|Inspect types.png}} | |||
From left to right and top to bottom, we have: | From left to right and top to bottom, we have: | ||
* Number | * '''[[Number]]''': either a floating-point value, truncating the decimal when necessary, or '''nan''' or '''inf''' | ||
* Object | * '''[[Object]]''': either '''None''', or the ID of the object | ||
* Vector | * '''[[Vector]]''': each component of the vector | ||
* Truth | * '''[[Truth]]''': either '''True''' or '''False''' | ||
* Rotation | * '''[[Rotation]]''': a quaternion represented by 3 angles | ||
The number displayed on the object inspect is usually not useful, but there is a use for the object inspect, which we will talk about bellow in the next section. | |||
And you might also notice that the rotation inspect shows a completely different value from what it's being given to it, this is because the same rotation can be expressed with different angles, so don't worry too much about this one. | |||
Note that the display on this block is only visible when the block is on the ground, so it's impossible to see the value when using it inside a script block. | |||
And that's when: | And that's when: '''Advanced mode''', comes in. | ||
== Advanced mode == | == Advanced mode == | ||
{{Image|Inspect advanced mode.png}} | |||
In the image above you can see a small blue square at the bottom right, this is what advanced mode does. With this you can still see the value of your variables | In the image above you can see a small blue square at the bottom right, this is what advanced mode does. | ||
With this you can still see the value of your variables regardless of where the inspect block is or where your [[Set Camera|camera]] is pointing. | |||
To | To enable it, all you need to do is select any inspect block in the game, once selected you will see a new button appear on the bottom right of the hotbar which says "<u>Advanced</u>". Clickng this button will toggle advanced mode, indicated by a checkmark. The toggle is global and will enable/disable advanced mode on all inspect blocks at once. | ||
{{Image|Inspect advanced mode option.png}} | |||
With it enabled, all object inspects will show a pink line going from the inspect button to the object being inspected, instead of only displaying an ID. | |||
{{Image|Inspect advanced mode object.png}} | |||
While playing, if | While playing in [[Editor|edit mode]], if advanced mode is activated, all inspected values will be displayed on the right side of your screen, arranged vertically. If you tap on one of them, each time it is [[Execution order|executed]], it's value will be printed to a "console log" on the left side. This is helpful if you want to keep track of how values change over time. | ||
To stop printing the values simply tap that same button again. | To stop printing the values simply tap that same button again. | ||
{{Image|Inspect advanced mode log.png}} | |||
The first three lines of the log will always be occupied by percentages of object, script, and block limits consumed | The first three lines of the log will always be occupied by percentages of [[Limitations in Fancade scripting#Number of created objects|object]], [[Script limit|script]], and [[Limitations in Fancade scripting#Maximum custom blocks|block]] limits consumed. | ||
[[Category:Blocks]] | [[Category:Blocks]] |