JohnDoeNews

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,083
Reaction score
1,532
First Language
Dutch
Primarily Uses
RMMV
I can find anything about my enemies with little pieces of script like:

For HP:
Code:
$dataEnemies[X].params[0]

And for ATK:
Code:
$dataEnemies[X].params[2]

I can also find how much EXP or GOLD it frops with
Code:
$dataEnemies[X].exp
and
Code:
$dataEnemies[X].gold

This is very usefull stuff, when I try to make systems that play outside or completely replace the battle scene. I can easily use this in formula's, or save it in a variable to be used by other parts, like event conditions.

However, other useful information would be which loot it drops. I have worked around this for a while now, but it would be real handy if I could use this information in my out-of-battle systems.

So, is there a code that refers to the loot ID? I assume there will be 3 variables needed for 3 pieces of loot. Or probably 3 more for the item-type. (Item/Weapon/Armor)

And since we're at it, maybe we can also get which loot has what drop rate?

---

I don't need a complete formula, or something. If I just know the part that would give me the ID, and if possible also the part that gives the weapon type.
 
Last edited:

SpyroFan67

Regular
Regular
Joined
Apr 27, 2023
Messages
970
Reaction score
594
First Language
English
Primarily Uses
RMMV
Very
I can find anything about my enemies with little pieces of script like:

For HP:
Code:
$dataEnemies[X].params[0]

And for ATK:
Code:
$dataEnemies[X].params[2]

I can also find how much EXP or GOLD it frops with
Code:
$dataEnemies[X].exp
and
Code:
$dataEnemies[X].gold

This is very usefull stuff, when I try to make systems that play outside or completely replace the battle scene. I can easily use this in formula's, or save it in a variable to be used by other parts, like event conditions.

However, other useful information would be which loot it drops. I have worked around this for a while now, but it would be real handy if I could use this information in my out-of-battle systems.

So, is there a code that refers to the loot ID? I assume there will be 3 variables needed for 3 pieces of loot. Or probably 3 more for the item-type. (Item/Weapon/Armor)

And since we're at it, maybe we can also get which loot has what drop rate?

---

I don't need a complete formula, or something. If I just know the part that would give me the ID, and if possible also the part that gives the weapon type.
Very helpful and informational. If only I knew how to use it LOL. I'm SO bad at technical stuff like that when it comes to scripting, etc. I don't know the first thing about it.
 

JohnDoeNews

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,083
Reaction score
1,532
First Language
Dutch
Primarily Uses
RMMV
Very

Very helpful and informational. If only I knew how to use it LOL. I'm SO bad at technical stuff like that when it comes to scripting, etc. I don't know the first thing about it.
It's rather easy. And it can even be used without any further coding knowledge. But because I don't want to derail this topic before I have my answer*, send me a DM and I'll teach you how to use it. ;)

(*I'm okay with derailment as soon as I got what I want. Hahaha.)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,039
Reaction score
4,386
First Language
EN
Primarily Uses
RMMZ
Each record of $dataEnemies has a field dropItems. It is array of objects, each of which has these properties:
  • kind - 1 (Item), 2 (Weapon), or 3 (Armor).
  • dataId - database ID of the Item, Weapon, or Armor.
  • denominator - the "1 in X" value determining drop chance.
So, in line with your given examples, this gets the first assigned drop item:

$dataEnemies[X].dropItems[0]
Note that kind will be 0 if that item drop is left blank.

Technical:
  • Item drops are generated via the makeDropItems methods of Game_Troop and Game_Enemy.
  • The kind and dataId properties are fed directly to the itemObject method of Game_Enemy.
 

JohnDoeNews

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,083
Reaction score
1,532
First Language
Dutch
Primarily Uses
RMMV
Perfect! Exactly what I was looking for. This will open so much doors, which have been locked for me for so long. :p And I just know there is some treasure behind it. ;)

Thanks again, Caethyril. Once again you're the one to open the doors for me.
 
Last edited:

Latest Threads

Latest Profile Posts

Just completed another cutscene. Huge one for the story. I'm so enthusiastic about where this game is going.
Man, the enemies in the new Sonic Frontiers update are totally roided up. I wanted a little more difficulty myself, but Sonic Team turned the dial a bit too far.

At least the new tracks for roaming Ouranos Island as Amy, Knuckles, and Tails slap hard.
mz_quest_victory_scene.gif


This battle victory screen has been pretty fun to work on. Not only can party members set new personal records for their contributions to the fight, but when they do, the party remarks on the accomplishment!
When you love all your children equally, but the world sees it differently.
popular.png
Found an old, unfinished project of mine, where you fight movie screenplays as an up-and-coming actress.
Turns out I used VX way back when. I may need to remake this in MZ, the premise was kinda hilarious.
1696205441250.png
1696205637522.png

Forum statistics

Threads
134,981
Messages
1,252,582
Members
177,865
Latest member
donghoreplicaturbowatch
Top