Skip to content

Appropriateness on accessing $gameSystem from Scene_Base #175

@rev2nym

Description

@rev2nym

The issue

The present community edition corescript conflict with "MadeWithMv.js" of a plugin bundled by initial project data. The cause is calling $gameSystem.onFrameUpdate() from Scene_Base when$gameSystem isn't generated yet. $gameSystem.onFrameUpdate() is the method to update $gameSystem._frameCount incrementally. $gameSystem is generated by Scene_Boot.start(). Therefore should not access game objects such as $gameSystem before Scene_Boot.start().

There are several issues here.

Resolution of conflict with "MadeWithMv.js"

However, this conflict is also a defect on the plugin side, so the priority is low.

Shouldn't access game objects from Scene_Base.

It isn't ensured that generation of game objects is complete when Scene_Base running. This should be fixed.

Is calling setupNewGame() from Scene_Boot appropriate?

Though a new game has not started yet in Scene_Boot, DataManager.setupNewGame() is called from Scene_Boot. So I think this is the most important in this issue probably.

Shouldn't it be made $gameSystem.update() ?

When the processing is called to 1 frame once certainly, it's appropriate to make it the update().

The use of $gameSystem._framesOnSave is unclear.

$gameSystem._frameCount is included in a save file, so _framesOnSave isn't useful.

After all what was the reason Graphics.frameCount put out?

And what was the reason Graphics.frameCount still exist at other parts?

Ideas of solution

Then, where should be setupNewGame() called from?

  • Plan A
    Just before transferring to 'Scene_Map' from 'Scene_Title'. Is's made already default. However, only $gameSystem has to be generated in Scene_Boot. '$gameSystem' is used in Scene_Title.

  • Plan B
    Generate $gameSystem when Scene_Title.start(). About other game objects, establishing another Scene class (for example, Scene_Setup or Scene_NewGame). Generate all game objects when that scene starting. And transfer to first map after that.

I think Plan B is better. It can indicate new game clearly.

How access $gameSystem._frameCount ?

Establishing another Basing Scene class (for example, Scene_GameBase).
Making Scene classes of whole game after title extend newly Scene class established.

...And consider that later about $gameSystem._framesOnSave and Graphics.frameCount.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions