ue-mcp 1.0.40 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,6 @@
26
26
  "statetree": 35,
27
27
  "plugins": 2
28
28
  },
29
- "generatedAt": "2026-05-25T18:33:21.370Z",
30
- "version": "1.0.40"
29
+ "generatedAt": "2026-05-25T18:39:43.608Z",
30
+ "version": "1.0.41"
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ue-mcp",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Unreal Engine MCP server - 21 tools, 556+ actions for AI-driven editor control",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -146,6 +146,7 @@ namespace UEMCPPIE
146
146
  TrackedValues.Reset();
147
147
  Tracked.Reset();
148
148
  PendingMarkerLabels.Reset();
149
+ PrevPawnLocation = FVector::ZeroVector;
149
150
  // Re-seed TrackedValues from config in case the caller calls AttachToPIE again.
150
151
  for (const FString& P : Config.TrackedValuePaths)
151
152
  {
@@ -218,6 +219,41 @@ namespace UEMCPPIE
218
219
  APawn* Pawn = PC->GetPawn();
219
220
  if (!Pawn) return Row;
220
221
 
222
+ // Rescan for late-bound actions (IMCs added after initial attach).
223
+ if (UEnhancedInputComponent* EIC = Cast<UEnhancedInputComponent>(Pawn->InputComponent))
224
+ {
225
+ TSet<FString> Known;
226
+ for (const FTrackedAction& T : Tracked) Known.Add(T.Path);
227
+
228
+ TSet<FString> Whitelist;
229
+ for (const FString& P : Config.ActionPaths) Whitelist.Add(P);
230
+
231
+ for (const TUniquePtr<FEnhancedInputActionEventBinding>& Bind : EIC->GetActionEventBindings())
232
+ {
233
+ const UInputAction* Action = Bind->GetAction();
234
+ if (!Action) continue;
235
+ const FString Path = Action->GetPathName();
236
+ if (Known.Contains(Path)) continue;
237
+ if (!Whitelist.IsEmpty() && !Whitelist.Contains(Path)) continue;
238
+ Known.Add(Path);
239
+
240
+ FTrackedAction T;
241
+ T.Action = Action;
242
+ T.Name = Action->GetName();
243
+ T.Path = Path;
244
+ T.ValueType = ConvertValueType(Action->ValueType);
245
+ Tracked.Add(T);
246
+
247
+ FActionSpec Spec;
248
+ Spec.Name = T.Name;
249
+ Spec.Path = Path;
250
+ Spec.ValueType = T.ValueType;
251
+ Actions.Add(Spec);
252
+ UE_LOG(LogMCPBridge, Log, TEXT("[PIE-SAMPLER] Late-discovered action: %s (%s)"),
253
+ *T.Name, *Path);
254
+ }
255
+ }
256
+
221
257
  if (Config.bCapturePawnState)
222
258
  {
223
259
  Row.PawnLocation = Pawn->GetActorLocation();
@@ -232,8 +268,21 @@ namespace UEMCPPIE
232
268
  }
233
269
  else
234
270
  {
235
- Row.PawnVelocity = Pawn->GetVelocity();
236
- Row.Speed2D = Pawn->GetVelocity().Size2D();
271
+ FVector Vel = Pawn->GetVelocity();
272
+ if (Vel.IsNearlyZero())
273
+ {
274
+ if (UPrimitiveComponent* Root = Cast<UPrimitiveComponent>(Pawn->GetRootComponent()))
275
+ {
276
+ Vel = Root->GetPhysicsLinearVelocity();
277
+ }
278
+ if (Vel.IsNearlyZero() && FrameNumber > 0)
279
+ {
280
+ Vel = (Pawn->GetActorLocation() - PrevPawnLocation) / FMath::Max(DeltaTime, 0.001);
281
+ }
282
+ }
283
+ PrevPawnLocation = Pawn->GetActorLocation();
284
+ Row.PawnVelocity = Vel;
285
+ Row.Speed2D = Vel.Size2D();
237
286
  }
238
287
  }
239
288
 
@@ -94,5 +94,6 @@ namespace UEMCPPIE
94
94
  TArray<FTrackedValueSpec> TrackedValues;
95
95
  TArray<FTrackedAction> Tracked;
96
96
  TArray<FString> PendingMarkerLabels;
97
+ FVector PrevPawnLocation = FVector::ZeroVector;
97
98
  };
98
99
  }
@@ -242,6 +242,20 @@ namespace UEMCPPIE
242
242
  ActorRows.Add(MoveTemp(AR));
243
243
  }
244
244
 
245
+ // Detect late-discovered actions and rebuild CSV header.
246
+ const TArray<FActionSpec>& CurrentActions = Sampler.GetActions();
247
+ if (CurrentActions.Num() != CSVHdr.Actions.Num())
248
+ {
249
+ CSVHdr.Actions = CurrentActions;
250
+ CSVHdr.TrackedValues = Sampler.GetTrackedValues();
251
+ CSVHeader = BuildCSVHeader(CSVHdr);
252
+ CSVBody.Reset();
253
+ for (const FCSVRow& Prev : Rows)
254
+ {
255
+ AppendCSVRow(CSVBody, Prev, CSVHdr);
256
+ }
257
+ }
258
+
245
259
  AppendCSVRow(CSVBody, Row, CSVHdr);
246
260
  Rows.Add(MoveTemp(Row));
247
261
  }