距離計算 – Dahlys_DistanceCalculator_AltimitMovement.js

タイトル
Distance Calculator
作者名
ヘルプ
==============================================================================
Distance Calculator for Altimit Movement
==============================================================================

Characters:
Player = -1
Player + followers = -2
Event = eventId

Calculate Distance between 2 characters:
- Script call: Dahlys.distCalc.distance(char1, char2)
- e.g.
Dahlys.distCalc.distance(-1, 1) calculates distance in pixels between the
Player and Event 1.
Dahlys.distCalc.distance(2, -2) calculates the distances in pixels between
Event 2 and the Player + Followers and returns an array
containing all the distances.

Calculate Angle between 2 characters:
- Script call: Dahlys.distCalc.angleBtwChars(char1, char2)
- e.g.
Dahlys.distCalc.angleBtwChars(-1, 1) calculates the angle of Event 1
relative to the Player's line of sight.

Can Char1 see Char2:
- Script call: Dahlys.distCalc.canSee(char1, char2, dist, aov)
- dist and aov are optional and the plugin parameters Default View Distance
and Angle of View will be used if they are left blank.
- Char1 will not be able to see Char2 if blocked by: 1) tiles with Blocked
Terrain Tags, 2) tiles with Blocked Region Ids, 3) other characters
- Player can see through followers but event vision can be blocked by
followers. Using char2 = -2 to check if Event char1 can see either the
Player or any Follower.
- e.g.
Dahlys.distCalc.canSee(-1, 1) is true if the Player can see Event 1 at
the default distance and angle of view.
Dahlys.distCalc.canSee(1, -2) is true if Event 1 can see the Player or any
of the Followers at the default distance and angle of view.
Dahlys.distCalc.canSee(-1, 1, 100, 360) is true if the Player can see Event
1 at a radius of 100 pixels (360 degrees).
パラメータ
param Angle of View
desc Character angle of view in degrees
default 120

param Default View Distance
desc Character default view distance in pixels
default 300

param Blocked Terrain Tags
desc Terrain tags that character cannot see through. Separate tags with a space.

param Blocked Region Ids
desc Region Ids that character cannot see through. Separate tags with a space.


ライセンス表記

紹介ページ https://github.com/dahlys/rpgmaker/blob/master/Dahlys_DistanceCalculator_AltimitMovement.js