簡単な農業/栽培作物システム – Galv_SimpleCrops.js

タイトル
A simple farming/growing crop system.
作者名
ヘルプ
Galv's Simple Crops
----------------------------------------------------------------------------
This plugin allows the player to plant and grow crops in designated plots
by selecting seeds from their inventory. It's labelled as simple crops
because the gameplay is simple, not because it's simple to set up. You'll
need to use eventing to control how it works.

Creating Plots
--------------
Events can become plots by adding a <crop> tag to the note field and will
enable the player to plant and grow seeds in them.

Creating Seeds
--------------
Items can be set as seeds by adding a <seed> tag to their notes box. This
tag will contain settings that control how the plant will grow (more details
further down).

The Plant Graphic
-----------------
Plant charactersets in /img/characters/ need to be named using the 'Crop
Charset Name' from the plugin settings, plus an imgId number.
eg. if the plugin setting is: !Crops
Your crop characters should be named like:
!Crops0.png, !Crops1.png, !Crops2.png, etc. (!Crops0.png top left character
will be used for empty plot or seeds just planted plot)

Plant charactersets must be set up in a certain way. Each character within
a characterset contains 2 plants, each with 3 growing frames for watered/
unwatered (6 frames total). These use facing directions of the characters,
for example:
Down = 1st plant unwatered
Left = 1st plant watered
Right = 2nd plant unwatered
Up = 2nd plant watered

Character 1's 1st plant in imgId 0, however, is used for an empty plot or
plot that has seeds freshly planted in it. Examine the demo for a better
understanding of this.

Growing
-------
After selecting a grow time, plants will go through 4 stages/images during
their growth.
1. As soon as a seed is planted, it uses the seed planted charset.
2. After 20% grow time has elapsed, it uses the 1st pattern of the plant
3. After 60% grow time has elapsed, it uses the 2nd pattern of the plant
2. When 100% or more has elapsed, it uses the 3rd pattern of the plant
(and is ready to harvest)

Growing can be done based on playtime seconds or based on a variable. This
can be specified in the event you setup to plant a seed (further below).

There is a plugin setting to specify if the crop event is under or same as
player during each stage of growth. A note tag is also available to use to
specify different priorities for each crop seed if required.


Careful if using this with time based growing because you could trap your
player if a crop grows into a priority that will block their movement.

The Plant
---------
The plant itself is just an item you specify in the seed settings which will
be gained upon harvest, returning the plot to empty again.
----------------------------------------------------------------------------

----------------------------------------------------------------------------
NOTE TAGS for ITEMS
----------------------------------------------------------------------------

<seed:imgId,charId,pId,growTime,itemId>

EXPLANATION:
seed = the keyword required. Don't change this.
imgId = the number that will select which crop charset to use.
charId = the id of the character in the charset (1-8)
pId = the plant id to select which plant in the character to use (1-2)
growTime = the amount of seconds passed until plant is able to be harvested
itemId = the item obtained when plant is harvested. Make this 0 if the
plant cannot be harvested at all.

<seedPrio:seed,sprouting,halfGrown,fullGrown>

EXPLANATION:
This is to override the default 'Crop Priority' plugin setting.
It is to control what priority the crop event is during each stage of
growth. 0 = below player, 1 = same as player.
eg.
<seedPrio:0,1,1,1>

----------------------------------------------------------------------------
SCRIPT info
----------------------------------------------------------------------------
eId = event id
iId = item id
vId = variable id
You can replace eId inside a non-parallel event with this._eventId to use
the current event's id.

----------------------------------------------------------------------------
SCRIPT for CONDITIONAL BRANCHES
----------------------------------------------------------------------------

Galv.CROPS.isCrop(eId) Check if event has <crop> note tag

Galv.CROPS.hasSeed(eId) Check if event has a seed planted

Galv.CROPS.isReady(eId) Check if event seed is ready to harvest

Galv.CROPS.isSeed(iId) Check if item has <seed> tag and is a seed

----------------------------------------------------------------------------
SCRIPT calls
----------------------------------------------------------------------------

Galv.CROPS.harvest(eId,v); Harvest an event's crop.
v refers to a variable id to store the
NAME of the ITEM obtained from the crop
as a string to use in messages with \v[x]

Galv.CROPS.remove(eId); Remove the plant from an event.

Galv.CROPS.plant(eId,iId,vId); plant a seed item into an event.
leave vId blank for the crop to grow
based on seconds of game time.
if you use vId it will instead grow
based on the chosen variable id.

Watering crops reduces the grow time by a certain number of days or time
(depending on your plugin settings). They will remain watered for the
watered time in the settings and cannot gain the benefit of being watered
again until the watered time passes.

Galv.CROPS.water(eId,vId); water the crop event starting now
leave vId blank to use game time for the
time the crop was watered.
If you use vId it will instead use the
variable day from the variable id chosen.

Galv.CROPS.waterAll(vId); same as above but applies to all events on
the current map.

----------------------------------------------------------------------------
SCRIPT call in AUTONOMOUS MOVE ROUTE
----------------------------------------------------------------------------

this.updateCrop(); uses move route frequency to control the growing
of crops near the player. This is done so many
timers do not have to be running at the same time

----------------------------------------------------------------------------
SCRIPT call
----------------------------------------------------------------------------

Galv.CROPS.update(); update all crops on the map

----------------------------------------------------------------------------
パラメータ
param Crop Charset Name
desc All crops use charsets named this which will be followed by an imgId selection number.
default !Crops

param Watered Time
desc The number of seconds/varDays a crop remains watered for before drying out and can be watered again
default 60

param Watered Benefit
desc The number of seconds/varDays removed from a crop's grow time when watered.
default 5

param Crop Priority
desc Change priority during growth. 0 under, 1 same as player
empty,seed,sprouting,halfGrown,fullGrown
default 0,0,1,1,1

param Crop Under or Front Fix
desc true or false - use a fix that prioritises crop in front when interacting instead of crop under.
default true

ライセンス表記
Terms of Use
https://galvs-scripts.com/terms-of-use/

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