マップおよびマップキャラクタと相互作用できる発射体を作成するプラグイン – GALV_MapProjectiles.js

タイトル
Create projectiles that can interact with the map and map characters
作者名
ヘルプ
Galv's Map Projectiles
----------------------------------------------------------------------------
This plugin allows you to create projectiles on the map that can interact
with characters and the map.

Projectiles can be created manually in game with a customized script call or
the projectile cusomization can be set up in the Premade plugin settings.
Information on how to do this below.

----------------------------------------------------------------------------
SCRIPT CALLS (in event script or move route script)
----------------------------------------------------------------------------
To create a projectile during the game there is a few ways. The first is to
use one of the following script calls and include the projectile settings:

Galv.PROJ.atTarget(sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size);
Galv.PROJ.dir(sid,dir,s,d,'img',anim,'action',[r],[t],z,pid,size);


sid = start event id or -1 for player or 'm' for mouse pos
tid = target event id or -1 for player or 'm' for mouse pos
dir = direction fired insead of at a target. Can be: 1,2,3,4,6,7,8,9,0
Numbers are numpad directions. 0 for facing direction of target
s = speed - how fast the projectile travels
d = distance - the max number of tiles the projectile will travel
img = graphic to use from /img/pictures/
ANIMATED IMAGES:
The graphic can have parenthesis that contains frames and speed.
imageName(frames,speed)... eg: bullet(8,5)
Have no parenthesis for the projectiles to be 1 frame
action = actions to execute when the projectile hits a player or event.
These actions only affect events with <projEffect> comment
Player and event actions are separated by | symbol
eg. playerAction|eventAction
Actions below:
c(x) run common event x
S(x:t) change switch x to t (on or off)
s(L:t) change self switch L to t (on or off) event only
e erase event - event only
r = list of regions projectile will hit and stop on. Blank = none
t = list of terrains projectile will hit and stop on. Blank = none
z = z value (leave blank to default to 3, same as characters)
2 or less will hit characters "below character" priority
2.1-3.9 will hit characters "same as character" priority
(3 is same as chars. < 3 draws under & > 3 draws over chars)
4+ will hit characters "above character" priority
pid = an identifier number id for the projectile. Left blank it will
default to 1. This is used for events to determine if the
projectile will go through or contact them (more below)
size = the distance from the center of a projectile that will cause
a collision. Leave this blank for collision based on a point

To create projectiles in multiple places with identical setup, you can
instead use the following script calls that will use the 'Premade'
setup projectiles in the plugin settings. Call them using:

Galv.PROJ.quickTar(id); creates projectile using premade id
(using tid as target id)
Galv.PROJ.quickDir(id); creates projectile using premade id
(using tid as direction)

Note: You can add an override sid in these two script calls using:
Galv.PROJ.quickTar(id,overrideId);
Galv.PROJ.quickDir(id,overrideId);

EXAMPLE 1:
Galv.PROJ.dir(9,4,3,6,'bullet0',1,'c(7)|e',[5],[],3,1);
Fires a projectile from event 9
It used Galv.PROJ.dir call so it will fire in direction 4 (left)
It has a speed of 3
It will travel 6 tiles
It will use 'bullet0' graphic from /img/pictures/.
It will play animation 1 on contact.
If it hits the player it will run common event 7.
If it hits an event it will erase it (if event has the <projEffect> tag).
It will collide on region 5
It has no terrain collision
It has a z value of 3 (same as player)
It has an identifier of 1

EXAMPLE 2:
Galv.PROJ.atTarget(-1,2,5,7,'bullet1(8,5)',2,'|s(A:on),[5,6],[6],3,2);
Fires a projectile from the player
It used Galv.PROJ.atTarget call so it will fire at event 2
It has a speed of 5
It will travel 7 tiles
It will use 'bullet1(8,5)' graphic from /img/pictures/.
This image needs to have 8 frames and will animate with speed of 5
It will play animation 2 on contact.
If it hits player it does nothing (it cant anyway as it is from player).
If it hits an event it will turn self switch A on (if <projEffect> tag).
It will collide on regions 5 and 6
It will collide on a tile with terrain tag 6
It has a z value of 3 (same as player)
It has an identifier of 2

EXAMPLE 3:
Galv.PROJ.quickTar(1);
Fires a projectile with setup taken from 'Premade 1' in plugin settings

EXAMPLE 4:
Galv.PROJ.quickTar(1,8);
Fires a projectile with setup taken from 'Premade 1' in plugin settings
but this time, replace the sid with the event id of 8. If done from a
move route, you could use this._eventId in place of the number 8 to get
the current event's id.

EXAMPLE 5:
Galv.PROJ.atTarget(-1,2,5,4,'bulletBlast',12,'|s(A:on),[9],[],3,7,60);
Fires a projectile from the player
It used Galv.PROJ.atTarget call so it will fire at event 2
It has a speed of 5
It will travel 4 tiles
It will use 'bulletBlast' graphic from /img/pictures/.
It will play animation 12 on contact.
If it hits player it does nothing (it cant anyway as it is from player).
If it hits an event it will turn self switch A on (if <projEffect> tag).
It will collide on region 9
It won't collide with any terrain tiles
It has a z value of 3 (same as player)
It has an identifier of 7
It has a size of 60 pixels, so it will hit a wider area.

Other script calls to make stuff happen:

$gamePlayer.projDodge = true/false; if true, projectiles can no
longer hit the player.
$gamePlayer._projEffect = true/false; default is true. If false,
projectile effects do not
activate when player is hit
$gamePlayer._projYoffset = y; change projectile y pos when
firing proj from player.

----------------------------------------------------------------------------
----------------------------------------------------------------------------
EVENT COMMENTS
----------------------------------------------------------------------------
By default, if no comment tag is in the active event page, all projectiles
will collide on the evente if it is at the same z level as them (see above)

<projBlock:true> will block all projectiles
<projBlock:false> will block no projectiles
<projBlock:x,x,x> will NOT block projectiles that have a pid
included in this list.

<projEffect> Must include this comment on an event page if you
want projectile effects to happen when hit. If no
tag exists, Actions will not be activated.

<projEffect:x,x,x> INSTEAD of the above tag, you can use this to only
want projectile actions to activate if projectile
that hits has a pid included in this list.

<projY:x> y offset for where projectiles start from.

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

To get the event id (or -1 for player, or 0 for no target) from inside
a common event called by a projectile hitting a target using script:

Galv.PROJ.ceTargetId()

For example, you could use this in a Control Variables - script and then
in a conditional branch afterward you can do something depending on what
id you get from it. This may not be reliable with multiple common events
running at the same time.
パラメータ
param Tile Size
desc Premade projectile settings to call during game
Default: 48
default 48

param Fade Speed
desc The speed projectiles fade when they reach their max distance.
default 40

param Disable Mouse Move
desc Disables clicking on the map to move/interact with events
default false

param Premade 1
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 2
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 3
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 4
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 5
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 6
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 7
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 8
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 9
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 10
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 11
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 12
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 13
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 14
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 15
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 16
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 17
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 18
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 19
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
param Premade 20
desc Premade projectile settings to call during game
sid,tid,s,d,'img',anim,'action',[r],[t],z,pid,size
default
ライセンス表記

紹介ページ https://galvs-scripts.com/category/rmmv-plugins/mv-on-map/#post-1824