Skip to content

Instantly share code, notes, and snippets.

on("add:character", function(obj) {
// If there aren't any ability objects to grab, then we're probably in the middle of a sandbox spin-up
if (findObjs({ _type: "ability"}).length === 0)
return;
var abil = findObjs({ _type: "ability", _characterid: obj.id});
if (abil.length === 0) // Only create the abilities if the character doesn't have any
{
createObj("ability", {
name: "Init",
function getAttributeObjects(characterObj,attributeArray) {
"use strict";
var i,
j = 0,
attributeObjArray = [],
attributeValue = [] ;
// can pass array of attribute strings or a single attribute string along with an associated character
// returns those attributes as an object array or returns false if they do not exist on the passed character.
@SCPRedMage
SCPRedMage / generate-spellbook.js
Last active March 15, 2016 04:44
Updated to only grab spellclass if we're filtering for it.
function getCharacterObj(obj) {
"use strict";
//send any object and returns the associated character object
//returns character object for attribute, token/graphic, and ability, and... character
var objType = obj._type,
att, characterObj, tok;
if ((objType !== "attribute") && (objType !== "graphic") && (objType !== "character")) {