mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 23:03:12 +02:00
Spread avatars around (not up to) a larger area.
This commit is contained in:
parent
7d30cd0159
commit
0a8fd9cbad
1 changed files with 4 additions and 3 deletions
|
@ -14,16 +14,17 @@
|
||||||
// An assignment client script that animates one avatar at random location within 'spread' meters of 'origin'.
|
// An assignment client script that animates one avatar at random location within 'spread' meters of 'origin'.
|
||||||
// In Domain Server Settings, go to scripts and give the url of this script. Press '+', and then 'Save and restart'.
|
// In Domain Server Settings, go to scripts and give the url of this script. Press '+', and then 'Save and restart'.
|
||||||
|
|
||||||
var origin = {x: 500, y: 502, z: 500};
|
var origin = {x: 500, y: 500, z: 500};
|
||||||
var spread = 10; // meters
|
var spread = 20; // meters
|
||||||
var animationData = {url: "https://hifi-public.s3.amazonaws.com/ozan/anim/standard_anims/walk_fwd.fbx", lastFrame: 35};
|
var animationData = {url: "https://hifi-public.s3.amazonaws.com/ozan/anim/standard_anims/walk_fwd.fbx", lastFrame: 35};
|
||||||
Avatar.skeletonModelURL = "https://hifi-public.s3.amazonaws.com/marketplace/contents/dd03b8e3-52fb-4ab3-9ac9-3b17e00cd85d/98baa90b3b66803c5d7bd4537fca6993.fst"; //lovejoy
|
Avatar.skeletonModelURL = "https://hifi-public.s3.amazonaws.com/marketplace/contents/dd03b8e3-52fb-4ab3-9ac9-3b17e00cd85d/98baa90b3b66803c5d7bd4537fca6993.fst"; //lovejoy
|
||||||
Avatar.displayName = "'Bot";
|
Avatar.displayName = "'Bot";
|
||||||
var millisecondsToWaitBeforeStarting = 10 * 1000; // To give the various servers a chance to start.
|
var millisecondsToWaitBeforeStarting = 10 * 1000; // To give the various servers a chance to start.
|
||||||
|
|
||||||
Agent.isAvatar = true;
|
Agent.isAvatar = true;
|
||||||
|
function coord() { return (Math.random() * spread) - (spread / 2); } // randomly distribute a coordinate zero += spread/2.
|
||||||
Script.setTimeout(function () {
|
Script.setTimeout(function () {
|
||||||
Avatar.position = Vec3.sum(origin, {x: Math.random() * spread, y: 0, z: Math.random() * spread});
|
Avatar.position = Vec3.sum(origin, {x: coord(), y: 0, z: coord()});
|
||||||
print("Starting at", JSON.stringify(Avatar.position));
|
print("Starting at", JSON.stringify(Avatar.position));
|
||||||
Avatar.startAnimation(animationData.url, animationData.fps || 30, 1, true, false, animationData.firstFrame || 0, animationData.lastFrame);
|
Avatar.startAnimation(animationData.url, animationData.fps || 30, 1, true, false, animationData.firstFrame || 0, animationData.lastFrame);
|
||||||
}, millisecondsToWaitBeforeStarting);
|
}, millisecondsToWaitBeforeStarting);
|
||||||
|
|
Loading…
Reference in a new issue