Checking a variable in a plugin based on the actor's ID

Discussion in 'Learning Javascript' started by EFizzle, Nov 9, 2017.

Thread Status:
Not open for further replies.
  1. EFizzle

    EFizzle Rum aficionado Veteran

    Messages:
    294
    Likes Received:
    61
    Location:
    Richmond
    First Language:
    English
    Primarily Uses:
    N/A
    I'm a total scrub with JavaScript so bear with me here, like I don't know anything about the language.

    I want to use a variable based on an actor's ID and use the value of that variable to load an image. So basically what I want in game is I'd change that variable's value to get a different image named after the actor's ID and the variable's value.

    I'm using Moghunter's status menu for this, and this is the line that does the loading, I want to know how I'd edit this to add in another + "_" + VariableThingy, yeah

    Code:
    this._bust.bitmap = ImageManager.loadMenusFaces4("Actor_" + this._actor._actorId);
    This make sense?

    OKAY NEVERMIND I THINK I SOLVED IT

    Here's how I did it was like this

    Code:
        var newOutfit= $gameVariables.value(this._actor._actorId);
        this._bust.bitmap = ImageManager.loadMenusFaces4("Actor_" + this._actor._actorId + "_" + newOutfit);
    
    Is there a better way of doing this? I'm not sure if it'll cause any bugs or not
     
    Last edited: Nov 9, 2017
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,969
    Likes Received:
    11,625
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    You haven't given any context - where is this script being run? What is this? What's in that variable, and how/when does the value change?
     
    #2
  3. KravenarGames

    KravenarGames Veteran Veteran

    Messages:
    107
    Likes Received:
    13
    First Language:
    English
    Primarily Uses:
    N/A
    Is there a way to load actor default database face instead of pngs?
     
    #3
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    21,115
    Likes Received:
    10,722
    First Language:
    English
    Primarily Uses:
    RMVXA

    KravenarGames, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



    You are also hijacking a thread. I suggest you start a new thread and give fuller details so that people will have some context for what you are asking.

    Closing, as it appears the OP solved the query.

     
    #4
Thread Status:
Not open for further replies.

Share This Page