@specter-automation/test 1.0.133 → 1.0.134
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.
|
@@ -375,7 +375,12 @@ export declare class SpecterWorld {
|
|
|
375
375
|
* @param seconds In-game simulation seconds to wait.
|
|
376
376
|
*/
|
|
377
377
|
waitForGameSeconds(seconds: number): Promise<void>;
|
|
378
|
-
|
|
378
|
+
/**
|
|
379
|
+
* Spawns an Actor in the active world by Blueprint name (e.g. `'BP_Hero_Steel'`),
|
|
380
|
+
* C++ class name (e.g. `'HotsHeroCharacter'`), or full asset path.
|
|
381
|
+
* Throws an error if multiple assets match the given short name.
|
|
382
|
+
*/
|
|
383
|
+
spawnActor<T extends RegisteredActorClasses | (string & {})>(classNameOrAssetPath: T, options?: SpawnOptions): Promise<ActorLocator<T>>;
|
|
379
384
|
actor<T extends RegisteredActorClasses | (string & {})>(selector: T): ActorLocator<T>;
|
|
380
385
|
actorByTag(tagName: string): ActorLocator;
|
|
381
386
|
/**
|
|
@@ -671,12 +671,18 @@ class SpecterWorld {
|
|
|
671
671
|
await new Promise(resolve => setTimeout(resolve, wallClockMs));
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
-
|
|
674
|
+
/**
|
|
675
|
+
* Spawns an Actor in the active world by Blueprint name (e.g. `'BP_Hero_Steel'`),
|
|
676
|
+
* C++ class name (e.g. `'HotsHeroCharacter'`), or full asset path.
|
|
677
|
+
* Throws an error if multiple assets match the given short name.
|
|
678
|
+
*/
|
|
679
|
+
async spawnActor(classNameOrAssetPath, options) {
|
|
675
680
|
// Generate a unique tag if the user didn't provide one
|
|
676
681
|
const uniqueId = crypto_1.default.randomBytes(4).toString('hex');
|
|
677
682
|
const tag = options?.tag || `Spawned_${uniqueId}`;
|
|
678
683
|
const location = options?.location || { x: 0, y: 0, z: 0 };
|
|
679
684
|
const rotation = options?.rotation || { pitch: 0, yaw: 0, roll: 0 };
|
|
685
|
+
const assetPath = String(classNameOrAssetPath);
|
|
680
686
|
const assetName = assetPath.split('/').pop()?.split('.')[0];
|
|
681
687
|
const properties = options?.properties;
|
|
682
688
|
const spawnController = options?.spawnController;
|