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

Powercards skipto not working or is it because of 2 api tags?

I am curious about skipto in Powercards. I have a card setup and I would like to use skipto based on conditionals and depending on which condition is true call chatsetattr to modify the character sheet. -- ?? ~Ammo$ == 1 ?? skipto*1|UseAmmo-0 -- ?+ ~Ammo$ == 2 +? skipto*2|UseAmmo-1 --:UseAmmo-0| --api_setattr|#UseArrow-0 --skipto*5|EndOfCard --:UseAmmo-1| --api_setattr|#UseArrow-1 --skipto*6|EndOfCard --:EndOfCard| This card only seems to process the second api call of chatsetattr which calls my UseArrow-1 macro. I would like this to make only the first call at UseAmmo-0 if that is true or skipto UseAmmo-1 if that is true. So not sure if the skipto isn't working or powercards is not liking the 2 api tags.
1601464075
David M.
Pro
API Scripter
Never used that feature, but curious for the resolution. Following...
1601469717
Kurt J.
Pro
API Scripter
Ravens Aye said: I am curious about skipto in Powercards. I have a card setup and I would like to use skipto based on conditionals and depending on which condition is true call chatsetattr to modify the character sheet. -- ?? ~Ammo$ == 1 ?? skipto*1|UseAmmo-0 -- ?+ ~Ammo$ == 2 +? skipto*2|UseAmmo-1 --:UseAmmo-0| --api_setattr|#UseArrow-0 --skipto*5|EndOfCard --:UseAmmo-1| --api_setattr|#UseArrow-1 --skipto*6|EndOfCard --:EndOfCard| This card only seems to process the second api call of chatsetattr which calls my UseArrow-1 macro. I would like this to make only the first call at UseAmmo-0 if that is true or skipto UseAmmo-1 if that is true. So not sure if the skipto isn't working or powercards is not liking the 2 api tags. Any tag needs to be unique. You need to add *1, *2, etc. to the api_setattr tags. Any time you have duplicate tags they will all be collapsed into a single one (the last one).
1601491807

