Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,298
Reaction score
14,275
First Language
English
Primarily Uses
RMMV
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);
 
Last edited by a moderator:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
153
Reaction score
115
First Language
Ukrainian
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
 

TecnoNinja

Villager
Member
Joined
May 30, 2016
Messages
11
Reaction score
1
First Language
Italian
Primarily Uses
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
 
Last edited by a moderator:

Krimer

Veteran
Veteran
Joined
May 10, 2013
Messages
153
Reaction score
115
First Language
Ukrainian
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.
 
Last edited by a moderator:

TecnoNinja

Villager
Member
Joined
May 30, 2016
Messages
11
Reaction score
1
First Language
Italian
Primarily Uses
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:
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.
Pyra and Mythra in smash ultimate are way too OP. They're basically Smash 4 Bayonetta 2.0, and not in a good way. Very toxic and unfair. At least they're hot tho.

Forum statistics

Threads
109,197
Messages
1,042,970
Members
141,700
Latest member
skybola188
Top