Vizzy Blocks Reference

This note is a practical reference for the Vizzy block families supported by VizzyCode. It focuses on how blocks appear in .vizzy.cs, how they map to XML, and where Juno compatibility is sensitive. blocks reference

Scope

This is a project support reference, not a claim that every possible Juno block is documented. Use the repository docs and examples when a block shape is unclear.

Block Categories

CategoryPurposeCommon code shape
EventsTop-level entry points.using (new OnStart()) { }
InstructionsActions such as display, wait, input, logs, staging.Vz.Display(...)
Control flowIf, else-if, else, loops, wait blocks.if (...) { }, while (...) { }
ExpressionsValues, math, comparisons, booleans.altitude > 1000
VariablesGlobal, local, list, parameter references.// var name = 0;
Craft propertiesAltitude, velocity, orbit, fuel, performance.Vz.Craft.Orbit.Apoapsis()
Planet operationsPlanet properties and coordinate transforms.Vz.Planet("Droo").Radius()
StringsFormatting, friendly values, text operations.Vz.StringOp(...)
ListsList create, access, mutation, length.List-related Vz calls
Custom instructionsUser-defined command blocks.Vz.DeclareCustomInstruction(...)
Custom expressionsUser-defined value blocks.Vz.DeclareCustomExpression(...)
MFD widgetsDisplay widgets and widget events.Vz.CreateWidget(...)
Raw preservationExact XML fragments.Vz.RawXmlEval(...)

Program Structure

<Program name="Mission">
  <Variables />
  <Instructions />
  <Expressions />
</Program>

Required structure

Exported XML must satisfy Validation Rules, including root, instructions, expression style, top-level position, and metadata requirements.

Events

EventCode formNotes
Flight startusing (new OnStart())Most common entry point.
Flight endusing (new OnEnd())Cleanup or logging.
Receive messageusing (new OnReceiveMessage("name"))Message-driven logic.
Dockedusing (new OnDocked())Docking behavior.
Change SOIusing (new OnChangeSoi())Sphere-of-influence changes.
Part collisionusing (new OnPartCollision("part"))Part-specific event.
Part explodeusing (new OnPartExplode("part"))Part failure event.

Position events

Add // VZPOS x=N y=N before newly authored top-level events.

Control Flow

BlockAuthoring shapeXML concern
Ifif (condition) { }Condition must export as valid expression.
Else-ifelse if (condition) { }Preserves branch order.
Elseelse { }Must export as ElseIf style="else" with true constant.
Whilewhile (condition) { }Validate expression style.
Wait untilusing (new WaitUntil(condition)) { }Common flight sequencing primitive.

Else shape

Raw <Else> nodes are blocked. Use the converter’s supported else syntax and validate output.

Craft Properties

FamilyExamples
AltitudeVz.Craft.AltitudeAGL(), Vz.Craft.AltitudeASL()
OrbitVz.Craft.Orbit.Apoapsis(), Periapsis(), Inclination(), Period()
AtmosphereVz.Craft.Atmosphere.AirDensity(), AirPressure(), Temperature()
PerformanceVz.Craft.Performance.Mass(), TWR(), StageDeltaV()
FuelVz.Craft.Fuel.Battery(), FuelInStage(), Mono()
NavigationVz.Craft.Nav.Pitch(), Heading(), BankAngle()
VelocitySurface(), Orbital(), VerticalSurface(), MachNumber()
TargetVz.Craft.Target.Position(), Name(), Planet()

Custom Blocks

Header sensitivity

Custom instructions and expressions require callFormat, format, name, and top-level pos. Copy working shapes when authoring new custom blocks.

Custom blockXML placementNotes
Custom instructionTop-level <Instructions> with header first.Body instructions follow the header.
Custom expressionUnder <Expressions>.Returns an expression value.

Raw And Special Blocks

FormMeaning
Vz.RawXmlConstant(...)Exact constant XML.
Vz.RawXmlVariable(...)Exact variable XML.
Vz.RawXmlCraftProperty(...)Exact craft property XML.
Vz.RawXmlEval(...)Exact evaluate expression XML.
Vz.ExactEval("text")Clean shorthand for simple exact eval text.

See 05 - Raw Preservation.

Block debugging checklist
  • Identify whether the block is instruction, expression, custom block, or raw XML.
  • Compare against converter-emitted code from a working XML example.
  • Check validation errors before changing block semantics.
  • For custom blocks, inspect header metadata first.
  • For raw blocks, decode or inspect the exact XML.

Related notes: 02 - Conversion Engine (VizzyXmlConverter), 04 - Export Validation, 05 - Raw Preservation, 10 - Vizzy Authoring Guide, 12 - Project Examples, 14 - Troubleshooting.