How are item effects represented in the JavaScript?

HighTyrol

Villager
Member
Joined
Jun 8, 2020
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMMV
How are item effects represented in the JavaScript? I have been trying to figure out how to choose which aspects of an item are randomized when using Yanfly's independent items. I have already read through Yanfly's plugin's code and did not see anything there about it. Although, maybe I missed it. Some of the effects that I care about the most are HP and MP recovery and Damage. I am currently reading through the rpg_core.js and have not found anything yet. Although I am only about 1/3 of the way through and by no means understand it all. If anyone could show me where I could find the names used for these properties in the script.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
533
Reaction score
235
First Language
English
Primarily Uses
RMMV
You won't find a definition of an effect in the JavaScript files - they're just a plain object with four fixed keys. (Technically, only the "code" key matters, you could dump anything you want in there if you defined a custom code, as I've done a few times.)

It is documented however - if you open the user manual (Help -> Contents) and scroll down the bottom, there is a "JS Library" section. Expand that, scroll down almost to the bottom, and click on "~ Effect". In general the entries beginning with a "~" describe the format of the database objects, while other entries are the classes defined in the JavaScript files.

In the case of effects, the "code" key is a magic value describing the type of the effect. These magic values are listed in the JavaScript files - search "function Game_Action" in rpg_objects.cpp and you should find the list.
 

HighTyrol

Villager
Member
Joined
Jun 8, 2020
Messages
20
Reaction score
1
First Language
English
Primarily Uses
RMMV
Thank you for your help.
 

Latest Threads

Latest Profile Posts

Yay! Someone did a playthrough of my game. :D


When you thought you'd be finished with the grid, and spend ~8-9 hours on an arrow. How is this more difficult to than player movement?

Still some bugs hiding in there, but it's nearly complete.

I'm having it strictly follow the path a user draws, because there will be booby trap and other similar mechanics where you want to avoid specific cells.
I feel like banging my head against a wall every time I want to find that post that shows all the plugin header codes. Then I think "next time I find it, I'm going to bookmark it". Then I think "wait a minute ... maybe I bookmarked it last time because it took me so long to find it". Check bookmarks, and there it is :)
... a few of my main characters standing around doing nothing lol. I mostly wanted to see them together on screen.

Forum statistics

Threads
107,832
Messages
1,032,478
Members
139,979
Latest member
tsbull
Top