Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Interesting Macro Problem

1489097398

Edited 1489097730
Hello guys, I've encountered an interesting problem while creating a macro for my game. Basically I wrote the macro seen below, whereas VTD and GES are defensive values and STÄ and TRF are offensive ones. Now every Token has been linked to a character sheet containing those values. But strangely enough, when i use the macro, it works against most tokens. But with some ones there is an error, which I only found by inspecting the site. It says "syntaxError", which I know isn't true since it works most of the time. The macro in question: [[[[{1d100<[[@{TRF}*100/@{selected|GES}]]}]]*round(@{Level}/@{selected|Level}*(@{STÄ}*(0.8+0.1*d10)*@{selected|Level}*12.5/(@{selected|Level}*12.5+2*@{selected|VTD})))]] The error code when inspecting: Uncaught d20.D…G.r…t.SyntaxError {name: "SyntaxError", expected: Array[12], found: ".", message: "Expected "!!", "!", "cf", "cs", "d", "f", "k", "r", "ro", "s", [0-9] or [>|<|=] but "." found.", offset: 10…} Somewhere down the line this appeared as well: d20.DicePEG.result.SyntaxError column:11 expected:Array[12] found:"." line:1 message:"Expected "!!", "!", "cf", "cs", "d", "f", "k", "r", "ro", "s", [0-9] or [>|<|=] but "." found." name:"SyntaxError" offset:10 __proto__:Object Edit: Saw after the post that the 2 errorcodes are basically the same sorry for that  Hope somone could help me with this, since i can't actually see where the problem lies. Thanks in advance.
I don't know if it's still the case as it's been a while for me, but the Success/Failure dice reference has always been a little dicey (hur hur hur) about too much going on to the right of the > comparison. If you adjust it so all the maths are on one side and just a raw static value is on the right, you might fix the issue. ie: [[1d100 - ( (@{TRF} * 100) / @{selected|GES} )   ]]<0 ]] instead of [[{1d100<[[@{TRF}*100/@{selected|GES}]]}]]
1489118253

Edited 1489118327
Compare Points must be non-negative integers; they cannot be decimals (which [[@{TRF}*100/@{selected|GES}]] could be if @{selected|GES} is not a factor of @{TRF}). You can work around this by replacing 1d100<[[@{TRF}*100/@{selected|GES}]] with {1d100*@{selected|GES}}<[[@{TRF}*100]] Davy G. said: [[[[{1d100<[[@{TRF}*100/@{selected|GES}]]}]]*round(@{Level}/@{selected|Level}*(@{STÄ}*(0.8+0.1*d10)*@{selected|Level}*12.5/(@{selected|Level}*12.5+2*@{selected|VTD})))]] Out of curiosity, is this macro attempting to model a table of values?
if this is a game macro that is available to tokens then don't you need to also have @{selected| for TRF and Level?
Silvyre said: Out of curiosity, is this macro attempting to model a table of values? Well don't quite understand what you mean to be honest, since I'm not a native english speaker, but what I'm doing is using the "None" character sheet to create sheets of my own with my own stats and macros. Thanks for the solutions! I tried changing [[@{TRF}*100/@{selected|GES}]] to [[round(@{TRF}*100/@{selected|GES})]] and it worked as well. Also I discovered that with 1 test object GES was 0 effectively resulting in division by 0 which is obviously not calculable. But with this its solved.