MV - Show sprite over character on map

● ARCHIVED · READ-ONLY
Started by stramin 17 posts View original ↗
  1. I am looking for a way to put a sprite over the player and follow it.

    For every character I do a lot of copies to add something they are wearing, a weapon, a vehicle, an ambient, a shadow and more, I would like to stop doing this and make a single sprite over them.

    This is what I do now for every character:
    1638116923544.png

    What I want to do is a single character to add over any main hero the player selects:
    1638117259313.png

    So I am looking for a script to do something like this, any script to show a weapon on map or a mirror script to copy player movements.

    Thank you in advance!
  2. This seems like a really sub-optimal way of achieving this effect. It'd be a lot quicker and more efficient for performance to just bake it into different player graphics.
  3. Yes but... I currently have 16 characters, and 5 effects and 16 clothes.

    those are 16 x 21 = 336 characters I have to edit, now I want to add a new effect (for grass floor) so, I have to edit my 16 characters like this:
    1638119075565.png
    to get this effect:
    1638118925386.png

    The character folder is heavy and has too many files because this method.

    it doesn't necessarily have to be an event, I'll edit the topic to specify this.
  4. stramin said:
    Yes but... I currently have 16 characters, and 5 effects and 16 clothes.

    those are 16 x 21 = 336 characters I have to edit, now I want to add a new effect (for grass floor) so, I have to edit my 16 characters like this:
    View attachment 208150
    to get this effect:
    View attachment 208149

    The character folder is heavy and has too many files because this method.
    I get that what you're talking about is labour intensive and you're trying to avoid that work, but by the time you do this and you're running the game on other peoples' hardware their performance will take the hit. Wouldn't you rather do the work to make the game run better?
  5. stramin said:
    now I want to add a new effect (for grass floor)
    why don't you simply use the default bush flag on the tile in the tileset? That creates exactly this effect, but does so by making the bottom pixels of the sprite transparent, allowing the original tile to take precedence.
    Much better solution as it is possible on multiple tiles without needing a tile-specific sprite.

    That said, your original idea is doable by a plugin programmer, you just have to wait until someone has time for this. It is not as sub-optimal as the other poster assumes, but only if done in the correct way (which requires an experienced plugin programmer)
  6. I don't like the default bush flag, it doesn't look like grass, it looks like... water?
    1638124118934.png

    The effect I am doing looks like the character is moving the grass, I like how it is looking :kaojoy:
    1638124221161.png
  7. You might be able to repurpose a Visual Equipment plugin for this, possibly with some trickery using dummy states or equipment to specify the overlay you need. I'm not familiar enough with the options to tell you exactly which plugin(s) would work, but if you search for the term, you should get multiple different ones.
  8. text is a bit long..
    Spoiler
    well srpg does something similar to display E X A over the event sprite..
    (this is the default "srpg set img".. which i replaced in the core with using "e" "x" "a" imgs, to use more charframe usage ,which would conflict with the normal "srpg set img")
    srpg_set.png
    i used the same thing to import the default sv state overlay on map..
    MV - use Sprite_StateOverlay on MapEvents? But our srpg_eventUnits are connected to the battler and we use this connection to adress the sprite character on the event unit.
    And i dont know how to replicate such "battler connection" on normal projects.
    (screenshot from my "Stateoverlay on MapEventBattler" plugin)
    Screenshot_1.png
    "battleUnit" is in real "$gameSystem.EventToUnit(eventID)"
    Screenshot_2.png
    this gives us access to the battler that is connencted to the event
    (this is only where you can start to search to figure out the complete code chain that is needed,for such "battler connection")

    If you got enough JS knowlegde to search in the srpg_core.js..
    (can be found on my github)
    .. for how this battler connection is made.. and how to replicate this connection for your project.. you might be able to do what you are looking for.

    or perhaps you can even solve that without such battler connection,using the "MapEvent eventID" or "gameplayer" instead..
    ,but i dont know how..
    I am sorry that my JS skills are to low for a better advice.


    edit.
    the E X A stuff is handled here: (in the srpg core)
    >incase that might be helpfull to see how the plugin load
    the:
    "e x a imgs" or the "srpg set img"..

    Screenshot_3.png
    edit
    sidenote about: #6
    I think your solution looks pretty good ,way better than the "default bush flag"
  9. This works for optimizing bush terrain to your liking (site's in Japanese, but the plugin has an English translation). I saw a plugin for mine carts, but unfortunately it seems to only be for MZ. Author's script repositry is here if you want to try your hand at editing it for MV compatibility though
  10. Oh, thank you for your answers!

    LadyBaskerville said:
    Visual Equipment
    You are right, I made a search for this in google and I found this:

    Visual Equipment!
    I think this could work, I didn't test it yet.

    dopan said:
    text is a bit long..
    Yes, I think this could work, I will give it a try, It looks hard, but I haven't given up yet. :kaomad2:

    greenrivers said:
    I saw a plugin for mine carts ... but unfortunately it seems to only be for MZ
    I don't know if this is what I am looking for, do you have any screenshot?
  11. I'm afraid not. I haven't tried it in game at all; I just thought I'd drop a link to it just in case it was.
  12. JavaScript:
    SceneManager._scene._spriteset._characterSprites[eventID - 1]
    //(adressed via event id)
    SceneManager._scene._spriteset._characterSprites
    //(adress all)
    code above can be used in console F8 on mapscene to check "spriteset._characterSprites"


    EDIT

    ok i figured it out, how to add an "IMG child Overlay" to the gameplayer, ..
    or to all events..
    (i still need to find a way for,related to event id & other stuff)

    this will put an img over The gameplayer:
    JavaScript:
        // load char img to Character
    var _ImgLoad_Character_setCharacterBitmap = Sprite_Character.prototype.setCharacterBitmap;
        Sprite_Character.prototype.setCharacterBitmap = function() {
              _ImgLoad_Character_setCharacterBitmap.call(this);
              this._imgLoadBitmap = ImageManager.loadCharacter('srpg_set');
        };
            // create Overlay
        Sprite_Character.prototype.createImgLoad = function() {
            if (!this._imgLoad1 ) {
                 this._imgLoad1 = new Sprite();
                 this._imgLoad1.anchor.x = 0.5;
                 this._imgLoad1.anchor.y = 1;
                 this.addChild(this._imgLoad1);
            }
        };
            // update Overlay
        var _ImgLoad_updateCharacterFrame = Sprite_Character.prototype.updateCharacterFrame;
        Sprite_Character.prototype.updateCharacterFrame = function() {
            _ImgLoad_updateCharacterFrame.call(this);
                    var pw = this.patternWidth();
                    var ph = this.patternHeight();
                    var sx = (this.characterPatternX()) * pw;
                    var sy = (this.characterPatternY()) * ph;
                    if (!this._character.eventId) {
                        this.createImgLoad();
                        this._imgLoad1.bitmap = this._imgLoadBitmap;
                        this._imgLoad1.setFrame(sx, sy, pw, ph);
                        this._imgLoad1.visible = true;
                    }
        };
    with removing "!" from "if (!this._character.eventId) { "
    -> the loaded img will be displayed over all Events instead
    (we could add conditions about the positionxy,terrain or whatever to specify,when this should trigger)


    In my case with this code the loaded img is 'srpg_set'
    (can be found in the first function)



    this is not a finished plugin, but this is the working code.
    -> a finished plugin would have several options about which Char_imgs are loaded and which part of the Char_img is used.

    this can be used for a lot of different things, thats why i try to build a plugin out of this


    However you can use this code example as you wish and edit it if needed
    This Setup above will only display the first Char from an default 8Char_sheet img
    im my case its the "cursor"-char: in the spoiler

    Spoiler
    srpg_set.png
    screenshots from mytest project:
    Spoiler
    Here some other imgs to show how this works in my project:
    -> "harold actor1" is the "gameplayer" the other chars are "normal events"


    Screenshot_1.png
    Img above uses the default code posted

    Screenshot_2.png
    img above uses the code with removing "!"



    => if the event is stepping, the cursor does it aswell..
    (if the event doesnt move, the cursor will stand still aswell)
  13. For some reason the F8 console works too slow for me

    The main character id is 2, but I would prefer to use the group leader.

    1638226014730.png

    I don't know where to put the second code you posted :kaoswt2:

    Should I make a new plugin and paste that code?

    How can I set _imgLoadBitmap, _imgLoad1.anchor.x and _imgLoad1.anchor.y from an event?
  14. stramin said:
    For some reason the F8 console works too slow for me

    The main character id is 2, but I would prefer to use the group leader.

    View attachment 208235

    I don't know where to put the second code you posted :kaoswt2:

    Should I make a new plugin and paste that code?
    yes put it in a plugin if you want..

    but you need some experiments to add more "if condtions"..
    to make sure that its displayed on the event you want..

    my example above uses all events, or only the gameplaver..

    ( and with all events i mean every event that has an event id )

    sry this might be a bit impractical for your needs aslong there is no finished plugin,
    with more options..

    -> i just experimented till i got it work.. to figure out if it works at all,..
    But i did not made a full plugin yet.. i just wanted to share the info ,how this works..

    whenever i finish this plugin, i will let you know.. i am a bit busy right now

    edit
    i think "Group Leader" is the same as "gameplayer" if you are walking on map..
  15. Oh, ok, thank you, I will try in a plugin, and I need to figure out how to change this bitmap on demand.
  16. stramin said:
    Oh, ok, thank you, I will try in a plugin, and I need to figure out how to change this bitmap on demand.
    i thought about using several "char_img" in the final plugin .
    -> a 8sheet char img is loaded anyway..
    (but this code only uses the first "char_img" of the 8sheetIMG at the moment)
    so i plan to use all 8 char parts and make different "if conditions" for each one.
    (that way it only triggers when its required)

    also a scriptcall could be added to change the 8sheet img that is loaded..
  17. I just finished the first plugin Version , and i hope its solves this request:

    It allows to add char imgs over the "$gameplayer",..
    related to the Region id of the $gameplayers xy position.

    -> with small modifications this plugin could be used for "events" or "UnitEvents" aswell,..
    ..for example to change the visual clothes/equip depending on any custom "if conditions".

    Here is the current Plugin Version:
    dopanLoad_ImgOnEvent.js
    (basicly it does the same thing, that SRPGcore does on displaying "E X A" from the 'srpg_set' img)

    I currently dont have any "default-Example img" for this plugin




    EDIT
    How can I set _imgLoadBitmap, _imgLoad1.anchor.x and _imgLoad1.anchor.y from an event?
    Screenshot_1.png
    here you can see where the achor is added. this fits for the default map char sprite anchor