MOGS Mapname JS

Hoping someone can help.... i am looking to add a way to call on different name display bases for different maps - Example... the image behind the name would be different for an Item store... then say the image for a weapon store... or creepy dungeon... Is there anyway to modify or add to the JS to do this?
Well, I think this plugin already has this feature.
Apresenta uma Hud com o nome do mapa.
It means " Shows a Hud with the name of the map"
So if you name the maps differently, the names showed will be different. Is that it that you want?

Or do you want a name to be displayed when you open a scene? For example, shop one?
I actually already did this a long a time ago for myself.


Spoiler: Code
Code:
Game_Map.prototype.overrideMapName = function(text) {
    this.overrideDisplayName(text);
};

Game_Map.prototype.overrideDisplayName = function(text) {
    this._overrideDisplayName = text;
};

Game_Map.prototype.clearOverrideMapName = function() {
    this.clearOverrideDisplayName();
};

Game_Map.prototype.clearOverrideDisplayName = function() {
    this._overrideDisplayName = undefined;
};

Game_Map.prototype.displayName = function() {
    if (this._overrideDisplayName) {
        return this._overrideDisplayName;
    } else {
        return $dataMap.displayName;
    }
};

I believe I took the code from
So you can find how to use it from there.

Wait just realized you said image, if you want image changed it's pretty easy as well.
Code:
Map_Name_Hud.prototype.createParticles = function() {
    this._particlesField = new Sprite();
    this.addChild(this._particlesField);
    this._particles = [];
    const particleRNG = Math.randomInt(3),
    look = $gameVariables.value(105);
    switch(look) {
        case 'item':
        $gameSystem._mapNameData.nParticles = Math.randomInt(50) + 26;
        break;
        default:
        $gameSystem._mapNameData.nParticles = 15;
        break;
    }
    for (let i = 0; i < this.data().nParticles ; i++) {
        switch(look) {
            case 'item':
             this._particles[i] = new Sprite(ImageManager.loadIcon("IconSet_" + $gameVariables.value(106)));
             break;
            default:
         this._particles[i] = new Sprite(ImageManager.loadIcon("MapName_Particles" + $gameVariables.value(29) + particleRNG));
         break;
        }
         this._particles[i].anchor.x = 0.5;
         this._particles[i].anchor.y = 0.5;
         this._particles[i].sx = 0;
         this._particles[i].sy = 0;
         this._particles[i].so = 0;
         this._particles[i].sr = 0;  
         this._particlesField.addChild(this._particles[i]);
         if (this.data().cw != 0) {this.refreshParticles(this._particles[i],true)};
    };
};
I edited the particles for a different one based off variables, you could do the same thing for all the others, didn't do it myself yet as it isn't a priority.
I edited the particles for a different one based off variables, you could do the same thing for all the others, didn't do it myself yet as it isn't a priority.
I think i am confused... I use the particles though in the plugin. Mogs calls on the Mapname.png in line 283 of the plugin. I want it to call on what ever I specify for that image for when the player enters the map..... not just one image for all maps... say for example... MapnameItemShop.png or MapnameInn.png
the goal is that basically every map has a different png file that would be displayed when the maps change.
I think i am confused... I use the particles though in the plugin. Mogs calls on the Mapname.png in line 283 of the plugin. I want it to call on what ever I specify for that image for when the player enters the map..... not just one image for all maps... say for example... MapnameItemShop.png or MapnameInn.png
the goal is that basically every map has a different png file that would be displayed when the maps change.

Ok it's really easy.
Code:
Map_Name_Hud.prototype.loadBitmap = function() {
    this._layoutImg = ImageManager.loadSystem("MapName" + $gameVariables.value(1));
};
Before transferring map set the variable to a number variable 1 in this case to 1, that would use MapName1 for the image in the system folder, set variable 1 to 2 and then it uses MapName2.
Ok it's really easy.
Code:
Map_Name_Hud.prototype.loadBitmap = function() {
    this._layoutImg = ImageManager.loadSystem("MapName" + $gameVariables.value(1));
};
Before transferring map set the variable to a number variable 1 in this case to 1, that would use MapName1 for the image in the system folder, set variable 1 to 2 and then it uses MapName2.
And that would be a plugin function or a script call in the event?
And that would be a plugin function or a script call in the event?

You put that in a javascript plugin file or overwrite that function in mogs plugin. Then just use control variables in game to set it before transfer.
You put that in a javascript plugin file or overwrite that function in mogs plugin. Then just use control variables in game to set it before transfer.
Can you please show me what the event will look like? once i see it ill be ok. Im just very visual and trying to wrap my head around this lol
Can you please show me what the event will look like? once i see it ill be ok. Im just very visual and trying to wrap my head around this lol
It's just variables then transfer, you may need an image named MapName0 for the first map loaded.
Map.png

Doing that event will make it load MapName1 from system folder.
hmmm it's not working....
hmmm it's not working....View attachment 136094
Did you put the code into a plugin below mogs or replace mogs base script?
Code:
Map_Name_Hud.prototype.loadBitmap = function() {
    this._layoutImg = ImageManager.loadSystem("MapName" + $gameVariables.value(1));
};
i got it! i was just being an idiot and forgot to change the number to the variable i was gonna use for it haha!
lmfaooooooooooo THANK YOU!!

next question is... can i use a plugin command to turn off and on the circle and particles for the map name
?
i got it! i was just being an idiot and forgot to change the number to the variable i was gonna use for it haha!
lmfaooooooooooo THANK YOU!!

next question is... can i use a plugin command to turn off and on the circle and particles for the map name
?

Code:
Map_Name_Hud.prototype.createSprites = function() {
    if (!$gameSwitches.value(1)) {
    if (this.data().circle && this.data().circleZ === 0) {this.createCircle()};
    }
    this.createLayout();
    if (!$gameSwitches.value(1)) {
    if (this.data().circle && this.data().circleZ != 0) {this.createCircle()};
    if (this.data().particles) {this.createParticles()};
    }
    this.createName();
};
In this case if switch 1 is on they won't play both, if you want to control separately just

Code:
Map_Name_Hud.prototype.createSprites = function() {
    if (!$gameSwitches.value(1)) {
    if (this.data().circle && this.data().circleZ === 0) {this.createCircle()};
    }
    this.createLayout();
    if (!$gameSwitches.value(1)) {
    if (this.data().circle && this.data().circleZ != 0) {this.createCircle()};
    }
    if (!$gameSwitches.value(2)) {
    if (this.data().particles) {this.createParticles()};
    }
    this.createName();
};
AWESOME POSSUM! Thank you so much ^.^
a better way is to use of this plugin from Procraftynation.
I dont know if you can use a switch as well to turn it off if the player wish so, but I think
the option was there though.

it draw's the images from the picture folder, anywhere from the map. I love it though 🙂 but you can make every map very unique
to show its own image map or not 🙂
a better way is to use of this plugin from Procraftynation.
I dont know if you can use a switch as well to turn it off if the player wish so, but I think
the option was there though.

it draw's the images from the picture folder, anywhere from the map. I love it though 🙂 but you can make every map very unique
to show its own image map or not 🙂
Oooo ill try this out too... Thank you ^·^

Original thread: https://forums.rpgmakerweb.com/threads/mogs-mapname-js.118870/