Change an actor's face depending on their class

Discussion in 'JS Plugin Requests' started by kwanzaabot, Jun 28, 2017.

  1. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    So I'm working on a monster-raising game, and the whole thing revolves around classes. When an actor "evolves", they change class. I've got it working pretty much flawlessly, and I'm really pleased with it so far.

    However, the main problem with this, is that these monsters have the same face graphic no matter their class! And that's no good.

    I've tried using common events, but so far I have 36 classes, and I'm not even halfway done yet. These are just the "basic" monsters! By the end, I'm aiming for hundreds. So using common events to change their face graphic is going to be incredibly time-consuming.

    Is there a plugin out there where I can just assign a note tag to each class to change their face? Or can someone make one?
    It would save an unbelievable amount of time.
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,908
    Likes Received:
    11,583
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If you name the faces based on the class id, you'd be able to do it via a script call, and just have a small number of common events.
     
    #2
  3. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    Ha... I'm not much of a scripter, I'm afraid.
     
    #3
  4. Slammy

    Slammy Protector of the Library Veteran

    Messages:
    54
    Likes Received:
    46
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    This could be accomplished using Yanfly's Class Change Core quite easily!
    You don't even have to use the core features of the plugin and could disable almost all of them entirely, what you really need is one of the notetags it comes with.

    <Class x Face: filename y>
    ^ This notetag it comes with will pretty much do exactly what you are looking for. The x being the class number in the database and the y being the index of the face sprite (which goes from 0-7)

    Yanfly himself does a much better job of explaining it in the plugins help section, as well as showing some alternative ways of doing the same effect depending on your preferences.
    http://yanfly.moe/2015/11/27/yep-32-class-change-core/

    Hopefully this helps!
     
    #4
  5. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    If I'm reading this correctly, I have to add that tag to the actor, and therefore would have to add a tag for every class to every actor?

    Is there a limit on how many note tags I can use on a single actor? Because like I said, I've got hundreds of classes.
     
    #5
  6. Slammy

    Slammy Protector of the Library Veteran

    Messages:
    54
    Likes Received:
    46
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Yes, you would need to add tags for every class the actors have access too, but it should work fine even with hundreds of classes, though I haven't tested that. So while I can't say for certain I really don't see any issues coming up due to the amount of classes.
     
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,908
    Likes Received:
    11,583
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    You see, the benefit of having a whole forum to help you, is that you don't HAVE to be much of a scripter. You just have to define your rules (give us more information than you have in your opening post - how are you allocating your classes to your actors - how many of each will you have, can ANY actor have ANY class, and will you have a picture for EVERY combination?), name your files correctly, and someone ELSE can give you the script call to use.

    I am a massive fan of not adding big plugins when you only want to use one of the twenty features it provides.
     
    Last edited: Jun 28, 2017
    #7
  8. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    That's fair enough. (And I agree about the big plugins)

    Okay.

    I'm using Soulpour777's "Equip Class Change" plugin. Monsters evolve by finding parts of other monsters, and equipping them, and each armour type represents a different evolutionary stage. However, depending on the stage, you can only equip certain other armour types. So no Mega-levels equipping Rookie parts, to use a Digimon analogy. This is my core gameplay mechanic.

    I'd prefer to use busts in my menu rather than square facesets, and so I've been using SumRndmDde's "Alt Menu Screen: Busts and Icons" plugin. Ideally I'd like to continue using this menu, but I'm open to other bust-capable menus, as long as they aren't too text-heavy. I really like the minimalist approach using icons that this menu provides.

    I'm also using SumRndmDde's "Copy Actors" to cut down on the amount of actors I need to rely on. I'm not 100% married to this plugin, but it's pretty handy.

    So, to sum it up, I need:
    • A plugin that's compatible with these
    • Changes busts, not facesets
    • Also reflects these changed faces/busts in battle, as I'm shopping around for an XP-style front-view battle system (saves me hunting down hundreds of spritesheets)
    • Changes faces through a notetag that's attached to the class, not the actor. This will save a lot of time in the long run, as I'll be able to find other notetags more easily, instead of scrolling to the bottom of a very, very long list.
    I've included a link to my WIP project here, too.

    If there's any more information you need, just ask.
     
    #8
  9. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    Just an update: the above WIP is missing some (all) of the RTP graphics. With everything included, it was about 200MB. I'm new to MV, so I'm not sure how to package it without bloating the file size. I'm used to VX and XP, so I didn't realise I needed to include all the default stuff.

    Give me a little while and I'll upload a more "complete" file, if needed.
     
    #9
  10. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    EDIT: my bad, I forgot about the 72 hour bump limit.
     
    #10
  11. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    Bumping as I'm still interested.
    Any help regarding what this script call might be, Shaz?
     
    #11
  12. Shaz

    Shaz Veteran Veteran

    Messages:
    37,908
    Likes Received:
    11,583
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Sorry - I didn't download the project, and don't plan to - just don't have time.

    If you can answer the questions I asked, it'll give me enough information to either point you in the right direction, or ask more questions for further clarification.
     
    #12
  13. kwanzaabot

    kwanzaabot Veteran Veteran

    Messages:
    62
    Likes Received:
    13
    First Language:
    English
    Yes, any actor can have any class, in theory. Classes depend on what items they have equipped -- hold a "Mage Shield", and your class changes to Mage. Hold a "Warrior Helmet", your class changes to Warrior-- but certain classes can only hold certain items, so Mages can evolve to Warrior or Priest, but Warriors can't evolve to Priest, because their traits have a Lock Equip flag on "Priest Robes". It's sort of a branching evolutionary tree.

    There's only one class per actor, so one picture per actor. No subclasses here. There can be multiples of the same class within the party, if you have multiples of the correct class-changing equipment.

    And as I said, well over 100 classes. Right now I'm up to around 50, with more planned.
     
    #13
  14. Shaz

    Shaz Veteran Veteran

    Messages:
    37,908
    Likes Received:
    11,583
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Well, what you could do, if you were using faces, is to have a single face sheet for each actor, with an image for each of the classes. So if you have 20 actors, you'll have 20 face sheets. And if you have 100 classes, each of those sheets will have 100 face images. By default, the Show Text command only lets you choose from the first 8, but a few people experimented with just adding more and more rows, and though you can't select them in Show Text, you can do it via script. You might need to be careful using busts, because there's a limit to image size with MV.

    The command you're interested in (in a Script call) is this:
    Code:
    actor.setFaceImage(faceName, faceIndex);
    How you get actor depends on where you're going to do the script call. Instead of actor you could use $gameActors.actor(id) where id is the actor's id in the database (don't use leading zeros).

    If you just have a single face image for each actor, and that's already been set in the database, then faceName could simply be $gameActors.actor(id).faceName().

    And faceIndex would just be the class Id minus 1 (in the database, classes start with id 1, but in the face image, the first face is at index 0). So you could use $gameActors.actor(id)._classId (that's a little different to the commands above, but there is no function defined for actors that returns the class id).


    So if you want to set actor 5's face image to class 18, you would use the following script call:
    Code:
    $gameActors.actor(5).setFaceImage($gameActors.actor(5).faceName(), $gameActors.actor(5)._classId - 1);

    Now, you said you're using busts instead of faces, and you have a plugin for that. So the above command might still work (if the bust plugin just uses the actor's face name and index and expects the images to be in the same format), or you might have to change the command completely, depending on how the bust plugin works. Take a look at it and see if you can see any function with similar arguments.
     
    #14

Share This Page