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
1,067
Reaction score
1,093
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
367
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
367
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
1,013
Reaction score
501
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
45,498
Reaction score
16,403
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,907
Reaction score
1,869
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);
    }
};

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
1,013
Reaction score
501
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,907
Reaction score
1,869
First Language
English
Primarily Uses
RMMZ
@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
50
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

For some reason a vegan webpage was suggested for me on FB. So I thought let's troll them. Because some of the posters needed a reality check.
I intended to start losing some weight starting today but It's apparently my birthday and I was given 2 big Toblerone's. So....Tomorrow then :p
JR.png
design for 1920's Jazz-singer
(can you guess what character inspired me here? xD )
Another brief AD video. Pretty proud of this.
new to game making and open to any help on getting started

Forum statistics

Threads
129,822
Messages
1,205,510
Members
170,944
Latest member
thiagogoettems
Top