DeadSchrodinger

Villager
Member
Joined
Feb 14, 2021
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMZ
Is there a way to have a character's name be associated with a map?

If my character, Ty visits a specific map, i want it to say "Ty's House", not "\N[10]'s House"

Is that possible?

1616366262708.png
 

Sword_of_Dusk

Ace Attorney
Veteran
Joined
Sep 13, 2015
Messages
472
Reaction score
506
First Language
English
Primarily Uses
RMMV
Is there a reason you can't just call it Ty's House?
 

JGreene

Veteran
Veteran
Joined
Oct 24, 2015
Messages
452
Reaction score
363
First Language
English
Primarily Uses
RMMV
You can use \v[1]'s House as your map name, while setting your variable using this script call: $gameActors.actor(x).name()

Where x is replaced by your actor's ID. Be sure to set their new name before going into the house map or it will just display something like 0's House.
 

DeadSchrodinger

Villager
Member
Joined
Feb 14, 2021
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMZ
You can use \v[1]'s House as your map name, while setting your variable using this script call: $gameActors.actor(x).name()

Where x is replaced by your actor's ID. Be sure to set their new name before going into the house map or it will just display something like 0's House.
Hey! Thanks for the reply. I'm trying that option, but I'm not sure what I'm doing wrong.

1616371757569.png

I have a starting switch changing the variable to the actor name.

1616371794139.png

I tried using upper case and lower case Vs.
But the wording is still "\V[201]"

1616371881180.png
 

JGreene

Veteran
Veteran
Joined
Oct 24, 2015
Messages
452
Reaction score
363
First Language
English
Primarily Uses
RMMV
I don't have MZ, but I assumed the coding was similar. Does it support text codes by default? Or is there an equivalent to Yanfly's Message Core?

Also, the "Name" field for the map won't change in your editor. Only the "Display Name" in game. If the text code is supported that is.
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
967
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
This is because the "Display Name" is an "Object" (JSON File):
JavaScript:
$dataMap.displayName

Return: "Your Display Name Map".

Provisional solution:
Create a new project to test this:
Change Display Name of Map "Player" to:
Code:
Player House

Open the rpg_windows.js file in any text editor.
Search using Ctrl + F for the following term:
Code:
if ($gameMap.displayName())

Replace the line...
Code:
this.drawText($gameMap.displayName(), 0, 0, width, 'center');
...to...
Code:
if($gameMap.displayName() == "Player House"){
    this.drawText($gameActors.actor(1).name() + "'s House", 0, 0, width, 'center');
}else{
    this.drawText($gameMap.displayName(), 0, 0, width, 'center');
}

I don't have RpgMZ and I don't even intend to buy it for now, but from what I saw many things were the same as RpgMV.

So I'm sorry if it doesn't work.
 

DeadSchrodinger

Villager
Member
Joined
Feb 14, 2021
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMZ
I found a few people trying to do the same thing,
and a few plugins that only work for MV apparently.

 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,637
Reaction score
15,723
First Language
English
Primarily Uses
RMMV

@DeadSchrodinger , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.



Please make a post in the VS Support thread if you want the VisuStella team to answer your questions about their plugins.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,852
Reaction score
1,798
First Language
English
Primarily Uses
RMMV
I think people might be overthinking this a bit. Just make a new text file, rename it "MapNameEx.js" and then paste the following into it. Save it into your plugins folder, enable it like you would any other plugin, and ta-da, you now have access to the drawTextEx set of text codes for map names.

Code:
Window_MapName.prototype.refresh = function() {
    this.contents.clear();
    if ($gameMap.displayName()) {
        const width = this.innerWidth;
        this.drawBackground(0, 0, width, this.lineHeight());
        this.drawTextEx($gameMap.displayName(), 0, 0, width);
    }
};

1616408186395.png

You can credit me if you want but it's not necessary. This was just changing 1 line of code and I already knew exactly where to look. 30 seconds of work tops. ;) (Making that sample image took more time, actually!)
 

DeadSchrodinger

