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

power card scripting

is there a way to have a power card create a 15 ft aura around a players token? ad if they cast spirit guardian?   not apply damage or anything just create the aura to keep track of who is in or enters the area of effect       maby in conjunction with alterbar api?  
Yes, tokenmod can be activated through powercards. !power {{ --name|@{selected|token_name} casts Spirit Guardian --api_token-mod|_showplayers_aura1 _set aura1_radius|15 aura1_color|00ff00 }}
1626406986

Edited 1626407802
awsome thank you however what if i have spirit weapon script running using auras ?  any way arround that
If they are different radius size you can have up to two auras. I am not familiar with the spirit weapon script. I suppose you could use token condition to attach a condition marker representing the aura.
a condition marker cant make an aura can it?
1626460008
timmaugh
Pro
API Scripter
Peacekeeper B said: Yes, tokenmod can be activated through powercards. !power {{ --name|@{selected|token_name} casts Spirit Guardian --api_token-mod|_showplayers_aura1 _set aura1_radius|15 aura1_color|00ff00 }} Not completely sure, but I think the token-mod line there will either require SelectManager to be installed (to use as written), or be told to ignore selected and have the selected token's ID be passed to an --ids argument (with the playerscanids option set if you want a non-GM to be able to do this). So either install SelectManager, or I think the above line should be: --api_token-mod|_showplayers_aura1 _set aura1_radius|15 aura1_color|00ff00 _ignore-selected _ids|@{selected|token_id} The token-mod config to allow players to use IDs is: !token-mod--config players-can-ids|on
I use a similar macro in my game and it works just fine.
1626471828

Edited 1626472182
i've tryed it however it for some reason it doesn't creat the aura is there a way to summon say a gif from my library ?   everything else is working the power card fires but the aura isn't created?
I just tested it in my game and it worked just fine. Just to be sure, you installed tokenmod?
yes i do,      i have another question for you,   how do i hide the actual ac of a monster when using power card   ill post a script i have written i just want it to say against AC and not actually say what the as is!power {{  --emote|@{selected|token_name} fires an arrow at @{target|token_name}  --name|crossbow + 1   --leftsub|ranged  --rightsub|100 ft  --attack| [[ [$atk] ?{attack|standard,1d20|advantage,2d20kh1|disadvantage,2d20kl1} + 8 ]] vs @{target|npc_ac}  --??$atk >= @{target|npc_ac} and $atk.base <> 20 ??damage:| [[ [$dmg] 1d10 + 4 ]] pearcing  --??$atk.base == 20 ??Critical Hit|[[ [$critdmg] 2d10 + 8 ]]  --??$atk < @{target|npc_ac} ??You Miss| [[ 1t[taunts] ]]  --??$atk >= @{target|npc_ac} and $atk.base <> 20 ??alterbar1|_target|@{target|token_name} _bar|1 _amount|-[^dmg] _show|all  --??$atk.base == 20 ??alterbar2|_target|@{target|token_name} _bar|1 _amount|-[^critdmg] _show|all }} so everytime i use it it always says attack and shows my roll agains ac 12 or whatever it is,  i want to hide the 12 from the players
Just delete the part that says vs @{target|npc_ac}  !power {{  --emote|@{selected|token_name} fires an arrow at @{target|token_name}  --name|crossbow + 1   --leftsub|ranged  --rightsub|100 ft  --attack| [[ [$atk] ?{attack|standard,1d20|advantage,2d20kh1|disadvantage,2d20kl1} + 8 ]]   --??$atk >= @{target|npc_ac} and $atk.base <> 20 ??damage:| [[ [$dmg] 1d10 + 4 ]] pearcing  --??$atk.base == 20 ??Critical Hit|[[ [$critdmg] 2d10 + 8 ]]  --??$atk < @{target|npc_ac} ??You Miss| [[ 1t[taunts] ]]  --??$atk >= @{target|npc_ac} and $atk.base <> 20 ??alterbar1|_target|@{target|token_name} _bar|1 _amount|-[^dmg] _show|all  --??$atk.base == 20 ??alterbar2|_target|@{target|token_name} _bar|1 _amount|-[^critdmg] _show|all }}
1626659959

Edited 1626661788
huh ok thanks that worked perfectly  and i neticed even if i change the aura on a token to the settings in the script you sent me it changes for a sec then automatically shifts back to .63 ft and color is yellow    i think for some reason it's locked to that setting    any ideas?
i think its the auratint api thats messing with your coding,  is it possible?
I've never used auratint API (or even heard of it). But it sounds likely to be the issue. Rick F. said: i think its the auratint api thats messing with your coding,  is it possible?
1626817703

Edited 1626817720
ya i agree so i am going to modify the spirit weapon to see if i can make that do what i want  ill keep you posted
i almost got it to work but to be honest i have no idea how to code but i have this and it almost works,&nbsp; take a look dor some reason the gif won't activate&nbsp; &nbsp; any thoughts? on("ready",function() { &nbsp; &nbsp; on("chat:message",function(msg){ &nbsp; &nbsp; &nbsp; &nbsp; if(msg.type=="api" &amp;&amp; msg.content.indexOf("!SpiritGuardian")==0 &amp;&amp; playerIsGM(msg.playerid)) &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var selected = msg.selected; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (selected===undefined) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat("API","Please select a character."); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var tok = getObj("graphic",selected[0]._id); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var character = getObj("character",tok.get("represents")); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var playerlist = character.get("controlledby") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; createObj("graphic",{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left:tok.get("left")+0, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; top:tok.get("top"), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height:70, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width:70, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pageid:tok.get("pageid"), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layer:"objects", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; imgsrc:"<a href="https://s3.amazonaws.com/files.d20.io/marketplace/1244988/8KV7iOvkbEwmd9Q63CZOXA/Thumb.png?15920947565" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/1244988/8KV7iOvkbEwmd9Q63CZOXA/Thumb.png?15920947565</a>", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name:tok.get("name") + "'s Spirit Guardian", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; controlledby:playerlist, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aura1_radius:0, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aura1_color:"#ffff00", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; showplayers_aura1:true &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat(tok.get("name"),"I summoned a spirit Guardian."); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spawnFx(tok.get("left")+0,tok.get("top"),"burst-holy",tok.get("pageid")); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }); });