Change Actor Sprite Plugin

● ARCHIVED · READ-ONLY
Started by Symbol_ 14 posts View original ↗
  1. I need a plugin that allows you to make an event so that the player goes back 1 sprite change. Instead of directly changing the sprite manually to a specific sprite.

    Example of what I'd want. (There'd be multiple armour the player can equip in the game that changes the players look visually)

    Text: Oh no I'm losing my armour!
    Change Actor Sprite: ActorWithoutArmour

    > Player gains the armoured sprite again via quest

    PluginCommand: ChangeActorSpritetoPrevious

    So the game would then remember what sprite the player had last, then change back to the armour they had equipped.
  2. If the armors are forced and the player can't choose their equips, which I assume they can't, it's not too hard to event it by yourself.
  3. Poryg said:
    If the armors are forced and the player can't choose their equips, which I assume they can't, it's not too hard to event it by yourself.

    They can choose their equips. They can choose armour and their looks by equipping them from menu.
  4. Maybe this can help you.

    You could use my WAY_CustomOnEquipEval Plugin. It allows you to run code when the actor equips/unequips items.
    https://www.waynee95.me/way-custom-on-equip-eval/

    To change the graphics when the actor equips an item:
    Just change the test, test2, test3 to the actual filenames.
    Code:
    <Custom On Equip Eval>
    user._prevCharName = user._prevCharName || user._characterName;
    user._prevCharIndex = user._prevCharIndex || user._characterIndex;
    user._prevFaceName = user._prevFaceName || user._faceName;
    user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
    user._prevBattlerName = user._prevBattlerName || user._battlerName;
    
    user.setFaceImage("test", 0);
    user.setCharacterImage("test2", 0);
    user.setBattlerImage("test3");
    user.refresh();
    $gamePlayer.refresh();
    </Custom On Equip Eval>

    This would reset it to the old graphics, when the actor unequips the item:
    Code:
    <Custom On Remove Equip Eval>
    user.setCharacterImage(user._prevCharName, user._prevCharIndex);
    user.setFaceImage(user._prevFaceName, user._prevFaceIndex);
    user.setBattlerImage(user._prevBattlerName );
    user.refresh();
    user._prevCharName = undefined;
    user._prevCharIndex = undefined;
    user._prevFaceName = undefined;
    user._prevFaceIndex = undefined;
    user._prevBattlerName = undefined;
    $gamePlayer.refresh();
    </Custom On Remove Equip Eval>
  5. I don't see how this would help.

    In my game you get turned into a zombie that you can control freely. After a set amount of time, I want the system to then change the player back to the original sprite he had equipped.

    Thanks for trying though
  6. You would control what sprite the player has through internally equipping armor. This would trigger changing to the new sprite and also trigger changing back to the old one when you unequip it.
  7. waynee95 said:
    You would control what sprite the player has through internally equipping armor. This would trigger changing to the new sprite and also trigger changing back to the old one when you unequip it.

    They player wouldn't be unequipping anything. Currently I have the game rigged up so that when the player uses items, it calls common events to change the actor sprite.

    I need it so the system itself uses a parallel process to change the actor sprite after a set amount of time to a previous sprite that the player was originally using before they had gotten changed.
  8. But instead of calling common events you could call the change equip command. This would then trigger the code to change the sprite.
  9. waynee95 said:
    But instead of calling common events you could call the change equip command. This would then trigger the code to change the sprite.

    Even though you can't physically equip these items? They fall under the same items such as potions and antidotes etc What the player is essentially doing in my game is using a potion to change their sprite rather than equipping it.

    Are you saying I should change this system to mean the player equips actual armour itself as equips via the normal menus like a normal game. Then using your plugin to achieve what I want?
  10. Step 1 (save current setup):
    $gameVariables.setValue(1, $gameActors.actor(5).faceName()); // Saves actor 5's face file in variable 1
    $gameVariables.setValue(2, $gameActors.actor(5).characterName()); // Saves actor 5's character file in variable 2
    $gameVariables.setValue(3, $gameActors.actor(5).battlerName()); // Saves actor 5's battler file in variable 3

    Step 2 (remove armor):
    $gameActors.actor(actorId).setCharacterImage("NoArmorCharacterName", index); // Indexes are 0-7, from left to right
    $gameActors.actor(actorId).setFaceImage("NoArmorFaceName", index);
    $gameActors.actor(actorId).setBattlerImage("NoArmorBattlerName");
    $gamePlayer.refresh();

    Step 3 (to change back to previous armor):
    $gameActors.actor(actorId).setCharacterImage($gameVariables.value(1), index);
    $gameActors.actor(actorId).setFaceImage($gameVariables.value(2), index);
    $gameActors.actor(actorId).setBattlerImage($gameVariables.value(3));
    $gamePlayer.refresh();

    Just replace the 5 and actorId with your actor's number.

    Edit: Forgot to add refresh :p
  11. JGreene said:
    Step 1 (save current setup):
    $gameVariables.setValue(1, $gameActors.actor(5).faceName()); // Saves actor 5's face file in variable 1
    $gameVariables.setValue(2, $gameActors.actor(5).characterName()); // Saves actor 5's character file in variable 2
    $gameVariables.setValue(3, $gameActors.actor(5).battlerName()); // Saves actor 5's battler file in variable 3

    Step 2 (remove armor):
    $gameActors.actor(actorId).setCharacterImage("NoArmorCharacterName", index); // Indexes are 0-7, from left to right
    $gameActors.actor(actorId).setFaceImage("NoArmorFaceName", index);
    $gameActors.actor(actorId).setBattlerImage("NoArmorBattlerName");
    $gamePlayer.refresh();

    Step 3 (to change back to previous armor):
    $gameActors.actor(actorId).setCharacterImage($gameVariables.value(1), index);
    $gameActors.actor(actorId).setFaceImage($gameVariables.value(2), index);
    $gameActors.actor(actorId).setBattlerImage($gameVariables.value(3));
    $gamePlayer.refresh();

    Just replace the 5 and actorId with your actor's number.

    Edit: Forgot to add refresh :p

    Is this normal script to use in game? Or is this script to use with the plugin listed above?
  12. Yeah you just use it with script calls. Each step can be put into a separate call.
  13. JGreene said:
    Yeah you just use it with script calls. Each step can be put into a separate call.

    I only need to change the actors sprite, so I wont have to add lines that include the faces and battlers right?
  14. Symbol_ said:
    I only need to change the actors sprite, so I wont have to add lines that include the faces and battlers right?
    Unless you're wanting the new look to be reflected in the menu and in battle, then no.