Skip to content

Pack Making JSON Variable Modifiers

DrprofLuigi edited this page Jun 7, 2023 · 8 revisions

The variableModifiers section appears in any JSON that uses animation variables. VMs are used to modify variables (these variables are noted with an * by their name), and follow a similar structure to Light Objects. Each VM entry has the following parameters:

  • variable - The variable to be modified. Motorized Variables and Part Variables marked with an astrisk can be modified with VMs, along with most Animation Variables similar to Collision Boxes with Variable Names.
  • addValue - The value to add to the specified variable.
  • setValue - The value to set the specified variable to. Overrides the current variable value and the addValue portion. Does NOT override supplemental translation animations that may apply on top of this value.
  • minValue - The min value the variable will be assigned, after all operations are complete.
  • maxValue - Like minValue, but max.
  • animations - A listing of animations for determining the value of the variable to be modified.
    • Valid animationTypes are rotation, translation, visibility, inhibitor, and activator.
    • translation animations with the x-axis will multiply the variable value by the current modified variable value.
    • translation animations with the y-axis will add the variable value to the modified variable.
    • translation animations with the z-axis will set the modified variable to that value, overriding any prior transform operations.
    • translation animations with the x-axis AND y-axis will multiply the variable raised to the power of y value by the current modified variable value.
    • translation animations with the y-axis AND z-axis will add the variable value raised to the power of z by the current modified variable value.
    • visibility animations will completely disable the modifier if they are false.
    • inhibitor and activator work the same as in normal animations.
    • rotation animations will multiply the current modified variable value by xsin(V+X) + ycos(V+Y) + ztan(V+Z) where [x, y, z] is the axis, [X, Y, Z] is the centerPoint, and V is the variable value. Adding an "inverted": true will inverse the trig functions.
Clone this wiki locally