
OMG FINALLY, got it thanks mucho gracias Aaron!
The Aaron said:
Great! Glad to hear it! =D Definitely let me know if there's anything else I can help with. =D
!group-init --del-group 1
!group-init --add-group --Bare initiative_overall|current
!group-init --add-group --Tie-Breaker overall_init|current
!group-init --promote 2
1. Tie-Breaker (initiative_overall|current)
2. initiative_overall|current
!group-init --add-group --Bare initiative_overall --Tie-Breaker initiative_overallSorry the syntax is so arcane, I've been meaning to rewrite it but haven't gotten to it yet.
The Aaron said:
Like this?
Update v0.9.9 -- Added --reroll to reroll all the tokens in the Turn Order as if they had all be selected. (Thanks Three of Swords!)
The Aaron said:
Interesting. Can you post your Tracker macros? What is happening is they are adjusting (apparently) whatever attribute is your diceCountAttribute. Through normal setting, the attribute ends up being a string. In this function, the string is pulled up for the character, then anything that looks like @{foo} is replaced with @{charname|foo} so that it can be calculated correctly. However, your tracker macros seem to be setting a number into them (which I frankly though would come back as a string anyway), which means there is no .replace() method, which is what the crash is from. The solution to this is to verify that it is a string and convert it to one if it isn't. I can work on that pretty fast, but to be sure I've got it fixed, I need the macros you're running so I can duplicate the crash.
I'll need to know a bit about your Group Initiative configuration as well. The output of !group-init --help should be sufficient.
/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v^ TypeError: Object 10 has no method 'replace' at evalmachine.<anonymous>:5828:37 at Array.map (native) at Function._.map._.collect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:97:56) at _.(anonymous function) [as map] (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:1073:39) at evalmachine.<anonymous>:5824:18at /home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:158:20 at Array.some (native) at _.some._.any (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:207:59) at Function._.find._.detect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:157:5) at findInitiativeBonus (evalmachine.<anonymous>:5822:11)
var stat=getAttrByName(char.id,details.attribute, details.type||'current')+'';
The Aaron said:
Cool! Glad to hear it!
I'll roll that into the standard version. I've got another little fix I'm working on to allow the token bars to be used instead of attributes.
The Aaron said:
Which stat are you using for your initiative bonus and how is it being set?
Attributes contain strings, but it looks like yours contains a number, the number 10. That's kind of odd.
If you go to line 672 and add +'' to the end of it, just before the ;, it should fix the problem:
var stat=getAttrByName(char.id,details.attribute, details.type||'current')+'';
/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v
^
TypeError: Object 7 has no method 'replace'
at _substituteShortForms (
Dylan S. said:
The Aaron said:
Which stat are you using for your initiative bonus and how is it being set?
Attributes contain strings, but it looks like yours contains a number, the number 10. That's kind of odd.
If you go to line 672 and add +'' to the end of it, just before the ;, it should fix the problem:
var stat=getAttrByName(char.id,details.attribute, details.type||'current')+'';
I hoped this might work out for me as well, but it didn't. Instead of the old error, I get this one./home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1
orts, require, module, __filename, __dirname) { function g(a){throw a;}var j=v
^
TypeError: Object 7 has no method 'replace'
at _substituteShortForms (Same set-up as before (using a script to change the value), but updated to the most recent version of this script.
on('ready',function(){ "use strict"; filterObjs(function(o){ if('attribute' === o.get('type')) { if( 'string' !== typeof o.get('current')){ o.set('current', o.get('current')+''); } if( 'string' !== typeof o.get('max')){ o.set('max', o.get('max')+''); } } return false; }); });
For reference, the error message generated was: evalmachine.<anonymous>:16181 total: (ird.results.total%1===0 ^ TypeError: Cannot read property 'results' of undefined at evalmachine.<anonymous>:16181:52 at Array.map (native) at Function._.map._.collect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:97:56) at _.(anonymous function) [as map] (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:1073:39) at evalmachine.<anonymous>:16178:34 at checkFinishedOps (
!group-init --bonus [[@{selected|init}]]To replace it with the evaluated value in that attribute, however if you expect everything to have that attribute, you should set it up as a group:
!group-init --add-group --Bare initYou'll probably need to remove the default rule with:
!group-init --del-group 1You can read all about this in the help:
!group-init --help
I have this same issue - works fine if you have one token selected, reliably happens with multiple tokens. I'm using the 5e shaped character sheet withKevin said:
So I am having issues with this script... Here is the error:For reference, the error message generated was: evalmachine.<anonymous>:16181 total: (ird.results.total%1===0 ^ TypeError: Cannot read property 'results' of undefined at evalmachine.<anonymous>:16181:52 at Array.map (native) at Function._.map._.collect (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:97:56) at _.(anonymous function) [as map] (/home/symbly/www/d20-api-server/sandcastle/node_modules/underscore/underscore.js:1073:39) at evalmachine.<anonymous>:16178:34 at checkFinishedOps (
What is really strange is that this configuration was running several weeks ago... then just stopped working for some reason. Also if I select an individual token it works great. If I select multiple tokens it fails.
!group-init --add-group --Bare initiative_overall --Tie-Breaker initiative_overallas suggested higher up in this thread.
&{template:pf_generic} {{character_name=@{selected|character_name}}} {{character_id=@{selected|character_id}}} {{name=Initiative}} {{check=[[ (1d20 + [[ @{selected|init} ]][init] + [[ abs(0.01 * @{selected|init}) ]][tie-breaker]) &{tracker} ]]}}
[[((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})+(0.01*((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})))) + (1d20)]]and it gets back a response that looks like:
$[[2]]which it then parses and indexes against the rollResults in the returned message. All fine.
[[((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})+(0.01*((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})))) + (1d20)]][[((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})+(0.01*((@{Dark Goblin|dexterity_mod} + @{Dark Goblin|initiative} + @{Dark Goblin|jack_of_all_trades}) + (@{Dark Goblin|global_check_bonus})))) + (1d20)]]Roll20 seems to cough up a hairball and sends back this:
$[[2]][[((1 + 0 + 0) + (0)+(0.01*(($[[3]] + 0 + 0) + (0)))) + (1d20)]]Naturally, Aaron's script barfs fairly hard since it's just expecting two numbers in square brackets, not all of this! What's especially weird is that if I paste the problematic message into my chat window, it just prints the two modified dice rolls next to each other as I would expect, without all the other mad gubbins strewn in there. To make matters worse, of the two placeholders in the message content ($[[2]] and $[[3]]), only the first resolves to the correct inline roll, the other resolves to the expression that calculates the dexterity mod! It all seems a bit borked :-(