From 060e5f8c67eaa6461da977067ed3eaa1debb5f27 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 21 Feb 2014 13:52:54 -0800 Subject: [PATCH 1/3] updates to bot script for more bot styles --- examples/bot.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/examples/bot.js b/examples/bot.js index 6d0abd740e..d2db3d3b48 100644 --- a/examples/bot.js +++ b/examples/bot.js @@ -25,10 +25,31 @@ positionZ = getRandomFloat(0, 50); Avatar.position = {x: positionX, y: 0, z: positionZ}; // 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 // 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; \ No newline at end of file From 6cef72473def95bb7a846094d54473ce99f0cc84 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 24 Feb 2014 10:04:08 -0800 Subject: [PATCH 2/3] changes to the bot script --- examples/bot.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/bot.js b/examples/bot.js index d2db3d3b48..8ac718e34d 100644 --- a/examples/bot.js +++ b/examples/bot.js @@ -2,7 +2,7 @@ // bot.js // 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. // // This is an example script that demonstrates an NPC avatar. @@ -46,10 +46,9 @@ if (botNumber <= 20) { newBodyFilePrefix = "bot" + botNumber; } - // set the face model fst using the bot number // 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/" + newFaceFilePrefix ".fst"; -Avatar.bodyModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix ".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; \ No newline at end of file From 6ea2c81e68149e74fd16fc837b79978a9f030939 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Mon, 24 Feb 2014 10:10:00 -0800 Subject: [PATCH 3/3] fix reload of scripts --- interface/src/Application.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 38fee4baba..4dd7b66d1c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4201,7 +4201,9 @@ void Application::reloadAllScripts() { scriptAction->activate(QAction::Trigger); 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){ qDebug() << "reloading script..." << scriptName; loadScript(scriptName); @@ -4209,7 +4211,7 @@ void Application::reloadAllScripts() { } void Application::removeScriptName(const QString& fileNameString) { - _activeScripts.removeOne(fileNameString); + _activeScripts.removeOne(fileNameString); } void Application::loadScript(const QString& fileNameString) {