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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

My dynamic weather system grows... now with cloud cover influenced by wind speed! (4x playback) (Not final cloud image/map)
Wrote a plugin today that allows you to assign BGM, Battlebacks, and even Battle Entry SE's on a per-troop basis. Introducing a random encounter with a high-pitched Chicken Squeal is worth it all by itself.
Stream will be live shortly with some game development! Feel free to drop by!
Asphodelethe wrote on skybluehair's profile.
Hi! I loe your desert NPCs for adding some variety. I've used them in a free game (The Snow Elf on Itch.io) and I'd love to use them in the new game I'm working on, which I hope to release commercially. I'd love your permission if I could have it!


So I figured out how to put words and pictures in the screen transition. It even wipes away from both the top and bottom. The possibilities are endless! :LZSexcite: I'm going to devise secret messages now for them because I'm a terrible wonderful person like that. :kaopride:

Forum statistics

Threads
105,758
Messages
1,016,226
Members
137,447
Latest member
GTFoxN6Y
Top