Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:Token Collisions"

From Roll20 Wiki

Jump to: navigation, search
m (update name)
 
(5 intermediate revisions by one user not shown)
Line 1: Line 1:
{{script overview
+
{{revdate}}
 +
 
 +
This is a small library for detecting collisions among moving tokens, even accounting for waypoints during token movement.
 +
{{clear}}{{script overview
 
|name=Vector Math
 
|name=Vector Math
|author={{user profile|46544|Stephen L}}
+
|author=[[Ada Lindberg|Ada L.]]
|version=1.0
+
|version=1.6
|lastmodified=2015-01-21
+
|lastmodified=2020-03-30
 
|code=Token Collisions
 
|code=Token Collisions
 
|dependencies={{api repository link|Vector Math}}
 
|dependencies={{api repository link|Vector Math}}
 
|conflicts=none}}
 
|conflicts=none}}
 
This is a small library for detecting collisions among moving tokens, even accounting for waypoints during token movement.
 
 
 
== Syntax ==
 
== Syntax ==
 
{{syntaxbox top|Example|nocat=true}}
 
{{syntaxbox top|Example|nocat=true}}
Line 17: Line 17:
  
 
== Installation and Configuration ==
 
== Installation and Configuration ==
Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
+
Install from the One-Click menu, or {{repo|Roll20/roll20-api-scripts/tree/master/Token%20Collisions sourcecode}}.
 +
 
 +
Install manually: Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.
  
 
== Script Use ==
 
== Script Use ==
The library's exposed functions are accessed through the TokenCollisions object, created when the script is loaded.  
+
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/wiki page history.
+
See GitHub commit log: https://github.com/Roll20/roll20-api-scripts/commits/master/Token%20Collisions
 +
==See Also==
 +
* [[Token/API]]
 +
 
 +
[[Category:Tokens]]

Latest revision as of 09:13, 23 June 2022

This is a small library for detecting collisions among moving tokens, even accounting for waypoints during token movement.

API ScriptAuthor: Ada L.
Version: 1.6
Last Modified: 2020-03-30
Code: Token Collisions
Dependencies: Vector Math
Conflicts: none

Contents

[edit] Syntax

var collidedBullet = TokenCollisions.getFirstCollision(marisaKirisame, danmakuArray);
var allHitEnemies = TokenCollisions.getCollisions(masterSparkSpell, enemiesArray);

[edit] 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.

[edit] Script Use

The library's exposed functions are accessed through the TokenCollisions-object, created when the script is loaded. See Readme for more details.

[edit] Changelog

See GitHub commit log: https://github.com/Roll20/roll20-api-scripts/commits/master/Token%20Collisions

[edit] See Also