stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
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!
 

Attachments

  • 1638116991704.png
    1638116991704.png
    14.1 KB · Views: 6
Last edited:

Iron_Brew

Veteran
Veteran
Joined
Nov 19, 2021
Messages
740
Reaction score
2,153
First Language
English
Primarily Uses
RMMV
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.
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
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.
 

Iron_Brew

Veteran
Veteran
Joined
Nov 19, 2021
Messages
740
Reaction score
2,153
First Language
English
Primarily Uses
RMMV
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,464
Reaction score
10,888
First Language
German
Primarily Uses
RMMV
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)
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
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
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
705
Reaction score
644
First Language
German
Primarily Uses
RMMV
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.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,330
Reaction score
713
First Language
German
Primarily Uses
RMMV
text is a bit long..
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..
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"
 
Last edited:

greenrivers

Pixel Artist
Member
Joined
Feb 23, 2021
Messages
26
Reaction score
116
First Language
english
Primarily Uses
RMMZ
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
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
Oh, thank you for your answers!

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


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

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:

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?
 

greenrivers

Pixel Artist
Member
Joined
Feb 23, 2021
Messages
26
Reaction score
116
First Language
english
Primarily Uses
RMMZ
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.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,330
Reaction score
713
First Language
German
Primarily Uses
RMMV
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

srpg_set.png
screenshots from mytest project:
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)
 
Last edited:

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
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?
 
Last edited:

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,330
Reaction score
713
First Language
German
Primarily Uses
RMMV
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..
 

stramin

Veteran
Veteran
Joined
Nov 4, 2012
Messages
372
Reaction score
184
First Language
spanish
Primarily Uses
N/A
Oh, ok, thank you, I will try in a plugin, and I need to figure out how to change this bitmap on demand.
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,330
Reaction score
713
First Language
German
Primarily Uses
RMMV
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..
 

dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
1,330
Reaction score
713
First Language
German
Primarily Uses
RMMV
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
 
Last edited:

Latest Threads

Latest Profile Posts

I gave away my Game Boy Advance when I got a Nintendo DS, but I kept all the games for it and the carrying case. I still have all of them! :smile:

It also came with this travel accessory pack:

Game Boy Travel Pak.png
Hello everyone. I plan to post a nostalgic video game commercial tomorrow, but today I wanted to share some of my precious childhood gaming memories with you all if you're interested. Here's the silver Game Boy Advance SP I got for my birthday when I was ten:

My Childhood Silver Game Boy Advance SP.png
Hello everyone, I'm back again! :kaohi:
Uggghhhh. Getting ideas to uphold a YouTube channel is hard.
Just adding the 'mimic' to the demonpot, it moves and boops like mad. Love it, also why does the rtp in MZ not have a pot character? It's like a perfect trap.

Forum statistics

Threads
131,664
Messages
1,222,034
Members
173,406
Latest member
midnight_lol
Top