From 2e5b25b5d8128104723e48ae3cfe20f42b5b0d22 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 29 Jun 2015 14:34:26 -0700 Subject: [PATCH] include timescale in wire protocol ../../interface/src/avatar/AvatarActionHold.cpp --- examples/debug-actions.js | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 examples/debug-actions.js diff --git a/examples/debug-actions.js b/examples/debug-actions.js new file mode 100644 index 0000000000..132bd64362 --- /dev/null +++ b/examples/debug-actions.js @@ -0,0 +1,42 @@ +// +// +// + + +function printData(data) { + var str = ''; + for (var key in data) { + if (typeof data[key] == 'object') str += key + printData(data[key]) + ' '; + else str += key + ':' + data[key] + ' '; + } + return str; +}; + +function printActions(deltaTime) { + var printed = false; + var ids = Entities.findEntities(MyAvatar.position, 10); + for (var i = 0; i < ids.length; i++) { + var entityID = ids[i]; + var actionIDs = Entities.getActionIDs(entityID); + if (actionIDs.length > 0) { + var props = Entities.getEntityProperties(entityID); + var output = props.name + " "; + for (var actionIndex = 0; actionIndex < actionIDs.length; actionIndex++) { + actionID = actionIDs[actionIndex]; + actionArguments = Entities.getActionArguments(entityID, actionID); + // output += actionArguments['type']; + output += "(" + printData(actionArguments) + ") "; + } + if (!printed) { + print("---------"); + printed = true; + } + print(output); + } + } +} + + +Script.setInterval(printActions, 5000); + +// Script.update.connect(printActions);