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

Shapeshift macro for classic world of darkness werewolf the apocalypse

can someone please help me get this macro where i need i...... !power {{ --name| @{selected|token_name} Attempts to shift forms to ?{Select form for description box|Homid,|Glabro,|Crinos,|Hispo,|Lupus,} --soundfx|_audio,play,nomenu|Crinos Sound --Successes:|[[(@{selected|dexterity_base} + @{selected|primal_urge} + ?{Roll Modifier|0})d10>?{Difficulty|6}f1?{Roll with Specialty?|Yes,!|No, |}  ]] }} !setattr --charid @{selected|character_id} --mod --silent --rage_used| ?{Rage Point optional} !setattr --sel --current_form|?{Select form for character sheet|Homid,1|Glabro,2|Crinos,3|Hispo,4|Lupus,5} as it is written it changes the form on the character sheet. That's all good and well, What i am trying to do is have the macro so that the form change will only take place if the roll succeeds with 1 or more successes. I don't know how to do those types of rolls and i was trying to cheat it with chat gpt but that was not working either. Im using chat set attribute and powercards. any help would be greatly appreciated.
1680915063
timmaugh
Forum Champion
API Scripter
You can handle the conditional with APILogic, and share the results between command lines by batching it up with ZeroFrame. I'm not at my computer at the moment but I will try to post an example asap.
much appreciated
1680975005
timmaugh
Forum Champion
API Scripter
OK, this should work. I tested with approximations of your code since I didn't have your particular setup, but the functionality of batching the lines and conditionally evaluating them should all be rock solid. This requires ZeroFrame and APILogic in addition to ChatSetAttr and PowerCards. Also, it requires ZeroFrame v1.1.1 which I just released to my GitHub repo , and which is queued in the one-click merge for this week (so if you could wait until sometime Tuesday, it should be the current version. Also of note, I set the threshold for the number of successes at greater than 2. You'll see that in the IF conditional block. If that isn't right, you can adjust as you need to. Or, if I haven't understood what you're looking for and you can't see how to get there from here, let me know. In this version, the PowerCard should run regardless, then the ChatSetAttr calls only fire if the conditional test passes: !{{   !power ({)     --name| @{selected|token_name} Attempts to shift forms to ?{Select form for description box|Homid,|Glabro,|Crinos,|Hispo,|Lupus,}     --soundfx|_audio,play,nomenu|Crinos Sound     --Successes:|[[(@{selected|dexterity_base} + @{selected|primal_urge} + ?{Roll Modifier|0})d10>?{Difficulty|6}f1?{Roll with Specialty?|Yes,!|No, |} ]]   (})   {&if $[[0]].value > 2}     !setattr --charid @{selected|character_id} --mod --silent --rage_used| ?{Rage Point optional}     !setattr --sel --current_form|?{Select form for character sheet|Homid,1|Glabro,2|Crinos,3|Hispo,4|Lupus,5}   {&end} }}
timmaugh said: OK, this should work. I tested with approximations of your code since I didn't have your particular setup, but the functionality of batching the lines and conditionally evaluating them should all be rock solid. This requires ZeroFrame and APILogic in addition to ChatSetAttr and PowerCards. Also, it requires ZeroFrame v1.1.1 which I just released to my GitHub repo , and which is queued in the one-click merge for this week (so if you could wait until sometime Tuesday, it should be the current version. Also of note, I set the threshold for the number of successes at greater than 2. You'll see that in the IF conditional block. If that isn't right, you can adjust as you need to. Or, if I haven't understood what you're looking for and you can't see how to get there from here, let me know. In this version, the PowerCard should run regardless, then the ChatSetAttr calls only fire if the conditional test passes: !{{   !power ({)     --name| @{selected|token_name} Attempts to shift forms to ?{Select form for description box|Homid,|Glabro,|Crinos,|Hispo,|Lupus,}     --soundfx|_audio,play,nomenu|Crinos Sound     --Successes:|[[(@{selected|dexterity_base} + @{selected|primal_urge} + ?{Roll Modifier|0})d10>?{Difficulty|6}f1?{Roll with Specialty?|Yes,!|No, |} ]]   (})   {&if $[[0]].value > 2}     !setattr --charid @{selected|character_id} --mod --silent --rage_used| ?{Rage Point optional}     !setattr --sel --current_form|?{Select form for character sheet|Homid,1|Glabro,2|Crinos,3|Hispo,4|Lupus,5}   {&end} }} hey thanks for the reply. I want to make sure i understand, will this not work properly without v1.1.1? I ran it with the current version of zeroframe and it didnt work properly so thats what im assuming. In that case if i want to get it from your gethub, i see it in two boxes so which should i copy and paste or does it matter? Thanks again for the help.
Also to provide further information, I am using ZeroFrame and APILogic in addition to ChatSetAttr and PowerCards. Using the current version of ZeroFrame and I am using the character sheet found here WOD Unified Character Sheet
1680984327
timmaugh
Forum Champion
API Scripter
Right... Until the new version is merged into the 1-click, you'll have to get it from my repo. The current released version will not work with this. (It would work with some modifications to the command line, but this command line is cleaner, so get the new version.) As for the file you want, at the link I shared you'll see a ZeroFrame.js right in that directory. Click it, then click the "Raw" button once it loads. Copy everything to your clipboard. Delete ZeroFrame from your game, then add a new script, change the name, and paste into the script panel. If this works, then I'd obviously suggest going back to the 1-click version sometime after Tuesday.
timmaugh said: Right... Until the new version is merged into the 1-click, you'll have to get it from my repo. The current released version will not work with this. (It would work with some modifications to the command line, but this command line is cleaner, so get the new version.) As for the file you want, at the link I shared you'll see a ZeroFrame.js right in that directory. Click it, then click the "Raw" button once it loads. Copy everything to your clipboard. Delete ZeroFrame from your game, then add a new script, change the name, and paste into the script panel. If this works, then I'd obviously suggest going back to the 1-click version sometime after Tuesday. So Technically its kinda working, (I installed from your github). in once instance it changed the form then i raised the difficulty so the roll would likely fail and it did not change the form but for both rolls the power card output looked like this:  so im not able to see the results of the roll and in the previous version that i originally posted the powercard would look like this where i could scroll over the result of the roll and see what each dice rolled. I hope I'm explaining that clearly: 
1681000119
timmaugh
Forum Champion
API Scripter
OK, that's strange. That roll (with the hover) should have already been working. Let me make sure that I didn't break it somehow. Also, regarding the different look of the PowerCard output... do you have certain parameters associated with you as a player? If so, then when ZeroFrame issues the PowerCards command, it won't recognize it as coming from you because that's a script sending a script message. To get around that, you can install SelectManager and configure it to give back the who and playerid properties: !smconfig +who +playerid SelectManager basically gives back tokens (and these other properties) to a message if the message came from a script. In the case of a script launching a message (like ZeroFrame launching the PowerCards message), there are no selected tokens and the who and playerid values are 'api'. SelectManager gives them back at metascript speed, so they are there by the time the receiving script (PowerCards in this case) sees the message. But as for the roll, I'll check it out and post back.
timmaugh said: OK, that's strange. That roll (with the hover) should have already been working. Let me make sure that I didn't break it somehow. Also, regarding the different look of the PowerCard output... do you have certain parameters associated with you as a player? If so, then when ZeroFrame issues the PowerCards command, it won't recognize it as coming from you because that's a script sending a script message. To get around that, you can install SelectManager and configure it to give back the who and playerid properties: !smconfig +who +playerid SelectManager basically gives back tokens (and these other properties) to a message if the message came from a script. In the case of a script launching a message (like ZeroFrame launching the PowerCards message), there are no selected tokens and the who and playerid values are 'api'. SelectManager gives them back at metascript speed, so they are there by the time the receiving script (PowerCards in this case) sees the message. But as for the roll, I'll check it out and post back. Im not entirley sure what you mean about me having special parameters other than me being the GM. Im not super concerned if the power card looks different (im assuming you meant the color) so long as the functionality is intact. And thanks again for the help
1681127089
timmaugh
Forum Champion
API Scripter
I only wondered if PowerCards stored a personalized config of options anywhere? Or if it is pulling your player color (from your avatar) for the color of the title bar...? I'm not super familiar with PowerCards to know if it does these things, but either of those would explain the difference and would be remedied by SelectManager. As for the roll issue, I am working on it. =D
1681132111
timmaugh
Forum Champion
API Scripter
OK, yeah, I had two major errors in the script, so I'm glad you were able to catch this problem and get my attention to them. I'm keeping the version at 1.1.1 as it's already in the pipeline to be included in the 1-click, but if you need it immediately you can get it from my repo , as before. Otherwise, it will be in the merge (probably tomorrow). Let me know if you still have issues, or if the suggested macro doesn't work!
timmaugh said: OK, yeah, I had two major errors in the script, so I'm glad you were able to catch this problem and get my attention to them. I'm keeping the version at 1.1.1 as it's already in the pipeline to be included in the 1-click, but if you need it immediately you can get it from my repo , as before. Otherwise, it will be in the merge (probably tomorrow). Let me know if you still have issues, or if the suggested macro doesn't work! There is success! However, now the sound effect doesn't play. Previously there was a sound effect that would play  from --soundfx|_audio,play,nomenu|Crinos Sound but now it doesnt seem to play at all regardless of success or failure. That uses Roll20 AM . What i was asking help for works though. I changed the success required from 2 to one in the macro because only needed it to be one and the macro functions as needed. I still need to figure out the color issue. Do i need to install select manager and use !smconfig +who +playerid as part of the macro or just enter that into chat?
Update, select manager did indeed correct the issue with the color so thats out of the way. No its just getting the sound file to play again. As on this topic (and this isn't a neccessity as you have already done wonders for me already) but is it possible if you are able to get the sound file playing again to have it also only function on a successful roll? If not no big deal but it would be nice to have it playing again. Thanks again so much!!
Update: Found another issue. So in this game line the rolls use botches, meaning that if you roll a one it subtracts a success from the total number of successes. I made a test roll and from rolling 5 dice at a difficulty 6 the results where 3,8,4,3,1. The total number of successes would be zero and the the roll would be a failure but the macro still triggered the form change Im assuming because it rolled an 8 which would be a success (keep in mind i did change the number of successes needed from 2 to 1) but it doesnt seem to be going off the final number of success after calculating botches. Any remedy for this. And if im pestering you, i Apologize. Ive written thousands of macros in powercards but conditionals and stuff like that are just beyond my knowledge. Thanks again.
Update: Im gonna add this last update and leave it alone for the day. After doing some more test rolls here is something that happened. On two consecutive rolls I changed to difficulty needed for success to 9. On the first roll the results where 10,10,1,9,5 and this would be a total of 2 successes after subtracting the botch from the total but it did not trigger the form change on this roll. The next roll was the same difficulty (9) and the results where 4,9,8,4,8 and would be a total of 1 success but this also did not trigger the change. So im not sure where the inconsistency is coming in... Once again thank you for your help.
1681160703
timmaugh
Forum Champion
API Scripter
Hey, Reuben... sounds like we're making progress. Regarding SelectManager, what you need out of it is pretty passive. You need it installed (sounds like you have that), and then you need to run the command line I shared -- and you only have to run it once to set the configuration: !smconfig +who +playerid As for why Roll20AM isn't firing off of that command, I'm not sure. Should other players in the game hear it, too, or just the player controlling the shifting character? And does it still not function after running the above SelectManager command? Lastly, regarding accounting for the botches in your roll... we'll need to get Plugger (another metascript) to reference the "botch" dice. Where you want to get the dice by value from the first roll that occurs in your message, that would look like this: {&eval}getDiceByVal($[[0]] 1 all count){&/eval} Then, to include that in a further calculation for the final value of successes, you'd do something like: [\][\]$[[0]] -  {&eval}getDiceByVal($[[0]] 1 all count){&/eval} \]\] And, once we do that, we'll have to change the IF conditional to look at this new roll (the $[[1]] roll), and since the $[[1]] roll is deferred one cycle (we let the Plugger EVAL block run in the first loop, then we expose the roll in the second loop), we need to similarly slow down the IF conditional by once cycle. I'm not familiar with the PowerCards syntax, but if you can just add lines to the output by including them after another double-hyphen, the whole thing would look like: !{{   !power ({)     --name| @{selected|token_name} Attempts to shift forms to ?{Select form for description box|Homid,|Glabro,|Crinos,|Hispo,|Lupus,}     --soundfx|_audio,play,nomenu|Crinos Sound     --Successes:|[[(@{selected|dexterity_base} + @{selected|primal_urge} + ?{Roll Modifier|0})d10>?{Difficulty|6}f1?{Roll with Specialty?|Yes,!|No, |} ]]     --Botches: {&eval}getDiceByVal($[[0]] 1 all count){&/eval}     --Final Result: [\][\]$[[0]] -  {&eval}getDiceByVal($[[0]] 1 all count){&/eval} \]\]   (})   {\&if $[[1]].value > 2}     !setattr --charid @{selected|character_id} --mod --silent --rage_used| ?{Rage Point optional}     !setattr --sel --current_form|?{Select form for character sheet|Homid,1|Glabro,2|Crinos,3|Hispo,4|Lupus,5}   {\&end} }}
timmaugh said: Hey, Reuben... sounds like we're making progress. Regarding SelectManager, what you need out of it is pretty passive. You need it installed (sounds like you have that), and then you need to run the command line I shared -- and you only have to run it once to set the configuration: !smconfig +who +playerid As for why Roll20AM isn't firing off of that command, I'm not sure. Should other players in the game hear it, too, or just the player controlling the shifting character? And does it still not function after running the above SelectManager command? Lastly, regarding accounting for the botches in your roll... we'll need to get Plugger (another metascript) to reference the "botch" dice. Where you want to get the dice by value from the first roll that occurs in your message, that would look like this: {&eval}getDiceByVal($[[0]] 1 all count){&/eval} Then, to include that in a further calculation for the final value of successes, you'd do something like: [\][\]$[[0]] -  {&eval}getDiceByVal($[[0]] 1 all count){&/eval} \]\] And, once we do that, we'll have to change the IF conditional to look at this new roll (the $[[1]] roll), and since the $[[1]] roll is deferred one cycle (we let the Plugger EVAL block run in the first loop, then we expose the roll in the second loop), we need to similarly slow down the IF conditional by once cycle. I'm not familiar with the PowerCards syntax, but if you can just add lines to the output by including them after another double-hyphen, the whole thing would look like: !{{   !power ({)     --name| @{selected|token_name} Attempts to shift forms to ?{Select form for description box|Homid,|Glabro,|Crinos,|Hispo,|Lupus,}     --soundfx|_audio,play,nomenu|Crinos Sound     --Successes:|[[(@{selected|dexterity_base} + @{selected|primal_urge} + ?{Roll Modifier|0})d10>?{Difficulty|6}f1?{Roll with Specialty?|Yes,!|No, |} ]]     --Botches: {&eval}getDiceByVal($[[0]] 1 all count){&/eval}     --Final Result: [\][\]$[[0]] -  {&eval}getDiceByVal($[[0]] 1 all count){&/eval} \]\]   (})   {\&if $[[1]].value > 2}     !setattr --charid @{selected|character_id} --mod --silent --rage_used| ?{Rage Point optional}     !setattr --sel --current_form|?{Select form for character sheet|Homid,1|Glabro,2|Crinos,3|Hispo,4|Lupus,5}   {\&end} }} The sound file should be playing so everyone can hear it. Got the issue resolved with select manager and the card color so its just getting the botches counted. After running a couple of test rolls here are the results In the first roll rolled 7,4,4,6,7 at difficulty 6 getting 3 successes. The Final Result said 2 (i dont know what thats doing). It triggered the change as it should. In the second roll it rolled 9,7,6,9,2 but i raised the difficulty to 9 trying to get it to fail. It got 2 successes and should have triggered the change with that roll but it showed Final Result of -1 (again im not sure what thats doing) and it DID NOT trigger the change. Still there is the issue with the sound file which still doesnt play after using select manager. Thanks again for your help. This dice rolling system for this game line is much for complex than games like D&D and ive seen that script author's have issues getting all the mechanics working correctly so thanks for your efforts.
I should also note that i have made test rolls where there were no botches rolled and even though the rolled succeeded it did not trigger the change and also the opposite  has happened where again no botches were rolled but the roll still failed yet it did trigger the change so there is some inconsistency happening and i cant see a pattern to it to identify why
1681173785
timmaugh
Forum Champion
API Scripter
Hmm... If you want to drop me an invite/promote me I can try to get it sorted. I'm sure it's just something we're overlooking.
timmaugh said: Hmm... If you want to drop me an invite/promote me I can try to get it sorted. I'm sure it's just something we're overlooking. Done, I'll check back to see when youve joined and promote you