Edited 1601491907
Thanks Kurt, but that now seems to be hitting both api calls instead of just the second one as it was before. Is my skipto cased correctly? In the wiki it is written a couple different ways (SkipTo, skipTo, skipto). Basically it acts like it is not skipping to the proper location. Here is my whole powercard: !power {{ --replacement|Longbow --inlinereplace|Ammo|?{Ammunition Type |Arrow (standard), 0| Arrow+1, 1| Arrow+2, 2| Arrow+3, 3} --template|Header|@{selected|token_name}; ~WName$; Ammunition Bonus: ~Ammo$; @{selected|character_id} --format|chris --template|Target|@{target|token_id};@{selected|token_name};@{target|character_name};~Flv$ --template|WeaponAttack|@{selected|dexterity_mod};@{selected|pb};0;@{target|AC};~Dmg$;~DType$;@{target|token_id};glow-blood;bomb-blood;~Ammo$;2 -- ?? ~Ammo$ == 1 ?? skipto*1|UseAmmo0 -- ?+ ~Ammo$ == 2 +? skipto*2|UseAmmo1 --:UseAmmo0| --api_setattr*3|#UseArrow-0 --skipto*5|EndOfCard --:UseAmmo1| --api_setattr*4|#UseArrow-1 --skipto*6|EndOfCard --:EndOfCard| }}
1601494582
Kurt J.
Pro
API Scripter
Ravens Aye said: Thanks Kurt, but that now seems to be hitting both api calls instead of just the second one as it was before. Is my skipto cased correctly? In the wiki it is written a couple different ways (SkipTo, skipTo, skipto). Basically it acts like it is not skipping to the proper location. Here is my whole powercard: !power {{ --replacement|Longbow --inlinereplace|Ammo|?{Ammunition Type |Arrow (standard), 0| Arrow+1, 1| Arrow+2, 2| Arrow+3, 3} --template|Header|@{selected|token_name}; ~WName$; Ammunition Bonus: ~Ammo$; @{selected|character_id} --format|chris --template|Target|@{target|token_id};@{selected|token_name};@{target|character_name};~Flv$ --template|WeaponAttack|@{selected|dexterity_mod};@{selected|pb};0;@{target|AC};~Dmg$;~DType$;@{target|token_id};glow-blood;bomb-blood;~Ammo$;2 -- ?? ~Ammo$ == 1 ?? skipto*1|UseAmmo0 -- ?+ ~Ammo$ == 2 +? skipto*2|UseAmmo1 --:UseAmmo0| --api_setattr*3|#UseArrow-0 --skipto*5|EndOfCard --:UseAmmo1| --api_setattr*4|#UseArrow-1 --skipto*6|EndOfCard --:EndOfCard| }} I did some looking at the code, and the way api calls (and alterbar, audio, and video effects) are handled they aren't impacted by skiptos and get run anyway. I'll work on a resolution.
1601494834
Kurt J.
Pro
API Scripter
Kurt J. said: Ravens Aye said: Thanks Kurt, but that now seems to be hitting both api calls instead of just the second one as it was before. Is my skipto cased correctly? In the wiki it is written a couple different ways (SkipTo, skipTo, skipto). Basically it acts like it is not skipping to the proper location. Here is my whole powercard: !power {{ --replacement|Longbow --inlinereplace|Ammo|?{Ammunition Type |Arrow (standard), 0| Arrow+1, 1| Arrow+2, 2| Arrow+3, 3} --template|Header|@{selected|token_name}; ~WName$; Ammunition Bonus: ~Ammo$; @{selected|character_id} --format|chris --template|Target|@{target|token_id};@{selected|token_name};@{target|character_name};~Flv$ --template|WeaponAttack|@{selected|dexterity_mod};@{selected|pb};0;@{target|AC};~Dmg$;~DType$;@{target|token_id};glow-blood;bomb-blood;~Ammo$;2 -- ?? ~Ammo$ == 1 ?? skipto*1|UseAmmo0 -- ?+ ~Ammo$ == 2 +? skipto*2|UseAmmo1 --:UseAmmo0| --api_setattr*3|#UseArrow-0 --skipto*5|EndOfCard --:UseAmmo1| --api_setattr*4|#UseArrow-1 --skipto*6|EndOfCard --:EndOfCard| }} I did some looking at the code, and the way api calls (and alterbar, audio, and video effects) are handled they aren't impacted by skiptos and get run anyway. I'll work on a resolution. Well, that was an easy fix...The Development GIST  now contains version 3.8.15 that includes these special tags being subject to the --skipto tag.
Kurt you are amazingly fast - thank you. I did load up 3.8.15 and gave quick test but I was only seeing it hitting the first api tag for either condition unfortunately. I didn't spend too much time as I have my weekly game tonight but I did switch the macro calls just to see and indeed it seems to only skipto -:UseAmmo0
1601522020
Kurt J.
Pro
API Scripter
I can't say for certain, but I believe the conditional lines may be having trouble checking the values because of the spaces in front of them in the RollQuery. I would remove the spaces ("0" and "1" instead of " 0" and " 1") because standard conditionals don't do well with string checking. Alternatively you could switch to advanced conditionals (?!..!?) and use -eq " 0", etc). I can check tomorrow if that resolves the issue... I think it is actually just falling through the conditionals and hitting 0 and then jumping to EndOfCard.
Figured it out! Thanks Kurt for your help with this though I think the latter problem was mine. I fixed the conditional as you said and I think I was checking the wrong thing on the first conditional. It should have been (Ammo == 0 not Ammo ==1). I have it working correctly now. For those that may want this, I have this PowerCards macro that  prompts the player to choose ammunition for a ranged attack weapon and then deducts the ammo using chatsetattr from the correct repeating resource location I have setup. The PowerCard calls #UseAmmo macros for each ammo type that basically fill in the params of CSA. I also use PowerCards replacements and templates in this. I am going to tweak this a bit to be a little more generic but here it is! Enjoy !power {{ --replacement|Longbow --inlinereplace|Ammo|?{Ammunition Type|Arrow (standard),0|Arrow+1,1|Arrow+2,2|Arrow+3,3} --template|Header|@{selected|token_name}; ~WName$; Ammunition Bonus: ~Ammo$; @{selected|character_id} --format|chris --template|Target|@{target|token_id};@{selected|token_name};@{target|character_name};~Flv$ --template|WeaponAttack|@{selected|dexterity_mod};@{selected|pb};0;@{target|AC};~Dmg$;~DType$;@{target|token_id};glow-blood;bomb-blood;~Ammo$;2 -- ?! ~Ammo$ -eq 0 !? skipto*1|UseAmmo0 -- ?! ~Ammo$ -eq 1 !? skipto*2|UseAmmo1 -- ?! ~Ammo$ -eq 2 !? skipto*3|UseAmmo2 -- ?! ~Ammo$ -eq 3 !? skipto*4|UseAmmo3 --:UseAmmo0| --api_setattr*5|#UseArrow0 --skipto*6|EndOfCard --:UseAmmo1| --api_setattr*7|#UseArrow1 --skipto*8|EndOfCard --:UseAmmo2| --api_setattr*9|#UseArrow2 --skipto*10|EndOfCard --:UseAmmo3| --api_setattr*11|#UseArrow3 --skipto*12|EndOfCard --:EndOfCard| }} The UseAmmo macros look like this as they are being called from within the powercard so they use that api syntax: _mod _charid @{selected|character_id} _repeating_resource_$0_resource_left|-1 I love PowerCards!!!!