-
Notifications
You must be signed in to change notification settings - Fork 7
Actor
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);
Position in the world.
let pos = await actor.pos;
console.log(pos);
// Possible output: [32093, 9388, -120]
Rotation in degrees.
let pos = await actor.angle;
console.log(angle);
// Possible output: [0, 0, 30]
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) {
// ...
}
See User. Can be Bot rather than a normal user.
let user = await actor.user;
See Look.
Value can be null
.
let look = await actor.look;
if (look !== null) {
console.log('Look is', look);
}
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]);
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);
Makes Actor
visible in game. Attached User
or Bot
will see self spawned.
await someActor.enable();
Makes Actor
invisible in game. Attached User
or Bot
will automatically exit to the main menu.
await someActor.disable();
-
newLook
- Look.
await someActor.setLook(new Look('Khajiit', 'Male'));
Shows the character creation menu.
await someActor.showRaceMenu();