MV Looking for a simple plugin.

Hello, I am looking for a plugin that makes events (or NPC in this case) transparent initially without having to autorun the event first via movement route. It's really weird when you can set the event to Through On initially but not on transparent.

I know you can achieve this with Switch, but in my case it's a hassle to tie 1 switch to 1 npc. Like, what should I do when there's like 100+ npc characters throughout different maps? There's no way I would create 100 switches for that. I only use switch if the NPC is very important.



Thanks in advance!
you could also do it through moveroute custom, but depending how you
want it to work, but I do see the exact purpose of it.

creating a comment or notetag for those event's with transpacity is easy
to make, first page has it, and 2nd might not, while notetag is always active.

I can try to make plugin for it, but do you want a comment tag like
<opacity: 150> or <opacity>
the first one is custom set while the 2nd is fixed.
if you want it also be fully visible over time, I can make a comment tag of it.
So not knowing the full purpose or reason I assume you want each NPC, out of 12 to have to be transparent.

Then each NPC turns to to normal one at a time?

This would require some individually for them either way unless, say 3 NPCs turn to normal at once?

But yeah you could do 1st page, no image, then 2nd page with a switch for that NPC.
Like @ShadowDragon said, use an autorun event in every map (or a common event) you want to set opacity of NPCs. Run a script check in it:

Code:
$gameMap.events().forEach(function(e){
  var m = e.event().note.match(/\<opacity:([0-9]+)\>/i);
   if(m){
    e.setOpacity(Number(m[1]));
}
});
And make a note tag like <opacity:123> for the NPC.

My own project uses a json like string as tag, but it is similar.
{opacity:123}
Why not simply make the first event page have no image? Then, under whatever condition you would turn the transparency off, you instead make them move to the next page with an image.

@utunnels It would be better practice to set the _transparent property on the events.

Modifying the sprite opacity like that means in order to undo it and make them visible, the OP would have to use another script call. If you use the built in property, then you can use event commands as expected.
Like @ShadowDragon said, use an autorun event in every map (or a common event) you want to set opacity of NPCs. Run a script check in it:

Code:
$gameMap.events().forEach(function(e){
  var m = e.event().note.match(/\<opacity:([0-9]+)\>/i);
   if(m){
    e.setOpacity(Number(m[1]));
}
});
And make a note tag like <opacity:123> for the NPC.

My own project uses a json like string as tag, but it is similar.
{opacity:123}

Let me refine that for you 🙂

Code:
$gameMap.events()
  .filter(event => 'opacity' in event.event().meta)
  .forEach(event => event.setOpacity(Number(event.event().meta.opacity))
@ATT_Turan
Oh he said transparent, not semi-transparent.
After reading the other post I thought he wanted an opacity tag. 😅
Let me refine that for you 🙂
What's the purpose/benefit of the double iteration from filter() and forEach()?

Code:
$gameMap.events().forEach(event => {
    if (event.event().meta.opacity != undefined) event.setOpacity(Number(event.event().meta.opacity))})
What's the purpose/benefit of the double iteration from filter() and forEach()?

Code:
$gameMap.events().forEach(event => {
    if (event.event().meta.opacity) event.setOpacity(Number(event.event().meta.opacity))})

It's just easier to read IMO.

Also, if(... opacity) will return FALSE when you type <opacity: 0> and simply skip this one, so either write if (meta.opacity || 0 === meta.opacity) or if ('opacity' in meta)
Also, if(... opacity) will return FALSE
Good call. I think it's easiest to go with != undefined

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-simple-plugin.169943/