Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AleziaKurdis authored Nov 18, 2024
1 parent 47d5807 commit 8a1f034
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions BOT/aCAgentTest-1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"use strict";
/*jslint vars: true, plusplus: true*/
/*global Agent, Avatar, Script, Entities, Vec3, Quat, print*/
//
// aCAgentTest-1.js
//
// Created by Alezia Kurdis on November 17th, 2024
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
// 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'.

var ROOT = Script.resolvePath('').split("aCAgentTest-1.js")[0];
var origin = {x: -11, y: 0.1, z: -6};
var spread = 20; // meters
var turnSpread = 90; // How many degrees should turn from front range over.
var animationData = {
"url": ROOT + "animations/walk_fwd.fbx",
"lastFrame": 35
};

var models = [
{"url": "http://metaverse.bashora.com/avatars/ALEZIA/avatar.fst?dna=AE_AA_AA_AB_AG_AA_AA", "displayName": "Nebula"}
};

var chosenAvatar = Math.round(Math.random() * (models.length - 1));
Avatar.skeletonModelURL = models[chosenAvatar].url;
Avatar.displayName = models[chosenAvatar].displayName;

var millisecondsToWaitBeforeStarting = 10 * 1000; // To give the various servers a chance to start.

Agent.isAvatar = true;
function coord() { return (Math.random() * spread) - (spread / 2); } // randomly distribute a coordinate zero += spread/2.
Script.setTimeout(function () {
Avatar.position = Vec3.sum(origin, {x: coord(), y: 0, z: coord()});
Avatar.orientation = Quat.fromPitchYawRollDegrees(0, turnSpread * (Math.random() - 0.5), 0);
print("Starting at", JSON.stringify(Avatar.position));
Avatar.startAnimation(animationData.url, animationData.fps || 30, 1, true, false, animationData.firstFrame || 0, animationData.lastFrame);
}, millisecondsToWaitBeforeStarting);
Binary file added BOT/animations/walk_fwd.fbx
Binary file not shown.

0 comments on commit 8a1f034

Please sign in to comment.