convert short script Rpgmkr ACE in a plugin for MV

I don't think so, because what we're referring to here is what comes out of the json files (which don't have a leading _), not the variables as defined in the rpg_objects.js (which do):


"events":[
null,
{"id":1,"name":"EV001","note":"","pages":[{"conditions":{"actorId":1,"actorValid":false,"itemId":1,"itemValid":false,"selfSwitchCh":"A","selfSwitchValid":false,"switch1Id":1,"switch1Valid":false,"switch2Id":1,"switch2Valid":false,"variableId":1,"variableValid":false,"variableValue":0},"directionFix":false,"image":{"tileId":0,"characterName":"!Other1","direction":2,"pattern":0,"characterIndex":6}



This is the code that sets up the current page based on the information at the indexed page.  What we're trying to do is change the indexed page, not the current page.  It uses this.page().image.characterName and this.page().image.characterIndex - we're just using this.pages[id] instead of this.page but the image.characterName and image.characterIndex are the same.

Code:
Game_Event.prototype.setupPageSettings = function() {
    var page = this.page();
    var image = page.image;
    if (image.tileId > 0) {
        this.setTileImage(image.tileId);
    } else {
        this.setImage(image.characterName, image.characterIndex);
    }
    if (this._originalDirection !== image.direction) {
        this._originalDirection = image.direction;
        this._prelockDirection = 0;
        this.setDirectionFix(false);
        this.setDirection(image.direction);
    }
    if (this._originalPattern !== image.pattern) {
        this._originalPattern = image.pattern;
        this.setPattern(image.pattern);
    }
    this.setMoveSpeed(page.moveSpeed);
    this.setMoveFrequency(page.moveFrequency);
    this.setPriorityType(page.priorityType);
I've done some changes in @Shaz code, just few edits.


Here you go


(function () {
Game_Event.prototype.page_graphic = function(page, graphic, index) {
index = index || 0;
this.event().pages[page].image.characterName = graphic;
this.event().pages[page].image.characterIndex = index;
this.setupPageSettings();
};

Game_Event.prototype.page_priority = function(page, priority) {
this.event().pages[page].priorityType = priority;
this.setupPageSettings();
};

Game_Event.prototype.page_move = function(page, speed, freq, type) {
type = type || null;
this.event().pages[page].moveSpeed = speed;
this.event().pages[page].moveFrequency = freq;
if (type) { this.event().pages[page].moveType = type };
this.setupPageSettings();
};

Game_Interpreter.prototype.page_graphic = function(ev, page, graphic, index) {
index = index || 0;
$gameMap.event(ev).page_graphic(page, graphic, index);
};

Game_Interpreter.prototype.page_priority = function(ev, page, priority) {
$gameMap.event(ev).page_priority(page, priority);
};

Game_Interpreter.prototype.page_move = function(ev, page, speed, freq, type) {
$gameMap.event(ev).page_move(page, speed, freq, type);
};
})();


The problem was not in the code. 


You need to call commands like this


34cb018a30f7be2131e7564a3dbfd784.png



with "this." before command
if you can wait a week or so, I could probably do this for you, but until then, anyone, feel free to take this.
 



Thanks for your help. I can not wait a week or two problems. If we could make it go it would be great. Really! T_T

 



I tried your version but I have not seen changes. Now no longer crashes the tool, but not even changing graphics. Definitely something wrong ... but I do not know what. I used the command that you said, but I could not make it work. I'm sorry
I tried your version but I have not seen changes. Now no longer crashes the tool, but not even changing graphics. Definitely something wrong ... but I do not know what. I used the command that you said, but I could not make it work. I'm sorry

I`m 100% sure script is working.


022b119d2a56dc5cb5140fb7edce8ccf.gif



I think you write wrong page in command. Page count starts from 0. So if you want to change graphics in event page 1 then you need to write 0 in command.


Like this


7469ae2bef1c5f2c7952443aec11d638.png



where first "0" is first page in the event.


I can change that, but first, try to write correct page.
I`m 100% sure script is working.


I think you write wrong page in command. Page count starts from 0. So if you want to change graphics in event page 1 then you need to write 0 in command.


Like this





where first "0" is first page in the event.


I can change that, but first, try to write correct page.



It works really well !!!
Great!
I do exactly what I need! I do not know how I would have done without your help. You were fantastic ... You all!! Y__Y
Now I do a thousand tests and as soon as I completed the menu to events that I'm finishing, I get back to even convert the battlefield to system events!


PS: This is the menu that I'm doing:

Original thread: https://forums.rpgmakerweb.com/threads/convert-short-script-rpgmkr-ace-in-a-plugin-for-mv.62608/