chrono engine ABS item drop

● ARCHIVED · READ-ONLY
Started by arashiya 15 posts View original ↗
  1. can any body help?
  2. Mog's plugin uses the stock RPGMaker base 'makeDropItems()' function, and in addition to that, the getTreasure() function is hardcoded to only add 1 of any given item. It's a bit of a pain to modify because of that. (and I THINK maybe the monster gets transformed into the treasure? Not sure on that, didn't dig deep enough to understand it).

    Since in my own project, I wanted to do enemies dropping hearts zelda-style, which are instantly used instead of being put into the inventory, I eventually decided to do a dumb hack, and create some dummy items in high numbered item slots, which trigger a spawn of a new event using yanfly's Event Spawner plugin whenever they come up in the drop table.

    Code:
    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];
          
       };
    };

    YMMV how useful that is to you, but that's what I did.
  3. thanks for your reply!
    I think maybe I have to give up on multiple items...

    your method is cool
    I can understand the logic
    but maybe I don't have the knowledge to modify it...
    thanks anyway
  4. Yeah it's just a pain to do. If you don't care about running around to collect items on the map, you can do something like this (untested code incoming:)


    Code:
    Game_CharacterBase.prototype.makeTreasure = function(char,battler) {
       var treasures = battler.makeDropItems();
       if (treasures.length > 0) {
    
        for (var i = 0; i < treasures.length; i++) {
             var item = treasures[rt]
            $gameParty.gainItem(item, 1);
           if (Imported.MOG_TreasurePopup) {
               $gameSystem._trspupData.push([item,1,event.screenX(),event.screenY()]);
           };
            }
          char._user.collapse = [true,0];
       };
    };

    You'd still be working within the very limited constraints of the default loot drop code, though, which limits your multiple item possibilities pretty badly.

    It appears that yanfly's extra enemy drops might be compatible since it modifies makeDropItems. You can try that and see if it works.

    http://www.yanfly.moe/wiki/Extra_Enemy_Drops_(YEP)
  5. I tried but still seems no luck...
  6. try
    Code:
    Game_CharacterBase.prototype.makeTreasure = function(char,battler) {
       var treasures = battler.makeDropItems();
       if (treasures.length > 0) {
    
        for (var i = 0; i < treasures.length; i++) {
             var item = treasures[i]
            $gameParty.gainItem(item, 1);
           if (Imported.MOG_TreasurePopup) {
               $gameSystem._trspupData.push([item,1,char.screenX(),char.screenY()]);
           };
            }
          char._user.collapse = [true,0];
       };
    };
  7. yes I have tried paste the code into it
    but no item appear when the monster is dead
    and the position it dead remains sth blocking the player to step on
  8. Odd, is working for me.

    FNWS0I0.png
    Qkpeg0F.png
    yrJoGwR.png

    Did you add that code as a plugin at the bottom of the list? Are you using other non-chrono engine plugins?
  9. oh I just add the code into chrono engine...
    yes I have used a bunch of other plugins
  10. Can't really figure anything out without knowing the plugins and their order - would you mind giving me a screenshot of your full plugin list?

    Also, try just sticking the tweak in a seperate plugin. Save it as 'droptest.js', and stick it at the bottom of the list.
  11. actually I am using the chrono engine demo to test but still no difference
    I set the enemy to have 3 items but can't return the result as yours
    would you explain more how to make a separate plugin?
  12. Just save it into a .txt file with notepad, then rename that file to "testPlugin.js"
  13. thanks so much I finally make it
    a lot of stupid mistakes...

    although there is no drop item on the map now,
    being able to collect several items is important to my game

    the reason of invisible block after monster dead,
    should be the event page I created before the monster move
    everything's fine after I removed the page
    ( I create a page that make the monster fade in and wait than turn on a switch to movement)

    anyway thanks again you are always my lifesaver!!
  14. I find even the monster is dead but the event itself semms still remaining
    I am also using yanfly event spawner
    when the monster is dead on the spwan point, no more spawn occurs again
    so is there a way to completely remove the dead monster event?