Search Results for

    Show / Hide Table of Contents

    Debug a vehicle in the Vehicle Playground

    中文 | English

    Run this command at the repository root to replay the examples through the local Unity MCP.

    python Docs/Manual/manual/tools/tutorials.py run vehicle-playground
    
    Click to expand MCP actionsClick to collapse MCP actions

    Prepare the teaching sample. The recipe provides ${variables}.

    {
      "variables": {
        "debugPrefab": "../../../Panzer-War-Mod-SDK/Packages/Sdk/com.shanghaiwindy.middlelayer/Tools/RuntimeDebugger/Prefab/RuntimeDebugTool.prefab"
      },
      "calls": []
    }
    

    The playground loads mods in the Unity Editor so you can test a vehicle before installing it in the game. The project is for debugging only. Do not repackage it for distribution. Copyright belongs to WINDYVERSE PTE. LTD.

    1. Launch the playground

    1. Set the Steam LuaProject path in the SDK project and save your current scene.
    2. Select the target VehicleData in Project and click Drive near the bottom of its Inspector. After changing the model, HitBox, or key data, choose Drive (Repack) and confirm. Unity builds temporary assets for the vehicle, opens the playground, and enters Play mode.
    3. To open the field directly, use Framework - 框架 → 0. Home Page → Open Test Field. You can also double-click Packages/com.shanghaiwindy.middlelayer/Tools/RuntimeDebugger/VehiclePlayground.unity, check the damage-mode setting below, and enter Play.

    2. Choose module or HP damage

    1. In Edit mode, expand RuntimeDebugTool in Hierarchy and select Scripts.
    2. Find Damage Mode on Editor Mode Startup. Leave it on Module Based to test armor and damaged components. Choose Health Based when a vehicle's internal modules are still incomplete.
    3. Enter Play and choose the vehicle. Check its steering, movement, turret and gun, then check that damage affects the expected part.

    3. Exit and test again

    Return to the Unity toolbar and click the active Play button. The old guide used Alt to release focus from Game view. Save your changes and use Drive (Repack) to test the latest build.

    Click to expand MCP actionsClick to collapse MCP actions
    [
      {
        "tool": "inspect",
        "arguments": {
          "path": "static:ShanghaiWindy.Editor.HomePageWindow/TEST_FIELD_SCENE"
        },
        "expect": {
          "contains": "Packages/com.shanghaiwindy.middlelayer/Tools/RuntimeDebugger/VehiclePlayground.unity"
        }
      },
      {
        "tool": "invoke",
        "expect": {
          "regex": "(?s)m_Name: Scripts.*?DamageMode: 0"
        },
        "arguments": {
          "path": "static:System.IO.File/ReadAllText",
          "args": [
            "${debugPrefab}"
          ]
        }
      }
    ]
    
    In this article
    Back to top Panzer War Document