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 .
×
Create a free account

Trying to debug Old Code that works in another game.

1518968065

Edited 1518971584
Tweek
Plus
(Isolated some issues, see my last reply) i made this a while back, when my head was into all all this. i get a TypeError: a is undefined when i try to use it in my new game, cant seem to find why, even after trying to debug it. ?{Select Action |Dash Action,&{template:npcatk}{{name=@{selected|character_name} **uses the Dash Action**}}{{normal=1}}{{r1=Gain extra movement for the current turn. The increase equals your speed, after applying any modifiers.}} |Disengage Action,&{template:npcatk}{{name=@{selected|character_name} **uses the Disengage Action**}}{{normal=1}}{{r1=His movement doesn't provoke opportunity attacks for the rest of the turn}} |Dodge Action,&{template:npcatk}{{name=@{selected|character_name} **uses the Dodge Action**}}{{normal=1}}{{r1=Until the start of his next turn, any attack roll made against him has disadvantage if he can see the attacker, and he makes Dexterity saving throws with advantage. He loses this benefit if he is incapacitated or if his speed drops to 0.}} |Escape Grapple Action,&{template:default}{{name=@{selected|character_name} tries to escape}}{{?{How?|Athletics,Athletics VS Athletics.=[[d20+@{selected|athletics_bonus}]][[d20+@{selected|athletics_bonus}]] adv/dis|Acrobatics,Acrobatics VS Athletics.=[[d20+@{selected|acrobatics_bonus}]][[d20+@{selected|acrobatics_bonus}]] adv/dis}}} |Grapple Action,&{template:default}{{name=@{selected|character_name} Grapples}}{{Athletics VS Athletic OR Acrobatics.=[[d20+@{selected|athletics_bonus}]][[d20+@{selected|athletics_bonus}]] adv/dis[Rules](~selected|GrapplingRules)}} |Help Action,&{template:npcatk}{{name=@{selected|character_name} **uses the Help Action**}}{{normal=1}}{{r1=Chosen target gains **advantage** on **next ability check** it makes. Alternatively, the target gains **advantage** on the **next attack roll** against a creature within **5 feet** of the helper. The advantage lasts until the start of the helpers next turn.}} |Hide Action,&{template:npcatk}{{name=@{selected|character_name}}}{{always=1}}{{rname=Hide Action}} {{rnamec=Hide Action}}{{r1=[[d20+@{selected|stealth_bonus}]]}}{{r2=[[d20+@{selected|stealth_bonus}]] adv/dis}} |Ready an Action,&{template:npcatk}{{name=@{selected|character_name} **will ?{Describe Action|do something}**}}{{normal=1}}{{r1=?{Describe Trigger|when something happens}}} |Search Action,&{template:default}{{name=@{selected|character_name} Searches}}{{?{How?|Perception,Perception=[[d20+@{selected|perception_bonus}]][[d20+@{selected|perception_bonus}]] adv/dis|Investigation,Investigation=[[d20+@{selected|investigation_bonus}]][[d20+@{selected|investigation_bonus}]] adv/dis}}} |Shove Action,&{template:default}{{name=@{selected|character_name} Shoves}}{{Athletics vs Athletic or Acrobatics=[[d20+@{selected|athletics_bonus}]][[d20+@{selected|athletics_bonus}]] adv/dis[Rules](~selected|ShovingRules)}} |Use Object Action,&{template:npcatk}{{name=@{selected|character_name} **uses**}}{{normal=1}}{{r1=?{Wich Object|Didn't specify an object}}} |Equip/Remove Shield(action),&{template:npcatk}{{name=Equip/Unequip Shield}}{{normal=1}}{{r1=A shield always takes an action to equip or unequip.}} |Crawl(5ft costs 10ft),&{template:npcatk}{{name=Crawl}}{{normal=1}}{{r1=Movement cost: 10ft per 5ft crawled. You must make weird sounds while u crawl.}} |Drop Prone(free action),&{template:npcatk}{{name=Drop Prone}}{{normal=1}}{{r1=Movement cost: 0ft(free) -You can drop prone without using any of your speed -To move while prone, you must crawl or use magic such as teleportation -Dropping prone adds the Prone condition (melee attacks against you have advantage, ranged attacks against you have disadvantage, your own attacks have disadvantage)}} |Grapple Move(speed halfved),&{template:npcatk}{{name=Move while Grappling}}{{normal=1}}{{r1=Drag or carry the grappled creature with you. If you move while grappling another creature, your speed is halved, unless the creature is two or more sizes smaller than you.}} |Stand Up(cost 1/2 speed),&{template:npcatk}{{name=Stand Up}}{{normal=1}}{{r1=Movement cost: half of your speed. You can't stand up if you don't have enough movement left or if your speed is 0.}}} ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I forget how to put it on here with the proper coding to show everything, but theres all the good &389g(example) instead of the }and other symbols. I also made the [rules] ShovingRules and GrapplingRules macro on the character sheet. but it should work without them I also added a space in the coding(enter), between actions, to help read it better in this post.
so i cant get token actions to come up in my game...unsure why..asked DM but no replies yet. I changed all the @selected with my character name instead of the selected token, but seems to have another issue now, The menus dont some up properly, seems to have some syntax errors in places.... but it works in the other game as is... new code im debugging ?{Select Action|Dash Action,&{template:npcatk}{{name=Ominak **uses the Dash Action**}}{{normal=1}}{{r1=Gain extra movement for the current turn. The increase equals your speed, after applying any modifiers.}}|Disengage Action,&{template:npcatk}{{name=Ominak **uses the Disengage Action**}}{{normal=1}}{{r1=His movement doesn't provoke opportunity attacks for the rest of the turn}}|Dodge Action,&{template:npcatk}{{name=Ominak **uses the Dodge Action**}}{{normal=1}}{{r1=Until the start of his next turn, any attack roll made against him has disadvantage if he can see the attacker, and he makes Dexterity saving throws with advantage. He loses this benefit if he is incapacitated or if his speed drops to 0.}}|Escape Grapple Action,&{template:default}{{name=Ominak tries to escape}}{{?{How?|Athletics,Athletics VS Athletics.=[[d20+@{Ominak|athletics_bonus}]][[d20+@{Ominak|athletics_bonus}]] adv/dis|Acrobatics,Acrobatics VS Athletics.=[[d20+@{Ominak|acrobatics_bonus}]][[d20+@{Ominak|acrobatics_bonus}]] adv/dis}}}|Grapple Action,&{template:default}{{name=Ominak Grapples}}{{Athletics VS Athletic OR Acrobatics.=[[d20+@{Ominak|athletics_bonus}]][[d20+@{Ominak|athletics_bonus}]] adv/dis[Rules](~selected|GrapplingRules)}}|Help Action,&{template:npcatk}{{name=Ominak **uses the Help Action**}}{{normal=1}}{{r1=Chosen target gains **advantage** on **next ability check** it makes. Alternatively, the target gains **advantage** on the **next attack roll** against a creature within **5 feet** of the helper. The advantage lasts until the start of the helpers next turn.}}|Hide Action,&{template:npcatk}{{name=Ominak}}{{always=1}}{{rname=Hide Action}} {{rnamec=Hide Action}}{{r1=[[d20+@{Ominak|stealth_bonus}]]}}{{r2=[[d20+@{Ominak|stealth_bonus}]] adv/dis}}|Ready an Action,&{template:npcatk}{{name=Ominak **will ?{Describe Action|do something}**}}{{normal=1}}{{r1=?{Describe Trigger|when something happens}}}|Search Action,&{template:default}{{name=Ominak Searches}}{{?{How?|Perception,Perception=[[d20+@{Ominak|perception_bonus}]][[d20+@{Ominak|perception_bonus}]] adv/dis|Investigation,Investigation=[[d20+@{Ominak|investigation_bonus}]][[d20+@{Ominak|investigation_bonus}]] adv/dis}}}|Shove Action,&{template:default}{{name=Ominak Shoves}}{{Athletics vs Athletic or Acrobatics=[[d20+@{Ominak|athletics_bonus}]][[d20+@{Ominak|athletics_bonus}]] adv/dis[Rules](~selected|ShovingRules)}}|Use Object Action,&{template:npcatk}{{name=Ominak **uses**}}{{normal=1}}{{r1=?{Wich Object|Didn't specify an object}}}|Equip/Remove Shield(action),&{template:npcatk}{{name=Equip/Unequip Shield}}{{normal=1}}{{r1=A shield always takes an action to equip or unequip.}}|Crawl(5ft costs 10ft),&{template:npcatk}{{name=Crawl}}{{normal=1}}{{r1=Movement cost: 10ft per 5ft crawled. You must make weird sounds while u crawl.}}|Drop Prone(free action),&{template:npcatk}{{name=Drop Prone}}{{normal=1}}{{r1=Movement cost: 0ft(free) -You can drop prone without using any of your speed -To move while prone, you must crawl or use magic such as teleportation -Dropping prone adds the Prone condition (melee attacks against you have advantage, ranged attacks against you have disadvantage, your own attacks have disadvantage)}}|Grapple Move(speed halfved),&{template:npcatk}{{name=Move while Grappling}}{{normal=1}}{{r1=Drag or carry the grappled creature with you. If you move while grappling another creature, your speed is halved, unless the creature is two or more sizes smaller than you.}} |Stand Up(cost 1/2 speed),&{template:npcatk}{{name=Stand Up}}{{normal=1}}{{r1=Movement cost: half of your speed. You can't stand up if you don't have enough movement left or if your speed is 0.}}} Alternatively, the target gains **advantage** on the **next attack roll** against a creature within **5 feet** of the helper. The advantage lasts until the start of the helpers next turn.}}|Hide Action,&{template:npcatk}{{name=Ominak}}{{always=1}}{{rname=Hide Action}} {{rnamec=Hide Action}}{{r1=[[d20+@{Ominak|stealth_bonus}]]}}{{r2=[[d20+@{Ominak|stealth_bonus}]] adv/dis}}|Ready an Action,&{template:npcatk}{{name=Ominak **will ?{Describe Action|do something}**}}{{normal=1}}{{r1=?{Describe Trigger|when something happens}}}|Search Action,&{template:default}{{name=Ominak} Searches}}{{?{How?|Perception,Perception=[[d20+@{Ominak|perception_bonus}]][[d20+@{Ominak|perception_bonus}]] adv/dis|Investigation,Investigation=[[d20+@{Ominak|investigation_bonus}]][[d20+@{Ominak|investigation_bonus}]] adv/dis}}}|Shove Action,&{template:default}{{name=Ominak Shoves}}{{Athletics vs Athletic or Acrobatics=[[d20+@{Ominak|athletics_bonus}]][[d20+@{Ominak|athletics_bonus}]] adv/dis[Rules](~selected|ShovingRules)}}|Use Object Action,&{template:npcatk}{{name=Ominak **uses**}}{{normal=1}}{{r1=?{Wich Object|Didn't specify an object}}}|Crawl(5ft costs 10ft),&{template:npcatk}{{name=Crawl}}{{normal=1}}{{r1=Movement cost: 10ft per 5ft crawled. You must make weird sounds while u crawl.}}|Drop Prone(free action),&{template:npcatk}{{name=Drop Prone}}{{normal=1}}{{r1=Movement cost: 0ft(free) -You can drop prone without using any of your speed -To move while prone, you must crawl or use magic such as teleportation -Dropping prone adds the Prone condition (melee attacks against you have advantage, ranged attacks against you have disadvantage, your own attacks have disadvantage)}}|Grapple Move(speed halfved),&{template:npcatk}{{name=Move while Grappling}}{{normal=1}}{{r1=Drag or carry the grappled creature with you. If you move while grappling another creature, your speed is halved, unless the creature is two or more sizes smaller than you.}} |Stand Up(cost 1/2 speed),&{template:npcatk}{{name=Stand Up}}{{normal=1}}{{r1=Movement cost: half of your speed. You can't stand up if you don't have enough movement left or if your speed is 0.}}}
first menu comes up fine, but seems to execute the rest for the macro badly after  that. asking for things with code in the question, instead of ending the macro and posting the desired result.
asks for input valuje: describe option then gives a dropdown to choose betweeen investigation and perception, but had more coding in the question and wrongs things in the dropdown and seems to post: Alternatively, the target gains advantage on the next attack roll against a creature within 5 feet of the helper. at the end of the process, after showing some of what you asked.
The start of some of this code seems to execute when it shouldnt, initial menu and displaying what is asked for works. Code keeps runnning after for some reason and asked for stuff and then shows: Alternatively, the target gains advantage on the next attack roll against a creature within 5 feet of the helper. at the end of the process, after showing some of what you asked. at the end of the demanded result in chat, outside of a window. |Ready an Action,&{template:npcatk}{{name=Ominak **will ?{Describe Action|do something}**}}{{normal=1}}{{r1=?{Describe Trigger|when something happens}}}|Search Action,&{template:default}{{name=Ominak Searches}}{{?{How?|Perception,Perception=[[d20+@{Ominak|perception_bonus}]][[d20+@{Ominak|perception_bonus}]] adv/dis|Investigation,Investigation=[[d20+@{Ominak|investigation_bonus}]][[d20+@{Ominak|investigation_bonus}]] adv/dis}}}|Shove Action,&{template:default}{{name=Ominak Shoves}}{{Athletics vs Athletic or Acrobatics=[[d20+@{Ominak|athletics_bonus}]][[d20+@{Ominak|athletics_bonus}]] adv/dis[Rules](~selected|ShovingRules)}}|Use Object Action,&{template:npcatk}{{name=Ominak **uses**}}{{normal=1}}{{r1=?{Wich Object|Didn't specify an object}}}|Equip/Remove Shield(action),&{template:npcatk}{{name=Equip/Unequip Shield}}{{normal=1}}{{r1=A shield always takes an action to equip or unequip.}}|Crawl(5ft costs 10ft),&{template:npcatk}{{name=Crawl}}{{normal=1}}{{r1=Movement cost: 10ft per 5ft crawled. You must make weird sounds while u crawl.}}|Drop Prone(free action),&{template:npcatk}{{name=Drop Prone}}{{normal=1}}{{r1=Movement cost: 0ft(free) -You can drop prone without using any of your speed -To move while prone, you must crawl or use magic such as teleportation -Dropping prone adds the Prone condition (melee attacks against you have advantage, ranged attacks against you have disadvantage, your own attacks have disadvantage)}}|Grapple Move(speed halfved),&{template:npcatk}{{name=Move while Grappling}}{{normal=1}}{{r1=Drag or carry the grappled creature with you. If you move while grappling another creature, your speed is halved, unless the creature is two or more sizes smaller than you.}} |Stand Up(cost 1/2 speed),&{template:npcatk}{{name=Stand Up}}{{normal=1}}{{r1=Movement cost: half of your speed. You can't stand up if you don't have enough movement left or if your speed is 0.}}} Alternatively, the target gains **advantage** on the **next attack roll** against a creature within **5 feet** of the helper. The advantage lasts until the start of the helpers next turn.}}|Hide Action,&{template:npcatk}{{name=Ominak}}{{always=1}}{{rname=Hide Action}} {{rnamec=Hide Action}}{{r1=[[d20+@{Ominak|stealth_bonus}]]}}{{r2=[[d20+@{Ominak|stealth_bonus}]] adv/dis}}|Ready an Action,&{template:npcatk}{{name=Ominak **will ?{Describe Action|do something}**}}{{normal=1}}{{r1=?{Describe Trigger|when something
A drop-down query whos prompts are code instead of a basic prompt as intended are almost always a missed comma for HTML replacements. Your text blocks have a lot of commas; doublecheck that every single one is accounted for and replaced with HTML escape codes. Two simplify this somewhat, move every bit of code that's repeated in each section (template header, name, always=, etc outside the drop-down query.  The query should only provide info that changes. You don't need to reference the character sheet name if you're creating this as an "Ability" on a character sheet. It will automatically identify the attributes from the sheet it's run from.  As far as Token Abilities not showing up; that means the token is not attached to the sheet properly.