Removing an NPC after an event.

Hi guys,

Is there any other way to make an NPC disappear after a cutscene event, beside making a new switch? For example, there are three NPCs in a cutscene. One of them joins the party, after she joins, the old NPC sprite must disappear, right? If I exit the room, the sprite appears again.

I tried using a script to remember their position, but it doesn't work when I change their graphics to "None". I am pretty sure I am not supposed to use self-switch, since it doesn't effect anything beside the event itself.
When I make an event for a disappearing NPC. I always do self switch A, B, C or D, then add a new event page that is blank. The NPC never returns. Hope that helps!
or if you want to control them from another event, switches... unless you wanna control their self switches from another event, though it's only a simple script call:

Code:
$game_self_switches[[map_id,event_id,self switch]] = true/false
If you want the sprite to disappear for good, you need a second page, no graphic on the NPC event itself.  On the first page have it turn self switch A ON at the appropriate moment; your second page has self switch A as a condition (on the left side of the event page).

Ninja'd
When I make an event for a disappearing NPC. I always do self switch A, B, C or D, then add a new event page that is blank. The NPC never returns. Hope that helps!
It works when you talk to the NPC itself. I was talking about when you have another event to handle the cutscene, and the NPCs on the screen are just for show. I used self switches and when I came back, they still reappear, and I doubt self switches are used that way.

or if you want to control them from another event, switches... unless you wanna control their self switches from another event, though it's only a simple script call:

$game_self_switches[[map_id,event_id,self switch]] = true/false
I haven't tried this, yet. Sounds like it might work, but is there a shorter way? 😮
That is the ONLY way to change one event's self switch from another event.


If your NPCs are ONLY there for the cutscene, you can start with a blank event, do a Set Move Route > Change Graphic to show the NPC when they need to appear, and the same again to remove the graphic when it's over.


Other than that, a switch is the only way.


The script you are referring to that causes an event to remember its position makes it remember its position. It is not intended to save graphics or anything else, though it could be modified to do so (though really, it'd be just as easy to use one of the above methods).
but is there a shorter way?
Hmmm... only a wrapper

class Game_Interpreter def ss(map_id,event_id,switch,value) $game_self_switches[[map_id,event_id,switch]]=value endendPut that in a blank script, then you can just use it like (from event commands only or with any Game_Interpreter object):

Code:
ss(1,1,"A",true)
that means Self switch A of Event 1 on map 1 will be truebut really, it's pointless to do this IMO...
^ Nice scripting. 🙂

That is the ONLY way to change one event's self switch from another event.

If your NPCs are ONLY there for the cutscene, you can start with a blank event, do a Set Move Route > Change Graphic to show the NPC when they need to appear, and the same again to remove the graphic when it's over.

Other than that, a switch is the only way.
 
Hm... That could work, but not always, especially when you are transferring from another map. I just want to make sure I am using switch properly and not waste them for a short cutscene.

Thanks all. 🙂
You can still do it, even if transferring from another map. It's all in the type of trigger you use and how you event it.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/removing-an-npc-after-an-event.23541/