MV - MOGhunter's ABS chrono engine multiple drops?

● ARCHIVED · READ-ONLY
Started by Geeguz 7 posts View original ↗
  1. Been using MOGhunter's chrono engine on rpg maker MV, going great however I ran into one issue, I can only have an enemy drop one item at a time. I came across this https://forums.rpgmakerweb.com/index.php?threads/chrono-engine-abs-item-drop.112136/ and it nearly fufills what I need however there is no longer an actual item drop on the map you can pick up which kind of ruins the aesthetic. All my enemies are only going to be dropping multiples of the same item, is there a way to accomplish this? Even if it only displays one drop that would count as multiple that would be perfect.
  2. You could use an event spawner to spawn events on the tile the monster just died at. It looks like Restart used Yanfly spawn, but I don't think it allows for multiple spawn overlap. So in the spawn event you have to make it touch trigger, pick a random number from say, 1 to 3 (or however many items you want to drop), then add that number of the item to the inventory.

    Or you could have the spawner randomly pick 1-3 tiles within 1 tile of the enemy death spot that is not occupied by another event and spawn those events on those squares.
  3. AquaEcho said:
    You could use an event spawner to spawn events on the tile the monster just died at. It looks like Restart used Yanfly spawn, but I don't think it allows for multiple spawn overlap. So in the spawn event you have to make it touch trigger, pick a random number from say, 1 to 3 (or however many items you want to drop), then add that number of the item to the inventory.

    Or you could have the spawner randomly pick 1-3 tiles within 1 tile of the enemy death spot that is not occupied by another event and spawn those events on those squares.
    Im trying to understand... so the first code he puts

    Game_CharacterBase.prototype.makeTreasure = function(char,battler) {
    var treasures = battler.makeDropItems();
    if (treasures.length > 0) {
    var rt = Math.randomInt(treasures.length);
    var item = treasures[rt]
    if (item.id == 100)
    {
    Yanfly.SpawnEventAt( INPUT PARAMETERS AS APPROPRIATE)
    }else
    {
    char._user.treasure = [item,false,0,0,20];
    char._characterName = 'treasurebattlertool'
    $gameMap._treasureEvents.push(char);
    }
    char._user.collapse = [true,0];

    };

    };

    is this also put into a .js file like the previous to work in cooperation with Yanfly's event spawner? If so does anything have to be modified here regarding the items or coordinates of the items or is this code meant to work out all that information on it's own?
  4. That code spawns one event on the enemy tile using Yanfly's spawner. You could modify the Yanfly.SpawnEventAt line to use a different spawner, but know that there is some conflict with event spawners and ChronoEngine, because ChronoEngine itself spawns events every time you use a skill or item and sometimes events get mixed up doing that. I know Restart wrote a specific fix for Yanfly Spawn to make it so the event ids were separate. Personally I use Ritter's Spawn which is compatible with ChronoEngine but it is a paid plugin.

    Yes, you would put that code as a plugin file after ChronoEngine and MOG Treasure Popup. If you want to modify it to do the things I said above you would need to modify the code.
  5. AquaEcho said:
    That code spawns one event on the enemy tile using Yanfly's spawner. You could modify the Yanfly.SpawnEventAt line to use a different spawner, but know that there is some conflict with event spawners and ChronoEngine, because ChronoEngine itself spawns events every time you use a skill or item and sometimes events get mixed up doing that. I know Restart wrote a specific fix for Yanfly Spawn to make it so the event ids were separate. Personally I use Ritter's Spawn which is compatible with ChronoEngine but it is a paid plugin.

    Yes, you would put that code as a plugin file after ChronoEngine and MOG Treasure Popup. If you want to modify it to do the things I said above you would need to modify the code.
    Modify it to do what? Change the spawn location based upon other events or just to spawn an item i can pick up and get multiple? I thought that was its purpose but I'm confused as to how it knows which event ID to spawn off the reference map and how it would auto locate it to the point of the enemy's death without each individual enemy having their own X and Y coordinates. Am I still even actually using Yanfly's event spawner plugin commands or is it supposed to automatically be being processed through the info provided on the additional .js file?
  6. Where it says
    Yanfly.SpawnEventAt( INPUT PARAMETERS AS APPROPRIATE)

    You need to input that information based on the instructions for that command from Yanfly's plugin.

    E: Give me a bit to try this out myself and I'll edit this post with more detailed instructions.
    EE: Ok, I figured it out. So basically what's happening is when the enemy dies, its event turns into the item, which is why it doesn't make more than one item drop. What Restart is doing is making a special dummy item (id 100 in his example) which you need to make in your database (id 100) and again on your spawn map (it can be any event number there, you just need to define it in the parameters for the Yanfly.SpawnEventAt() command.)

    Code:
               Yanfly.spawnEventAt(39, 28, char.x, char.y, false);
    Replace 39 with your spawn map id and 28 with the event you want to spawn. Set the event to Player Touch trigger and you can put whatever items you want in the event page. Put Yanfly.DespawnEvent(this.eventId()) on the last line (I used my own spawner in the picture so it used a slightly different command). This will make it so the enemy spawns this treasure chest upon dying, and when you pick it up you get 2 potions and an ether
    1692400173293.png

    Edit: If you want to randomize the items in the chest, this will randomly give you 1-3 items out of a defined itemPool where 1, 2, and 3 are the database item IDs you want the chest to contain.
    1692743004380.png
    Edit 2: If you want the chest to contain random items by a specific enemy, put <drops:x,y,z> in the notebox of the enemy's page in the database, where x y and z are the item IDs the enemy can drop, then use the following:1694976411806.png
  7. I spent the weekend modifying Restart's script to spawn multiple items on enemy death. Since the default ChronoEngine mechanic is to transform the dead enemy event into an item, you can't have more than one item event without using a spawner to spawn extras. I am using this with Restart's CrossEngine (ChronoEngine+Altimit Pixel Movement).

    To use this you need to make a dummy item at 100, and make that item the sole drop under the drop items section of the enemy's page in the database. Then make the actual items you want dropped in a notetag <drops:x,y,z> in the notebox. X, y, and z correspond to the event numbers on your spawn map. You can make the item pool as big as you want, or it can be only one item <drops:x> but I wrote the code to randomly choose 1-3 items from that tag to drop.
    1692662849204.png
    JavaScript:
    //Restart ChronoEngine Enemy Treasure Spawn (modded)
    Game_CharacterBase.prototype.makeTreasure = function(char,battler) {
       var treasures = battler.makeDropItems();
        if (treasures.length > 0) {
           var rt = Math.randomInt(treasures.length);
           var item = treasures[rt];
           if (item.id == 100)
           {
                //generate a number between 1 and 3
                var randomCount = Math.floor(Math.random() * 3) + 1;
                //get the values from the drop notetag from enemy database
                var dropArray = $dataEnemies[char.battler()._enemyId].meta.drops.split(',');
                //randomly spawn between 1 and 3 items
                for (var i = 0; i < randomCount; i++) {
                    var rd = Math.randomInt(dropArray.length);
                    var drop = dropArray[rd].trim();
                    //spawn items in random location in .5 radius from death
                   Ritter.spawnEvent(39, drop, char.x +Math.random()-0.5, char.y +Math.random()-0.5, false);
               }
    
           }else
           {
               char._user.treasure = [item,false,0,0,20];
               char._characterName = 'treasurebattlertool'
               $gameMap._treasureEvents.push(char);
           }
           char._user.collapse = [true,0];
     
       };
    };

    This code is basically overwriting ChronoEngine's treasure generating function so that if you set the Drop Items section in the enemy page in the database to item 100, ignore the default "transform enemy into treasure" function and instead use the event spawner to spawn the drop items defined in the <drops:x,y,z> notebox notetag from the spawn map in a radius around the enemy's death tile.

    I use Ritter's Spawn (paid), so if you're using Yanfly you need to change the Ritter.spawnEvent line to
    Yanfly.spawnEventAt(39, drop, char.x +Math.random()-0.5, char.y +Math.random()-0.5, false);
    And change 39 to your spawn map id number.

    I am also setting spawns to overlap so they can spawn on top of each other. I don't think Yanfly Spawner has this feature, Galv's one does have a spawn overlap command but it has its own conflicts with ChronoEngine.