I'm using this random name generator plugin (https://forums.rpgmakerweb.com/index.php?threads/random-actor-and-enemy-names.48337/) and it has the ability to store the generated names in variables, but when I've then tried to set an actor name using the variable the name is stored in it doesn't seem to work. Anyone know what's going wrong? I tried to do it by selecting change actor name and setting it to \v[x].
Setting actor name with a variable
Javascript/Plugin SupportI don't think that shortcut works in the change name event command. You might be easier just using a script command with the following
Where:
id = the id of the actor whose name you're changing
x = the variable that the new name is stored to
Code:
$gameActors.actor(id).setName($gameVariables.value(x))
Where:
id = the id of the actor whose name you're changing
x = the variable that the new name is stored to
Seems like a better way of doing it, I'll give that a try and see if it works
Something still seems to be up, it might just be the plugin I'm not sure
You'll have to explain what the problem is, and we might be able to solve it.
So basically the plugin is meant to saving the random name from whatever list I've put using this plugin command:
RANDOMNAME
- [variable #]
So I used the script calls to then set the actor name to the variable the name from the list has gone into but the name doesn't change.
RANDOMNAME [/list/] [variable #] list without the slashes, they're just there because of the code on the site
I haven't downloaded the plugin, nor am I 100% sure how you're actually using the plugin command. I presume you're trying to get a name from list1 so I'd guess your command should look like this if you're setting variable number 1
Is this what you're doing?
It might be worth checking the value of the variable you're meant to be assigning to by using show text to make sure the variable is actually being assigned something.
Code:
RANDOMNAME list1 1
Is this what you're doing?
It might be worth checking the value of the variable you're meant to be assigning to by using show text to make sure the variable is actually being assigned something.
Yeah just tried displaying the variables but they're still showing as 0 for some reason
I don't think the square brackets are necessary, nor is the word variable. Try replacing your plugin commands with these
It's also worth noting that most plugins will force your plugin commands to either upper or lower case to make sure it doesn't matter how you capitalise things, however, there appears to be no such thing in this one so you'll need to make sure you're copying the names of any lists exactly as they are set up. For instance LIST1 is not the same as list1 or List1.
Code:
RANDOMNAME list1 3
RANDOMNAME list3 50
//and so on
It's also worth noting that most plugins will force your plugin commands to either upper or lower case to make sure it doesn't matter how you capitalise things, however, there appears to be no such thing in this one so you'll need to make sure you're copying the names of any lists exactly as they are set up. For instance LIST1 is not the same as list1 or List1.
The brackets seem to be in the instructions but I'll take out the word variable and see and then if not, I'll try removing the brackets
When I remove the word variable, it comes up with: "TypeError Cannot read property 'split' of undefined"
Have you used the plugin command exactly as I provided? Please try using this Exact plugin command:
I've tested it - it works.
Code:
RANDOMNAME list1 3
I've tested it - it works.
Alright I'll try it without the brackets and see, if not maybe I've just messed up the plugin when I added extra lists or something
It's still giving me the "Cannot read property 'split' of undefined"
I imagine the error is being caused by the name list argument being incorrect. I note in your earlier screenshot that you're trying to use list66 and list68 - these do not exist naturally, so unless your running a script to push them into the parameters they won't work, and will cause this issue. I would advise removing them for the purposes of testing this.
If it still doesn't work can you provide a screenshot of your plugin command?
If it still doesn't work can you provide a screenshot of your plugin command?
The plugin said I could add extra lists which I did in the base script and they seemed to look alright but maybe not, I'll get a screenshot of how the command looks now
Like I said earlier you have to make sure that where there are no capitals in the list's name originally there are none when you use the plugin command. You have used a capital "L" on both plugin commands which means the plugin is looking for something that doesn't exist. Replace the capital "L" with a lower case "l" and that should solve the problem.
The plugin allows you to use notetags to define lists for specific actors or enemies, not new global lists. To make new global lists would require you to add additional plugin parameters by editing the plugins base code.
The plugin allows you to use notetags to define lists for specific actors or enemies, not new global lists. To make new global lists would require you to add additional plugin parameters by editing the plugins base code.
Original thread: https://forums.rpgmakerweb.com/threads/setting-actor-name-with-a-variable.108415/