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

Trick Attacks (Starfinder)

Hi guys! I've scoured the site trying to figure this out and here's what I've discovered: 1) There is no if/then functionality in Roll20 basic.  Cool. 2) Everyone keeps making really REALLY complicated Trick attack codes that I can't even fathom that looks for levels and weapon powers and all kinds of stuff... 3) I haven't coded anything since the turn of the millennium... So this is all really hard... sorry about that.  I can do it... but my programming skill is full of cobwebs and stuff.   4) It's brought up a lot and I'm asking AGAIN... but mostly because I'm just not getting it. So... I'm headed to a specific thing and I think the code here is waaaaay too functional (And lightyears out of my ballpark).  On Ady's (My character) sheet, I figured out how to make a button that does a thing.  That's awesome! She has a trick attack, and I'm trying to figure out how many steps are involved that will actually SAY something in the chat window.   And can I change that?  And how?  Can we just do something like (Yes, I know there are no logical commands, but for the sake of argument, work with me here): "if 20+ (Prompt me as to what the CR is, I'll ask the GM and type it in) < Ady's Acrobatics skill +d20 then say "Ady leaps into action and does  (3d4+4d4) worth of damage and the poor guy is flat footed this round." It can even not say anything if the trick attack doesn't work. I truly don't mind having button 1 say "Trick attack" and button 2 say "Normal attack" and if the trick attack flubs, I can just click 2.  Heck, if I have to, I'll have three buttons, one for the CR/Acrobatics, the other for the attack and a third for the flub, but is there a way to make the first two "silent" so it doesn't read all of that into the Chat?  our problem is that we have 3 operatives in the group and they all trick attack when someone pops into the combat... it's taking a lot of time for each one to go through the motions of trick attacks. Anything to speed that up would be awesome! Also, I'm totally okay with changing the values in the button when she levels up or gets a different weapon.  I don't need all the variables for her level or weapons or anything like that...   Maybe an advanced version later on... but for Saturday's game I just need it to be simple. Thanks! :) 
1598517753
GiGs
Pro
Sheet Author
API Scripter
You've answered your own question here: 1) There is no if/then functionality in Roll20 basic.  Cool. I dont really understand the rest of your question, it seems to be referring to knowledge specific to starfinder (what is a trick attack?), but the above tells that you simply cant do this: I'm trying to figure out how many steps are involved that will actually SAY something in the chat window.   And can I change that?  And how?  Can we just do something like (Yes, I know there are no logical commands, but for the sake of argument, work with me here): "if 20+ (Prompt me as to what the CR is, I'll ask the GM and type it in) < Ady's Acrobatics skill +d20 then say "Ady leaps into action and does  (3d4+4d4) worth of damage and the poor guy is flat footed this round." It can even not say anything if the trick attack doesn't work. You cant have conditional effects. Either the text gets posted to chat every time, or never. There's no way to have it based on chance. Someone might suggest a rollable table to print the message, but you cant include a dice roll in rollable table output so that won't work.  If you give some more specifics of how the system works - remembering that most people reading won't know anything  about the system - we might be able to come up with a kludge that eases the workload a bit.
Fair point. I'm sorry about that.   So, explanation: In Starfinder, certain characters have a "Trick attack". This is a special attack which replaces your normal attack.  You perform a special check (Which is what I'm looking for) and if that succeeds, it deals extra damage plus adds a modifier to the foe. In my characters case, the check is "Acrobatics skill + d20 > 20+ the creatures "Challenge Rating" (Essentially the creatures' level).  If I can do that, then the trick succeeds, I.E. my character bounced around like a monkey and startled the monster and thus dealt bonus damage (And the monster is flat-footed for the round).   There are a lot of fixed numbers in this.  The "20" seems to be fixed, and my character's Acrobatics skill is totally fixed.  Really the only variables are the creature's CR number, which our GM tells us at the beginning of the fight and the d20 roll. So, in the end it all boils down to: d20+(Acrobatics) vs 20+ (Challenge Rating).  Is the first one bigger? Then deal 7d4 damage. Otherwise we don't need to worry about it. (I'll just click on the normal attack button). When I ran a search, I got a lot of really cool and awesome responses here in the forum for this very specific thing, but they had all kinds of options in it which, though totes amazing, that just made it too hard for me to grasp the code enough to edit.  It was things like (Check character's name) + (Check Character's level) + (Find the creature on the board) + (Add the creatures challenge rating from that template) + (Something about the floor) + (Give the player the choice to choose between acrobatics, bluff and stealth skills) + (Ask for their grandmothers' social security number) + 2d6 - 2d8 + 3d5 - 234 + (the date you got married).... You get the idea... I could see that there were a TON of options in the code.... And since that has to be in code, it looks like (((({{{{[[[[[2d6+{}[][][GSS#+]]] Beep +(Married)+ (Orange Juice)- 234}}}}]]]]))) And I can't tell what parts I can remove and what parts I can't... I know just enough about coding to sort of see what I need to do... but I haven't coded in a long time, so it's murky... much like the Oracle said about my future in programming... So my thought was if I simplified the question and took out all of the options... I just need to figure out how to take Ady's skill (22) and add 1d20 and check to see if it's greater than 20 + whatever the number is from the GM (I'll type it in). If so, roll the attack of the gun plus the trick attack (7d4) and say something clever.  If not, it's cool, the system can just do nothing. I'll just click on my normal attack button.   For the most part, during the game, we have three characters that can do this, so the GM is used to saying "You see a huge monster... its CR is 9" because he knows we are going to all trick attack it. So all I need is a prompt asking what the GM told us the CR is and then the math can go happily about its mathy business. I figured out the prompt part ( ?{Target CR|0}+20 ) and I figured out the other part ( d20+@{Acrobatics} ), I am even willing to let that be a whole number ( d20+22 ) but I just don't know how to pull off the next step. That's where the code gets weird on everyone's example. I know just putting "?{Target CR|0}+20 < d20+22, "Ady jumps into action and does " 7d4 " worth of damage, and the target is flat-footed!",null." won't work (It doesn't even respond when I click the attack button on my character sheet), so I need one more step here.  I see code for other things here that uses "<" (Someone else posted a D&D Attack that was "[[{{1d20+?{Attack|0}}>?{AC|10}}*2d8]]"  so I know that logical test can be used... I just don't know the actual syntax for that phrase and I mangled the one above so badly enough trying to modify it that Roll20 just stared at me like I was an alien...  I also have no idea the syntax for printing to the box so I can write clever lines about how awesome my character is...  I mean... that's important...just sayin'.... So...I just tried something else:  I added an Attack on my character sheet, and named it "Trick Attack".  In the "Attack Roll" box, I put  " +16>{?{CR|0}+20} " (its 16 because it always adds my BAB, so I have to subtract my BAB from the Acrobatics 22), and then I put "7d4" in the damage roll box... It did prompt me for a CR, which is awesome!  but then it always gives me a damage (even when I give 140 as a CR... which should be an absolute "fail")... and it gives me weird numbers... like "35"... which doesn't actually tell me if the trick worked or not.  So I'm getting there... but I can tell it'll take days to get this right if I don't ask folks who have a lot more skill in this for help. I'm hoping this is all making some sense. I am having cat trouble (Nothing bad, our kitten is clashing with the old cat... on my forehead... all night...) and so I'm running on low sleep and my mind is not at its absolute best...
1598561922
GiGs
Pro
Sheet Author
API Scripter
If you post one of the complex tricks you found, tell us what it does and what you would prefer it to do (the trimmed down version), we can probably do that very easily. It's very hard giving code corrections without the actual code. We also need actual attribute names, as used on the character sheet.
Um... okay... though I would be totally confused by this, but I can totally see it being useful for programmer folks: @{selected|whisper_state}&{template:sf_attack}{{name=@{selected|character_name}}}   {{characterid=@{selected|character_id}}} {{title=Trick Attack}}   {{r1name=Success if CR<}} {{r1= [[?{Skill|Bluff,   d20+@{selected|bluff}-20]]|Intmiidate,d20+@{selected|intimidate}-20]]|Stealth,d20+@{selected|Stealth}   -20]]|SPEC1,d20+@{selected|SPEC1}-20]]}} {{damage1type=Additional damage}}   {{damage1=   [[[[[[{@{selected|class_\X\_level},5}>5]]+floor({@{selected|class_\X\_level}-3,0}kh1/2)]]d[[4*{@{selected|class_\X\_level},3}>3)]]]]}}   {{rightbanner= Operative talent}} {{notes=target is flat-footed if   successful}} {{buttons0=[Attack with   @{selected|repeating_\attack_id\_name}](~selected|repeating_\attack_id\_roll)}}   {{buttons1=[Attack with @{selected|repeating_\attack_id\_name}](~selected|repeating_\attack_id\_roll)}} That's the most complicated one... @{character_name} If  **Stealth**[[d20+@{stealth}-20+1]] equals or exceeds ``target CR`` add [[[[ [[{@{class_1_level},5}>5]]+floor({@{class_1_level}-3,0}kh1/2)]]d[[4*({@{class_1_level},3}>3)]]]]dmg to the attack, and the target is flat footed vs. this attack.   The target is then either Flatfooted or Off-Target until @{character_name}'s next turn. I'm not sure that one works... I think that was the question.... but I was taking notes really fast...  So... the attribute I'm going for is "Acrobatics" (It's a 22), My character is "Ady",   I just need a prompt for the CR.   though... if someone could walk me through the code a little as well... my goal is to ultimately program it myself (And not bother folks :) ) 
1598570037
GiGs
Pro
Sheet Author
API Scripter
There's some very suspect code in that roll macro. Can you post a link to the place you found it. I suspect there are instructions there on things you need to replace within it to make it work.
1598570109

Edited 1598570318
GiGs
Pro
Sheet Author
API Scripter
By the way, I have already said this, but you won't be able to do this:  If  **Stealth**[[d20+@{stealth}-20+1]] equals or exceeds ``target CR`` add roll20 macros do not support if statements or conditionals, so this will not be possible. At all. Though if that entire section is to be printed out as a note, it would work.
1598577415

Edited 1598577968
Oosh
Sheet Author
API Scripter
This is a super hacky solution in the default template, I'm not sure how you would apply it to the SF templates. But this will only display the Trick Attack damage and condition if the check is successful: &{template:default} {{name=Trick Attack Test}} {{[[[{1d20+?{Stealth|22}-21}>?{Target CR|8}]]](#)=[[[[7d4]]d1]] Trick damage, target is flat footed}} {{[0](#)=[@{ady|repeating_attack_$0_name}](~ady|repeating_attack_$0_roll), mouse over for trick attack check:$[[0]]}} There's a button link there to the first attack you have listed on your sheet (If Ady is the correct name). Change the $0 to $1, $2, or whatever number weapon you wish to use for a normal attack, starting from $0. The damage roll I changed from [[7d4]] to [[ [[7d4]]d1 ]] - this stops a bunch of 3d dice rolling when they're not needed. If you have 3d dice turned off you can change it back to the usual [[7d4]]. I'm not sure if the rest of the math is right.
I would just make three macro buttons. The first would roll your trick attack. Just ask the gm if it succeeds. If yes click the second button, which is your weapon attack with the trick damage added. If the answer is no click the macro button for your regular attack. If feel it is unnecessarily complicated to try to automate a simple yes or no. Unless you suspect the gm of cheating.
"Unless you suspect the gm of cheating."  Oh heavens no. :) This is a 5 year old IRL campaign with our 25- year-old RPG group (Gads, some of our campaigns are old enough to drink... o.O).  We all just moved to Roll20 because of Covid (Though we are loving the system and may stay even AFTER Covid is over).  It IS allowing us to rotate GMing, which is a great relief, since I've been in the GM seat since 2016 on this campaign... (Which is why I'm just NOW setting up my character). Amy, that's what I have in place at the moment, but there are three Operatives in the game and they all do trick attacks and we have a wizard character who is notorious for throwing bombs and stuff.  During a fight, the chat window starts to move at, like, Mach 3 with all of our messages, so I'm just trying to minimize the number of messages in the window, because it was becoming cumbersome for the GM to scroll back through the log in the game.  There are currently 8 players in the game (We took on some stragglers because folks are isolated and lonely).  This was totally an expediency thing. But if that's what we have to do, that's what we have to do.  I'm just trying to streamline here :) Also, since I do kinda like this format, I was thinking of learning how to program in it. So the real mission I had here was to deconstruct the coding so I could code the NEXT problem I run into (Instead of making you lovely folks do it for me... though I certainly appreciate the help! :D ).  The way I have always learned best was to take something I'm interested in and deconstruct it and learn from that.  Hence why I'm intentionally trying to figure this problem out. GIGs: I hear your frustration with me continuing to harp on the "conditional" topic.  My goal was to have a single weapon button on my character sheet that fires off this Trick Attack (Like making an "Ability" called "Trick Attack-Acrobatics" That I could just tap to spit out the numbers.  I was going to have one of these for each skill set (The trick attack for Acrobatics, the one for Bluff, the one for Stealth, etc), so I could choose which attack Ady did and how she executed it in story ("Ady sneaks up behind the bad guy, startling him", "Ady jumps around the hallway, startling him", "Ady says "Look over there!" and distracts the bad guy", etc)  which was kinda why I wanted to learn how to add the dialogue boxes as well.   I totally understand that there is no way to do an if/then conditional.  However, there is a "<" and that is kinda like an if/then conditional that I could use in place of it.  My only thought here was to try to see if I couldn't use THAT.  If we can't, we can't and that's totally cool.  Oosh: That's closer to what I'm looking for I think (thank you :D)... but it has a lot of code that I'm not sure what it does, so it's hard for me to deconstruct.  Can we simplify that a little so I can understand it (I could make Excel and Access dance 20 years ago, and I used to speak HTML and Java back in the day, so I'm not a complete noob... but I'm also not a real programmer)? I want you all to know that I appreciate you helping me out on this :) I'm not trying to be frustrating, certainly. I think this is a great system and I'm looking forward to seeing what it can do. :D