I've been working with Hakuen to see if we could solve an error that keeps happening, but nothing works. I already have all the files linked in plugin settings and the generators made, but when the scene opens, it just crashes and says "str.replaceall is not a function". I tried using his sample project to troubleshoot this, but the project won't even run, and it just outputs the error. Anybody know what's going on?
MZ Problem with Hakuen Studio's Character Generator Plugin (str.replaceall is not a function)
Javascript/Plugin SupportThe person to troubleshoot this would be @Eliaquim himself since it's a paid plugin. If his demo project isn't working fresh off downloading it he needs to know.
Some generic troubleshooting advice, based on that console screenshot:
- Try copying this exact code onto a new line on the Console tab, then press Enter:
"".replaceAll
You should get this, demonstrating that the runtime recognisesString#replaceAll:
ƒ replaceAll() { [native code] }
If not (e.g. if it saysundefinedinstead), then I'm guessing you've attempted to modify your NWJS runtime at some point? The playtest app that ships with the current version of MZ supportsString#replaceAll, barely; MV's does not support it.
- If that looks OK then the issue is that the function on line 854 of EliMZ_Book is being given a value of
strthat is expected to be a string, but isn't.
String#replace with a function replacer, e.g. as seen in String#format, rmmz_core.js.).replaceAll() DOES work in MV, at least on my end with 1.6.x version.
+ I use 0.48 version of NWJS, so it might not work in 1.5.x of MV version,
or lower NWJS, but for me, that function works without issue as I use it.
NWJS is the runtime environment for playtest and standalone deployment.
I'm using version 1.6.3a of RPG Maker MV through Steam, I have never attempted to modify my NWJS version, manually or otherwise, and my playtest environment has
process.versions.nw = 0.29.4...which does not support String#replaceAll, as I tested before posting my previous reply. By contrast, MZ returns process.versions.nw = 0.48.4 for me.The OP's question is about MZ and they seem to be running the MZ playtest: extension "njg...", rather than MV's "odl...". I only mentioned the MV thing to emphasise the "barely" part of MZ's support for that function.
It could be that @Pixelbird14 is using an old editor version, though? I don't know if MZ has supported
replaceAll since release...the core scripts just use replace with g-flagged RegExp's instead.Hi there!
As I told you on itch io, add me on dixcord so we can solve this.
To proper troubleshoot using the sample project, you need to:
I suspect that either is something wrong with the name of a generator you created or there is no "-4" Subject ID on your map. A "-4" Subject ID points out to a party member. See the help file to better understand the Subject ID argument of the plugin command.
If you still not able to solve this, I already accepted your dixcord request. As so, create a project where you can replicate the problem, upload it somewhere, and send me the link on dixcord so I can see the project, see the problem happening and track down the error.
As I told you on itch io, add me on dixcord so we can solve this.
To proper troubleshoot using the sample project, you need to:
- Remember to copy and paste the Character Generator Plugin inside the plugin folder of the sample project.
- Then, activate the Character Generator on the Plugin Manager.
- Now you can go to the Character Generator map and see the plugin commands.
I suspect that either is something wrong with the name of a generator you created or there is no "-4" Subject ID on your map. A "-4" Subject ID points out to a party member. See the help file to better understand the Subject ID argument of the plugin command.
If you still not able to solve this, I already accepted your dixcord request. As so, create a project where you can replicate the problem, upload it somewhere, and send me the link on dixcord so I can see the project, see the problem happening and track down the error.
The url is generated using the app's name in package.json
"name": "rmmz-game"MV has that field left empty so I guess that's the reason why it is always odl...
Original thread: https://forums.rpgmakerweb.com/threads/problem-with-hakuen-studios-character-generator-plugin-str-replaceall-is-not-a-function.173905/