update_actor
Modify RPG Maker MZ/MV actor properties like stats, traits, and parameters by specifying the actor ID and desired changes.
Instructions
Update an actor's properties
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actorId | Yes | The ID of the actor to update | |
| updates | Yes | Object containing properties to update |
Implementation Reference
- src/tools/actorTools.ts:23-41 (handler)The handler function that performs the actual update of the actor data in the JSON storage.
export async function updateActor( projectPath: string, actorId: number, updates: Partial<Actor> ): Promise<Actor> { const actors = await getActors(projectPath); const actorIndex = actors.findIndex(actor => actor && actor.id === actorId); if (actorIndex === -1) { throw new Error(`Actor with ID ${actorId} not found`); } actors[actorIndex] = { ...actors[actorIndex], ...updates }; const actorsPath = getDataPath(projectPath, 'Actors.json'); await writeJsonFile(actorsPath, actors); return actors[actorIndex]; } - src/index.ts:122-123 (registration)The definition and registration of the update_actor tool in the tool list.
name: 'update_actor', description: 'Update an actor\'s properties', - src/index.ts:124-135 (schema)The input schema definition for the update_actor tool.
inputSchema: { type: 'object', properties: { actorId: { type: 'number', description: 'The ID of the actor to update', }, updates: { type: 'object', description: 'Object containing properties to update', }, },