プレイヤーが射程と視線に入ったときにイベントをアクティブにするプラグイン – GALV_EventDetectors.js

タイトル
Have events activate when player gets in range and line of sight.
作者名
ヘルプ
Galv's Event Detectors
----------------------------------------------------------------------------
This is a basic event detection plugin. It can allow events to detect the
player within a certain range and within line of sight.
Line of sight is 180 degrees in the event's front arc. Regions, terrain tags
or events can be set to block line of sight to the player.
Region Id's and terrain tag Id's are set using the plugin settings. To make
an event block line of sight, you need to use a COMMENT inside an event
page that has a text tag as follows:

<block_los>

An event that has an active page with this tag will block line of sight. If
the page is changed to one without the tag, it will not block LOS.

----------------------------------------------------------------------------

----------------------------------------------------------------------------
Conditional Branch SCRIPT
----------------------------------------------------------------------------
You can use the below script call to check if an event can detect the player
at the time the conditional branch is called. (Yes this can be used in a
parallel process event if required)

Galv.DETECT.event(id,dist,los) id = event ID that is a detector
dist = tile distance from player
los = true or false for line of sight

This will return true if the player is in distance range of the event and
if los is true, it will also check if player is in line of sight to it.
----------------------------------------------------------------------------

----------------------------------------------------------------------------
Event command SCRIPT
----------------------------------------------------------------------------
$gameSystem._undetectable = x; x can be true or false. When true
player cannot be detected
----------------------------------------------------------------------------

----------------------------------------------------------------------------
Behaviors
----------------------------------------------------------------------------
Behaviors can be used to set up an event's reaction from within the custom
'Autonomous Movement' settings of the event. The plugin settings has many
behaviors you can set up with the following settings:

moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon

moveTypes can be one of the following:
approach, flee, search, freeze, rand, return
approach - event moves toward player, no pathfinding
flee - event moves away from player
search - event moves toward player's last detected position with
- default rpgmaker pathfinding. The 'search limit' sets
- how far an event will find its way to player or return
freeze - event doesn't move
rand - event moves randomly
return - event saves it's original position and returns to this
position when not detecting the player.
dist = distance in number of tiles from the event that it can detect
los = 0 or 1... 1 to use line of sight or 0 to not for detecting
speed = the change of move speed while detecting (1-6)
freq = the change of move frequency while detecting (1-5)
balloon = the balloon id to show when event detects player

HOW TO USE
To set an event to follow a behavior, you need to use a 'SCRIPT' command
inside of a custom Autonomous Move Route as follows:

this.detector(id);

This will use the chosen Behavior id (from the numbers in the plugin setup).
The 'moveTypeBefore' selection above and the event page's speed and freq
control the event's default movement when not detecting.

See demo for examples
パラメータ
param LOS Blocking Terrain
desc Terrain tag ID's for tiles that block line of sight, separated by commas
default 5,6

param LOS Blocking Regions
desc Region ID's for tiles that block line of sight, separated by commas
default 1,2

param Tile Size
desc The pixel size of the tiles you are using.
Default: 48
default 48

param Search Limit
desc Amount of checks for default pathfinding. Larger might cause lag, smaller might make returning home fail
Default: 12
default 24

param --- Behaviors ---
desc
default
param Behavior 0
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 1
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 2
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 3
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 4
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 5
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 6
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 7
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 8
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 9
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 10
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 11
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 12
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 13
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 14
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 15
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 16
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 17
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 18
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 19
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
param Behavior 20
desc Behavior of event if detecting. (see help file)
moveTypeBefore,moveTypeAfter,dist,los,speed,freq,balloon
default
ライセンス表記
- default rpgmaker pathfinding. The 'search limit' sets

紹介ページ https://galvs-scripts.com/category/rmmv-plugins/mv-event-utility/#post-1785