Skip to content
Leonid Pospelov edited this page Jul 31, 2019 · 3 revisions

All methods of Actor return promises or promise-like objects. It's recommended to use them with await keyword:

await someActor.setPos(0.0, 0.0, 0.0);

Set-methods like setPos can be chained:

await actor.setPos(52959, -15023, -378)
  .setAngle(0, 0, 180)
  .enable();

// Sets Z-angle to 45 degrees since it's last value in the chain
await actor.setAngle(0, 0, 180)
  .setAngle(0, 0, 90)
  .setAngle(0, 0, 45);

Property: 'pos'

Position in the world.

let pos = await actor.pos;
console.log(pos);
// Possible output: [32093, 9388, -120]

Property: 'angle'

Rotation in degrees.

let pos = await actor.angle;
console.log(angle);
// Possible output: [0, 0, 30]

Property: 'isEnabled'

A boolean value indicates whether the actor is enabled or not. Disabled actors are not visible in game.

let isEnabled = await actor.angle;
if (isEnabled === true) {
  // ...
}

Property: 'user'

See User. Can be Bot rather than a normal user.

let user = await actor.user;

Property: 'look'

See Look. Value can be null.

let look = await actor.look;
if (look !== null) {
  console.log('Look is', look);
}

.setPos(x, y, z)

Moves Actor to a specific point.

  • x - Number. X-position.
  • y - Number. Y-position.
  • z - Number. Z-position.
await someActor.setPos(3821, 9800, 18);

// It also works:
await someActor.setPos([3821, 9800, 18]);

.setAngle(x, y, z)

Rotates Actor.

  • x - Number. X-angle. Ignored by actors.
  • y - Number. Y-angle. Ignored by actors.
  • z - Number. Z-angle.
await someActor.setAngle(0.0, 0.0, 180.0);

// It also works:
await someActor.setAngle([0.0, 0.0, 180.0]);
await someActor.setAngleZ(180.0);

.enable()

Makes Actor visible in game. Attached User or Bot will see self spawned.

await someActor.enable();

.disable()

Makes Actor invisible in game. Attached User or Bot will automatically exit to the main menu.

await someActor.disable();

.setLook(newLook)

await someActor.setLook(new Look('Khajiit', 'Male'));

.showRaceMenu()

Shows the character creation menu.

await someActor.showRaceMenu();
Clone this wiki locally