Villager
Member
Joined
Feb 14, 2021
Messages
21
Reaction score
5
First Language
English
Primarily Uses
RMMZ
I think people might be overthinking this a bit. Just make a new text file, rename it "MapNameEx.js" and then paste the following into it. Save it into your plugins folder, enable it like you would any other plugin, and ta-da, you now have access to the drawTextEx set of text codes for map names.

Code:
Window_MapName.prototype.refresh = function() {
    this.contents.clear();
    if ($gameMap.displayName()) {
        const width = this.innerWidth;
        this.drawBackground(0, 0, width, this.lineHeight());
        this.drawTextEx($gameMap.displayName(), 0, 0, width);
    }
};


You can credit me if you want but it's not necessary. This was just changing 1 line of code and I already knew exactly where to look. 30 seconds of work tops. ;) (Making that sample image took more time, actually!)

OMG that worked!!!!

Thank you so much! And I am totally crediting you for that marvelous little bit of coce!
 

Dev_With_Coffee

Veteran
Veteran
Joined
Jul 20, 2020
Messages
967
Reaction score
470
First Language
PT-BR
Primarily Uses
RM2k3
@Aesica: I didn't even think I could do it in a separate file, using it as a plugin. I just don't understand how you accepted the elements using "\".

@DeadSchrodinger: Did my idea not work?
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,852
Reaction score
1,798
First Language
English
Primarily Uses
RMMV
@Aesica: I didn't even think I could do it in a separate file, using it as a plugin. I just don't understand how you accepted the elements using "\".
That's pretty much how plugins work. :)

If the base files (rpg_*.js or rmmz_*.js) have this function:
Code:
Game_Something.prototype.doStuff = function()
{
   console.log("Hello!");
};

And you make a plugin with

Code:
Game_Something.prototype.doStuff = function()
{
   console.log("Hello World!");
};

The plugin version is executed after the rpg/rmmz files, causing it to overwrite the base function. So when you run the doStuff function, it'll say "Hello!" without any plugins or if the plugin is disabled, or "Hellow World" if the plugin is installed and enabled.

Generally you always want to make changes to the core files through plugins instead of directly in the core files themselves, because if you ever go to update your project with newer, updated versions of rpgmaker's core files (with bugfixes or other optimizations) your changes to any edited core files will be lost.

Edit: As for accepting text codes, Window_Base has two functions for writing text: drawText() which is a simple command to write basic text, and drawTextEx() which is the one that renders text codes, icons, etc. Both have their uses, but in the case of map names, I'm honestly not sure why they went with drawText over drawTextEx.
 

busbuzz

Veteran
Veteran
Joined
Jun 17, 2021
Messages
168
Reaction score
47
First Language
English
Primarily Uses
RMMZ
Window_MapName.prototype.refresh = function() { this.contents.clear(); if ($gameMap.displayName()) { const width = this.innerWidth; this.drawBackground(0, 0, width, this.lineHeight()); this.drawTextEx($gameMap.displayName(), 0, 0, width); } };
Thank you soooo much
 

Latest Threads

Latest Posts

Latest Profile Posts

Some drawings I made in Lapis, one day I intend to involve them in some RPG Maker project.
* maybe two wall frames
*or some sprite flower tiara, or maybe it inspires someone to do something.
bdd19b62e539d17b3b00cc3d63034f7d.jpg

fcca5c8471b34483da8e032cfe579275.jpg
Step by step, I am coming back.

memorial.png
MasterTenchi wrote on Pixeldrama's profile.
Do you happen to have any of the two lockpicking minigames in RPG Maker MZ format?
I'd love to use them both in my game, and the only ones I've found are yours, but they are in MV format. Strange no one has made a single one for MZ yet. I am hoping you have - but just on the down-low.
SF_People2_8 added!
index.php

1642338286154.png
Trying to draw some pixel art cliffs. Which side looks better, left or right?

Forum statistics

Threads
118,415
Messages
1,115,778
Members
155,362
Latest member
Black-Man
Top