mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi
This commit is contained in:
commit
8efc4d52ba
2 changed files with 27 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
||||||
// bot.js
|
// bot.js
|
||||||
// hifi
|
// hifi
|
||||||
//
|
//
|
||||||
// Created by Brad Hefta-Gaub on 2/20/14.
|
// Created by Stephen Birarda on 2/20/14.
|
||||||
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
// Copyright (c) 2014 HighFidelity, Inc. All rights reserved.
|
||||||
//
|
//
|
||||||
// This is an example script that demonstrates an NPC avatar.
|
// This is an example script that demonstrates an NPC avatar.
|
||||||
|
@ -25,10 +25,30 @@ positionZ = getRandomFloat(0, 50);
|
||||||
Avatar.position = {x: positionX, y: 0, z: positionZ};
|
Avatar.position = {x: positionX, y: 0, z: positionZ};
|
||||||
|
|
||||||
// pick an integer between 1 and 20 for the face model for this bot
|
// pick an integer between 1 and 20 for the face model for this bot
|
||||||
botNumber = getRandomInt(1, 20);
|
botNumber = getRandomInt(1, 100);
|
||||||
|
|
||||||
|
newBodyFilePrefix = "defaultAvatar";
|
||||||
|
|
||||||
|
if (botNumber <= 20) {
|
||||||
|
newFaceFilePrefix = "bot" + botNumber;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (botNumber <= 40) {
|
||||||
|
newFaceFilePrefix = "superhero";
|
||||||
|
} else if (botNumber <= 60) {
|
||||||
|
newFaceFilePrefix = "amber";
|
||||||
|
} else if (botNumber <= 80) {
|
||||||
|
newFaceFilePrefix = "ron";
|
||||||
|
} else {
|
||||||
|
newFaceFilePrefix = "angie";
|
||||||
|
}
|
||||||
|
|
||||||
|
newBodyFilePrefix = "bot" + botNumber;
|
||||||
|
}
|
||||||
|
|
||||||
// set the face model fst using the bot number
|
// set the face model fst using the bot number
|
||||||
// there is no need to change the body model - we're using the default
|
// there is no need to change the body model - we're using the default
|
||||||
Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/bot" + botNumber + ".fst";
|
Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newFaceFilePrefix + ".fst";
|
||||||
|
Avatar.bodyModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix + ".fst";
|
||||||
|
|
||||||
Agent.isAvatar = true;
|
Agent.isAvatar = true;
|
|
@ -4206,7 +4206,9 @@ void Application::reloadAllScripts() {
|
||||||
scriptAction->activate(QAction::Trigger);
|
scriptAction->activate(QAction::Trigger);
|
||||||
qDebug() << "stopping script..." << scriptAction->text();
|
qDebug() << "stopping script..." << scriptAction->text();
|
||||||
}
|
}
|
||||||
_activeScripts.clear();
|
|
||||||
|
// NOTE: we don't need to clear the _activeScripts list because that is handled on script shutdown.
|
||||||
|
|
||||||
foreach (QString scriptName, reloadList){
|
foreach (QString scriptName, reloadList){
|
||||||
qDebug() << "reloading script..." << scriptName;
|
qDebug() << "reloading script..." << scriptName;
|
||||||
loadScript(scriptName);
|
loadScript(scriptName);
|
||||||
|
@ -4214,7 +4216,7 @@ void Application::reloadAllScripts() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::removeScriptName(const QString& fileNameString) {
|
void Application::removeScriptName(const QString& fileNameString) {
|
||||||
_activeScripts.removeOne(fileNameString);
|
_activeScripts.removeOne(fileNameString);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadScript(const QString& fileNameString) {
|
void Application::loadScript(const QString& fileNameString) {
|
||||||
|
|
Loading…
Reference in a new issue