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

Is there an API Script / Token Mod action that does THIS? Re: Spider-Man

I'm running a Marvel game in June and I am looking for a script that allows the player running Spider-Man to web a target and pull them closer to Spider-Man's token. It could double as a tractor beam, telekinetic grab or eldritch grasp, I'd think? Right now, this is the closest thing I have but it only works in a straight line.  !token-mod {{ --move =90|?{Where|Left,-|Right,+}?{Areas|1|2|3|4|5|6|7|8|9|10}u}} --ids  @{target|token_id} But, I am looking for something that can pull a token from anywhere on the map and make it adjacent to Spider-Man's token.
If you are ok with a ScriptCards option, I have one that does that.  !scriptcard {{ --#title|Get Over Here! --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:t-name] says GET OVER HERE! --&leftDiff|[= [*S:t-left] - [*T:t-left]] --&topDiff|[= [*S:t-top] - [*T:t-top]] --&newLeft|[*T:t-left] --&newTop|[*T:t-top] --?[&leftDiff] -eq 0|TopCalc --?[&leftDiff] -gt 0|&newLeft;[= [*S:t-left] - 70]|&newLeft;[= [*S:t-left] + 70] --:TopCalc| --?[&topDiff] -eq 0|MoveTarget --?[&topDiff] -gt 0|&newTop;[= [*S:t-top] - 70]|&newTop;[= [*S:t-top] + 70] --:MoveTarget| --!t:[*T:t-id]|left:[&newLeft]|top:[&newTop] }} It does assume a default grid page setup and the tokens being 1 square in size. If you need it for different size tokens or different page configurations (ie squares not 70 pixels in size), let me know and that can be adjusted.
Joshua N.  This is AWESOME! Dare I say Spider-riffic!  Our tokens are 140 h x 70 w, so if you don't mind making the adjustment, that would be deeply appreciated. 
But this does exactly what I need it to do; thank you 
Here is an updated version that should work with different size tokens. !scriptcard {{ --#title|Get Over Here! --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --#emoteText|[*S:t-name] says GET OVER HERE! --&leftDiff|[= [*S:t-left] - [*T:t-left]] --&topDiff|[= [*S:t-top] - [*T:t-top]] --=absLeft|[&leftDiff] {ABS} --=absTop|[&topDiff] {ABS} --~MaxHeight|math;max;[*S:t-height];[*T:t-height] --~MaxWidth|math;max;[*S:t-width];[*T:t-width] --&LeftChange|[= [*S:t-width] + [*T:t-width] / 2] --&TopChange|[= [*S:t-height] + [*T:t-height] / 2] --&newLeft|[*T:t-left] --&newTop|[*T:t-top] --?[&leftDiff] -eq 0 -or [$MaxWidth] -gt [$absLeft]|TopCalc --?[&leftDiff] -gt 0|&newLeft;[= [*S:t-left] - [&LeftChange]]|&newLeft;[= [*S:t-left] + [&LeftChange]] --:TopCalc| --?[&topDiff] -eq 0 -or [$MaxHeight] -gt [$absTop]|MoveTarget --?[&topDiff] -gt 0|&newTop;[= [*S:t-top] - [&TopChange]]|&newTop;[= [*S:t-top] + [&TopChange]] --:MoveTarget| --!t:[*T:t-id]|left:[&newLeft]|top:[&newTop] }} Let me know if you have any questions or issues but hopefully it does what you want.
Oh this is wonderful! Thank you!