This instructional manual outlines the process of utilizing Vizzy in a non-standard manner to generate dynamic variables and simulate “struct” variables within the Vizzy environment.
Please note that this guide leverages an unpublicized functionality of Vizzy, which may potentially become incompatible with upcoming Juno releases without prior notice. It has been confirmed to be effective on version 1.1.109.0, which is the most recent PC version as of September 9, 2023.
序章
Vizzy encompasses three primary data types:
- Floating point numbers
- ベクトル, which consist of three floating point numbers
- Strings
さらに, Vizzy provides support for a list data type, where each entry within the list can belong to any of the aforementioned three types. There’s no requirement for all elements in the list to share the same data type.
While these data types suffice for most purposes, there are scenarios where it becomes advantageous to store a list of values without employing the list data type.
Why the avoidance of the list data type, あなたは不思議に思うかもしれません?
The primary rationale behind this choice is the substantial performance gap. Despite claims of performance enhancements in version 1.1.109, the list data type remains notably slow. My commitment to this alternative implementation was well-established by the time this version was released.
さらに, Vizzy blocks designed for list operations tend to be unwieldy in size. While they may facilitate comprehension, particularly for users lacking a programming background, they pose challenges when crafting intricate Vizzy applications.
Another drawback is that lists cannot be accessed through FUNK expressions. For more intricate mathematical expressions, it’s advantageous to encapsulate the calculations within a FUNK expression rather than constructing them using Vizzy blocks. しかし, if your equation relies on lists, this option loses its appeal.
In the realm of complex applications, explicitly declared variable lists represented by the green blocks can grow unwieldy in size – bordering on the absurd in certain cases. In such contexts, any method capable of reducing the size of this list becomes highly desirable.
ついに, it’s worth noting that this technique allows the creation of complex data structures containing other complex structures – ある “List of Lists,” so to speak. This represents the one unique capability of this approach that conventional lists cannot replicate.
How To
I assume you have a good grasp of the “set variable [] に []” Vizzy block. The concept is straightforward: you establish a variable (を使用して “Create Variable” ボタン), resulting in the creation of a green block. その後, you drag this green block to occupy the first empty slot in the “set variable [] に []” block and specify on the right-hand side the value you intend to assign to the variable.
しかし, let’s consider an alternative scenario:
What if you opted not to define and position a green block in the initial slot? What if you chose to do something different instead:
The outcome is as follows: “The value of ‘1’ is assigned to the variable ‘Active_Craft_ID.” 言い換えると, it accomplishes the very same action as illustrated in the initial example.
今, what if you haven’t defined a variable ‘Active_Craft_ID’ を使用して “Create Variable” ボタン? 良い, the value still receives assignment to a variable bearing the name ‘Active_Craft_ID.’ しかし, it becomes evident that you cannot retrieve this value through a green block. I’ll delve further into this shortly.
しかし, let’s consider another scenario:
This method also operates in the expected manner – by the end, you’ll possess ten variables, 名前付き “Testing1” を通して “Testing10,” all endowed with a value of 1.
今, the subsequent question arises: “How do I access a variable generated through this process?” 当然, the following approach will not yield the desired result:
In the given scenario, the operation assigns the string “Testing1” to the variable “Active_Craft_ID” when the intention was to assign the value of the variable “Testing1” に “Active_Craft_ID.”
しかし, there is a solution using FUNK – デフォルトでは, when you specify a variable name within a FUNK string, it is interpreted as a variable reference. その結果, this approach indeed achieves the desired outcome:
There are two important considerations to keep in mind when using this approach:
- FUNK expressions do not support strings, even when referencing variables. If you specify the name of a variable that contains a string and attempt to access it through a FUNK expression, the result will be 0. したがって, while it is possible to assign strings to dynamic variables as previously described, you won’t be able to access their values unless you create a green block for the variable using the “Create Variable” ボタン.
- FUNK expressions assume that variables are floating-point numbers by default, unless instructed otherwise. If you’ve stored a vector in a dynamic variable, you must prefix the variable name with “v:” to inform FUNK that the variable contains a vector.
Here is the correct method for accessing a vector stored in a dynamic variable:
This code will assign vectors to 10 variables, then output the 10 vectors to the local log:
結論は, I can confirm that dynamic variables are indeed serialized when a craft is saved, as evidenced by inspecting the XML file. While I haven’t conducted verification to ascertain that the values are restored accurately, I hold a high degree of confidence, at approximately 99.9%, that they are indeed restored correctly.
More advanced topics
Creating “helper functions” is immensely valuable for simplifying the process of extracting particular values from a collection of similar values. Here’s an example of how this can be accomplished:
These functions all operate with a single parameter, which should be a string representing a set of interrelated variables, and they return a specific variable from that group.
When it comes to performing mathematical operations with dynamic variables, my recommendation is to utilize FUNK expressions whenever possible, as demonstrated here:
You can achieve the same outcome by using the “形式” block instead of the “参加する” ブロック, although it’s worth noting that the “参加する” block is generally considered faster. Here’s an example of using the “形式” block for this purpose:
これが今日私たちがこの目的で共有するすべてです ジュノ: 新しい起源 ガイド. このガイドは元々、次の者によって作成および執筆されました。 mreed2. このガイドを更新できなかった場合, これに従って最新のアップデートを見つけることができます リンク.