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
- Vectors, 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, named “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 “format” block instead of the “Join” 차단하다, although it’s worth noting that the “Join” block is generally considered faster. Here’s an example of using the “format” block for this purpose:
이것이 오늘 우리가 공유하는 모든 것입니다. Juno: New Origins 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. mreed2. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.