Setting actor name with a variable

Discussion in 'Javascript/Plugin Support' started by Bumblefish97, Apr 27, 2019.

  1. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    #1
  2. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't think that shortcut works in the change name event command. You might be easier just using a script command with the following

    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
     
    #2
    caethyril likes this.
  3. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    Seems like a better way of doing it, I'll give that a try and see if it works
     
    #3
  4. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    Something still seems to be up, it might just be the plugin I'm not sure
     
    #4
  5. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    You'll have to explain what the problem is, and we might be able to solve it.
     
    #5
  6. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    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.
     
    #6
  7. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    RANDOMNAME [/list/] [variable #] list without the slashes, they're just there because of the code on the site
     
    #7
  8. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    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

    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.
     
    #8
  9. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
  10. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    Yeah just tried displaying the variables but they're still showing as 0 for some reason
     
    #10
  11. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't think the square brackets are necessary, nor is the word variable. Try replacing your plugin commands with these

    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.
     
    #11
  12. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    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
     
    #12
  13. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    When I remove the word variable, it comes up with: "TypeError Cannot read property 'split' of undefined"
     
    #13
  14. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    Have you used the plugin command exactly as I provided? Please try using this Exact plugin command:

    Code:
    RANDOMNAME list1 3
    I've tested it - it works.
     
    #14
  15. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    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
     
    #15
  16. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    It's still giving me the "Cannot read property 'split' of undefined"
     
    #16
  17. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    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?
     
    #17
  18. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
    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
     
    #18
  19. Bumblefish97

    Bumblefish97 Veteran Veteran

    Messages:
    37
    Likes Received:
    8
    First Language:
    English
  20. Silva

    Silva Scoobityboo Veteran

    Messages:
    268
    Likes Received:
    126
    First Language:
    English
    Primarily Uses:
    RMMV
    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.
     
    #20

Share This Page