Character Creator EX extencion

Discussion in 'Javascript/Plugin Support' started by Tatsumaro, Jun 30, 2017.

  1. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    HI need help to resolve this problem. If you use SumRndmDde Character Creator EX – MV Plugin you know about the
    If you wish for an event to use a custom character image, simply use
    * the event notetag:
    *
    * <CustomCharacter: [actorId]>

    All great, but there is a problem, and its called "the event notetag", whwn you use 1 event and assign a notetag you cant change that notetag, so you can:
    • Set Movement Route> This Event> Transparent ON, Through ON - but when you reenter the map, HE IS BACK.
    • Create a custom rout and Set Custom Movement Route> This Event> Transparent ON, Through ON - and HE is runing invisible spending resources.
    • Use YEP_MoveRouteCore to TELEPORT: x, y - but that is a lot of work just to put an event under a Dooad, or in a corner off the map
    Or you can help me create an extension fix to EST_ACTOR_EVENT. to call Character Creator EX .png of the character. Estriole make this plugin
    > to use actor graphic as event... add this comment in your event page: <actor_event: x> change x to your actor id in database > to use party member grapic as event... add this comment in your event page: <party_event: x> change x to party member index. remember index start at 0 !!! 0 -> first member, 1-> second member, 2-> 3rd member and so on.
    . Its a very simple idei and it works great. Ther just 1 problem i have no idea what im doing. Im going to tray anyway and post my codes, so if anybody has the time to suggest or comment thanks
     
    #1
  2. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    EST_ACTOR_EVENT.
    Code:
    /*:
    @plugindesc This plugin can make event that use actor / party member sprite.
    <EST_ACTOR_EVENT>
    @author Estriole
    
    @help
     ■ Information      ╒══════════════════════════╛
     EST - Actor Event
     Version: 1.0
     By Estriole
     File name: EST_ACTOR_EVENT.js
    
     ■ Introduction     ╒══════════════════════════╛
     This plugin can create event that use actor or party member graphic
    
     ■ Features         ╒══════════════════════════╛
     - create event that use actor graphic
     - create event that use party member graphic
    
      ■ Changelog       ╒══════════════════════════╛
     v1.0 2015.12.09           Initial Release
    
     ■ Plugin Download ╒══════════════════════════╛
     https://www.dropbox.com/s/t0xvhqurcroj3rz/EST_ACTOR_EVENT.js?dl=0
    
     ■ How to use       ╒══════════════════════════╛
     > to use actor graphic as event... add this comment in your event page:
    
     <actor_event: x>
    
     change x to your actor id in database
    
     > to use party member grapic as event... add this comment in your event page:
    
     <party_event: x>
    
     change x to party member index. remember index start at 0 !!!
     0 -> first member, 1-> second member, 2-> 3rd member and so on.
    
     ■ Dependencies     ╒══════════════════════════╛
     none
    
     ■ Compatibility    ╒══════════════════════════╛
     I'm new in JS... and MV is new engine... so i cannot say for sure.
     but it should be compatible with most things.
    
     ■ Parameters       ╒══════════════════════════╛
     None
     
     ■ License          ╒══════════════════════════╛
     Free to use in all project (except the one containing pornography)
     as long as i credited (ESTRIOLE).
    
     ■ Extra Credit ╒══════════════════════════╛
     - Victor Sant since he create ACE version of this plugin
    
     ■ Support          ╒══════════════════════════╛
     While I'm flattered and I'm glad that people have been sharing and
     asking support for scripts in other RPG Maker communities, I would
     like to ask that you please avoid posting my scripts outside of where
     I frequent because it would make finding support and fixing bugs
     difficult for both of you and me.
     
     If you're ever looking for support, I can be reached at the following:
     [ http://forums.rpgmakerweb.com/ ]
     pm me : estriole
    
     ■ Author's Notes   ╒══════════════════════════╛
     None
    
    */
    var EST = EST || {};
    EST.ActorEvent = EST.ActorEvent || {};
    
    (function($){
    Game_Event.prototype.getEventActorEvent = function() {
      var shift = null;
      var comment = "";
      if(!this.page()) return shift;
      var pagelist = this.page().list;
      for (var cmd of pagelist)
      {
        if(cmd.code == 108)   comment += cmd.parameters[0] + "\n";
        if(cmd.code == 408)   comment += cmd.parameters[0] + "\n";
      }
      if(comment.match(/<actor_event:\s*(.*)>/im)) var shift = Number(comment.match(/<actor_event:\s*(.*)>/im)[1]);
      return shift;
    };
    
    Game_Event.prototype.getEventPartyEvent = function() {
      var shift = null;
      var comment = "";
      if(!this.page()) return shift;
      var pagelist = this.page().list;
      for (var cmd of pagelist)
      {
        if(cmd.code == 108)   comment += cmd.parameters[0] + "\n";
        if(cmd.code == 408)   comment += cmd.parameters[0] + "\n";
      }
      if(comment.match(/<party_event:\s*(.*)>/im)) var shift = Number(comment.match(/<party_event:\s*(.*)>/im)[1]);
      return shift;
    };
    
    $.Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
    Game_Event.prototype.setupPageSettings = function() {
      $.Game_Event_setupPageSettings.call(this);
      this.setupEventActorGraphic();
    };
    
    Game_Event.prototype.setupEventActorGraphic = function() {
      var evActorId = this.getEventActorEvent();
      var evPartyId = this.getEventPartyEvent();
      var evActor = null;
      if(evActorId) evActor = $gameActors.actor(evActorId);
      if(evPartyId) evActor = $gameParty.members()[evPartyId];
      if(evActor) this.setImage(evActor._characterName, evActor._characterIndex);
    };
    
    $.Scene_Map_start = Scene_Map.prototype.start;
    Scene_Map.prototype.start = function() {
      $gameMap.events().forEach(function(ev){
        ev.setupEventActorGraphic();
      });
      $.Scene_Map_start.call(this);
    };
    
    })(EST.ActorEvent);
     
    #2
  3. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    SDR magic time
    Code:
    //-----------------------------------------------------------------------------
    // Game_Event
    //-----------------------------------------------------------------------------
    
    _.Game_Event_initialize = Game_Event.prototype.initialize;
    Game_Event.prototype.initialize = function(mapId, eventId) {
        _.Game_Event_initialize.apply(this, arguments);
        this.setupCustomCharacter();
    };
    
    Game_Event.prototype.setupCustomCharacter = function() {
        const note = this.event().note;
        if(note.match(/<Custom[ ]?Character[ ]?:\s*(\d+)\s*>/im)) {
            this._customCharacterId = parseInt(RegExp.$1);
            this._customCharacterActor = $gameActors.actor(this._customCharacterId);
            this._needsCustomCharacterUpdate = true;
        }else if(note.match(/<Custom[ ]?Dead[ ]?Character[ ]?:\s*(\d+)\s*>/im)) {
            this._customCharacterId = parseInt(RegExp.$1);
            this._customCharacterActor = $gameActors.actor(this._customCharacterId);
            this._isCustomDeadCharacter = true;
            this._needsCustomCharacterUpdate = true;
        }
    };
    
    Game_Event.prototype.hasSetImage = function() {
        return !!this._customCharacterId && this._customCharacterActor.hasSetImage();
    };
    
    Game_Event.prototype.setNeedsCustomUpdate = function(update) {
        this._needsCustomCharacterUpdate = update;
    };
    
    Game_Event.prototype.needsCustomUpdate = function() {
        return !!this._needsCustomCharacterUpdate;
    };
    
    Game_Event.prototype.isDeadCustomCharacter = function() {
        return !!this._isCustomDeadCharacter;
    };
    
    Game_Event.prototype.getCreatorBitmap = function() {
        const actor = $gameActors.actor(this._customCharacterId);
        return actor && actor.getCreatorBitmapChar();
    };
    
    Game_Event.prototype.getCreatorBitmapDead = function() {
        const actor = $gameActors.actor(this._customCharacterId);
        return actor && actor.getCreatorBitmapDead();
    };
    
     
    #3
  4. Tatsumaro

    Tatsumaro Veteran Veteran

    Messages:
    205
    Likes Received:
    40
    First Language:
    Portugues
    Primarily Uses:
    RMMV
    EST_ACTOR_EVENT reduce to minimal

    Code:
    /*:
    @plugindesc This plugin can make event that use actor / party member sprite.
    <EST_ACTOR_EVENT>
    @author Estriole
    
    @help
     ■ Information      ╒══════════════════════════╛
     EST - Actor Event
     Version: 1.0
     By Estriole
     File name: EST_ACTOR_EVENT.js
    
     ■ How to use       ╒══════════════════════════╛
     > to use actor graphic as event... add this comment in your event page:
    
     <actor_event: x>
    
     change x to your actor id in database
    
     > to use party member grapic as event... add this comment in your event page:
    
     <party_event: x>
    
     change x to party member index. remember index start at 0 !!!
     0 -> first member, 1-> second member, 2-> 3rd member and so on.
    
    */
    var EST = EST || {};
    EST.ActorEvent = EST.ActorEvent || {};
    
    (function($){
    Game_Event.prototype.getEventActorEvent = function() {
      var shift = null;
      var comment = "";
      if(!this.page()) return shift;
      var pagelist = this.page().list;
      for (var cmd of pagelist)
      {
        if(cmd.code == 108)   comment += cmd.parameters[0] + "\n";
        if(cmd.code == 408)   comment += cmd.parameters[0] + "\n";
      }
      if(comment.match(/<actor_event:\s*(.*)>/im)) var shift = Number(comment.match(/<actor_event:\s*(.*)>/im)[1]);
      return shift;
    };
    
    $.Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
    Game_Event.prototype.setupPageSettings = function() {
      $.Game_Event_setupPageSettings.call(this);
      this.setupEventActorGraphic();
    };
    
    Game_Event.prototype.setupEventActorGraphic = function() {
      var evActorId = this.getEventActorEvent();
      var evActor = null;
      if(evActorId) evActor = $gameActors.actor(evActorId);
      if(evActor) this.setImage(evActor._characterName, evActor._characterIndex);
    };
    
    $.Scene_Map_start = Scene_Map.prototype.start;
    Scene_Map.prototype.start = function() {
      $gameMap.events().forEach(function(ev){
        ev.setupEventActorGraphic();
      });
      $.Scene_Map_start.call(this);
    };
    
    })(EST.ActorEvent);
     
    #4
  5. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,723
    Likes Received:
    7,581
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

    I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.


    Plugin Releases is for releasing plugins you've created for the community to use.

    Also, next time, please try no to post so many in a row. Use spoilers in the original post to put the code or something. I'm not sure if all of that will fit into one post or not though, which is why I've not merged them together. But maybe in the future link to the plugins or something.
     
    #5
    Tatsumaro likes this.

Share This Page