JohnDoeNews

AFK TTYL
Regular
Joined
Apr 25, 2017
Messages
2,061
Reaction score
1,508
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
955
Reaction score
586
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,061
Reaction score
1,508
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,022
Reaction score
4,352
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,061
Reaction score
1,508
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

Resisting the urge to bust out watching spooky things all over. I still have days until it's Halloween month, gotta ration!
Made a free sample pack + leftovers. Free Sample Pack 1
I'm curious, how many hours in RPG Maker do you have? I'm clocked in at 2100 hours on MV and the vast majority of it is for one game. I wish I could track how much I used XP back in the day, I was on it a lot.
Why is it so early? Can I have twenty more minutes of sleep, please?
DK
Do you like this design?

GIF.gif

Forum statistics

Threads
134,809
Messages
1,250,842
Members
177,606
Latest member
Buffinto
Top