No, because the sprites are loaded with the map, so the viewport can only be set upon entering a map. You can use a switch to control it, like this:
CODE
def create_characters
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push(sprite)
end
for vehicle in $game_map.vehicles
sprite = Sprite_Character.new(@viewport1, vehicle)
@character_sprites.push(sprite)
end
#### The control switch is set here
# Replace 56 by the real switch ID
vp = $game_switches[56] ? @viewport2 : @viewport1
@character_sprites.push(Sprite_Character.new(vp, $game_player))
end
In this example, the player will be excluded only if the 56th switch is ON. But then again, the effect only takes place if you transfer to another map.