Difference between revisions of "Script:Token Collisions"
From Roll20 Wiki
Andreas J. (Talk | contribs) m |
Andreas J. (Talk | contribs) m |
||
Line 22: | Line 22: | ||
== Script Use == | == Script Use == | ||
− | The library's exposed functions are accessed through the TokenCollisions object, created when the script is loaded. See {{repo|Roll20/roll20-api-scripts/tree/master/Token%20Collisions Readme}} for more details. | + | The library's exposed functions are accessed through the <code>TokenCollisions</code>-object, created when the script is loaded. See {{repo|Roll20/roll20-api-scripts/tree/master/Token%20Collisions Readme}} for more details. |
== Changelog == | == Changelog == | ||
− | See GitHub commit log/ | + | See GitHub commit log: https://github.com/Roll20/roll20-api-scripts/commits/master/Token%20Collisions |
+ | ==See Also== | ||
+ | * [[Token/API]] | ||
+ | |||
+ | [[Category:Tokens]] |
Revision as of 13:33, 4 January 2022
Page Updated: 2022-01-04 |
This is a small library for detecting collisions among moving tokens, even accounting for waypoints during token movement.
Version: 1.6
Last Modified: 2020-03-30
Code: Token Collisions
Dependencies: Vector Math
Conflicts: none
Contents |
Syntax
var collidedBullet = TokenCollisions.getFirstCollision(marisaKirisame, danmakuArray);
var allHitEnemies = TokenCollisions.getCollisions(masterSparkSpell, enemiesArray);
Installation and Configuration
Install from the One-Click menu, or sourcecode.
Install manually: Copy the script's code, available from the menu on the right and stored at Roll20's API GitHub Repository. Paste the code into a new script in your campaign's API Script Editor. Save the new script and it will be available inside your campaign.
Script Use
The library's exposed functions are accessed through the TokenCollisions
-object, created when the script is loaded. See Readme for more details.
Changelog
See GitHub commit log: https://github.com/Roll20/roll20-api-scripts/commits/master/Token%20Collisions