JohnDoeNews

www.johndoenews.nl
Regular
Joined
Apr 25, 2017
Messages
2,041
Reaction score
1,499
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
942
Reaction score
578
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

www.johndoenews.nl
Regular
Joined
Apr 25, 2017
Messages
2,041
Reaction score
1,499
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,013
Reaction score
4,337
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

www.johndoenews.nl
Regular
Joined
Apr 25, 2017
Messages
2,041
Reaction score
1,499
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

An optimal price for an indie game on Steam also needs to be accompanied by an optimal sales discount %. For a solo indie game, I think the optimal price is where it should be low enough that a single Steam card can be used to buy it, after tax. A few cents the wrong direction can potentially mean someone who was gifted a Steam card can't buy the game, then picks something else to buy.
I've been so lazy about doing art but I finally decided to buckle down and get some work done on the party!

aa312ffbcd667933.png

3d554012e96e4526.png
SallyFaceTest.png
Testing the first face in battle!

Forum statistics

Threads
134,684
Messages
1,249,701
Members
177,423
Latest member
Moodesburn1977
Top