[Script] Lichteffekte
	
	
		Anstoß für dieses Script gab schmoggi (http://www.multimediaxis.de/threads/...ackel-%28XP%29 )
	PHP-Code:
	
#==============================================================================
 $legacy_engine  = {} if  $legacy_engine . nil ?
 $legacy_engine [ "Basic Movement" ] =  true
 #==============================================================================
 class  Game_Map
 #--------------------------------------------------------------------------
 def passable ?( x ,  y ,  d ,  self_event  =  nil )
 false unless valid ?( x ,  y )
 bit  = ( 1  << ( d  /  2  -  1 )) &  0x0f
 for  event in event_list
 =  passable_event ( x ,  y ,  event ,  self_event ,  bit )
 result  if  result  !=  nil
 for  i in  [ 2 ,  1 ,  0 ]
 result  =  passable_tile ( x ,  y ,  i ,  bit )
 result  if  result  !=  nil
 return  true
 #--------------------------------------------------------------------------
 def passable_event ( x ,  y ,  event ,  self_event ,  bit )
 event_tile ?( x ,  y ,  event ,  self_event )
 false  if @ passages [ event . tile_id ] &  bit  !=  0
 return  false  if @ passages [ event . tile_id ] &  0x0f  ==  0x0f
 return  true   if @ priorities [ event . tile_id ] ==  0
 return  nil
 #--------------------------------------------------------------------------
 def event_tile ?( x ,  y ,  event ,  self_event )
 event . tile_id  >=  0  and  event  !=  self_event  and
 event . x  ==  x  and  event . y  ==  y  and  not event . through )
 end
 #--------------------------------------------------------------------------
 def passable_tile ( x ,  y ,  i ,  bit )
 tile_id  =  data [ x ,  y ,  i ]
 false  if  tile_id  ==  nil
 return  false  if @ passages [ tile_id ] &  bit  !=  0
 return  false  if @ passages [ tile_id ] &  0x0f  ==  0x0f
 return  true   if @ priorities [ tile_id ] ==  0
 return  nil
 #--------------------------------------------------------------------------
 def valid ?( x ,  y )
 x  =  round_x ( x )
 y  =  round_y ( y )
 x  >=  0  and  x  <  width  and  y  >=  0  and  y  <  height )
 end
 #--------------------------------------------------------------------------
 def valid_real ?( x ,  y )
 x  >=  0  and  x  <  width  *  128  and  y  >=  0  and  y  <  height  *  128 )
 end
 #--------------------------------------------------------------------------
 def update
 if  $game_map . need_refresh
 #--------------------------------------------------------------------------
 def update_scroll
 if @ scroll_rest  >  0
 =  2  ** @ scroll_speed
 case @ scroll_direction
 ( distance )
 when 4 then scroll_left ( distance )
 when 6 then scroll_right ( distance )
 when 8 then scroll_up ( distance )
 end
 @ scroll_rest  -=  distance
 #--------------------------------------------------------------------------
 def update_events
 for  event in  @ events . values
 . update
 for  common_event in  @ common_events . values
 . update
 #--------------------------------------------------------------------------
 def update_fog
 @ fog_ox  -= @ fog_sx  /  8.0
 @ fog_oy  -= @ fog_sy  /  8.0
 if @ fog_tone_duration  >=  1
 = @ fog_tone_duration
 = @ fog_tone_target
 @ fog_tone . red  = (@ fog_tone . red  * ( d  -  1 ) +  target . red ) /  d
 @ fog_tone . green  = (@ fog_tone . green  * ( d  -  1 ) +  target . green ) /  d
 @ fog_tone . blue  = (@ fog_tone . blue  * ( d  -  1 ) +  target . blue ) /  d
 @ fog_tone . gray  = (@ fog_tone . gray  * ( d  -  1 ) +  target . gray ) /  d
 @ fog_tone_duration  -=  1
 if @ fog_opacity_duration  >=  1
 = @ fog_opacity_duration
 @ fog_opacity  = (@ fog_opacity  * ( d  -  1 ) + @ fog_opacity_target ) /  d
 @ fog_opacity_duration  -=  1
 #--------------------------------------------------------------------------
 def event_list
 return  events . values
 #--------------------------------------------------------------------------
 def adjust_x ( x )
 x  - @ display_x
 #--------------------------------------------------------------------------
 def adjust_y ( y )
 y  - @ display_y
 #--------------------------------------------------------------------------
 def round_x ( x )
 x
 #--------------------------------------------------------------------------
 def round_y ( y )
 y
 #==============================================================================
 class  Game_Character
 #--------------------------------------------------------------------------
 attr_accessor  : sprite
 : move_speed
 #--------------------------------------------------------------------------
 def passable ?( x ,  y ,  d )
 old_x  =  $game_map . round_x ( x )
 old_y  =  $game_map . round_y ( y )
 new_x  =  $game_map . round_x ( x  + ( d  ==  6  ?  1  :  d  ==  4  ? - 1  :  0 ))
 new_y  =  $game_map . round_y ( y  + ( d  ==  2  ?  1  :  d  ==  8  ? - 1  :  0 ))
 false unless $game_map . valid ?( new_x ,  new_y )
 true  if @ through
 return  false unless $game_map . passable ?( old_x ,  old_y ,  d ,  self )
 false unless $game_map . passable ?( new_x ,  new_y ,  10  -  d )
 event in $game_map . event_list
 if  event . x  ==  new_x  and  event . y  ==  new_y
 . through
 return  false  if  self  !=  $game_player  or  event . character_name  !=  ""
 end
 if  $game_player . x  ==  new_x  and  $game_player . y  ==  new_y
 return  false  if @ character_name  !=  ""  and  not $game_player . through
 return  true
 #--------------------------------------------------------------------------
 def moving ?
 real_x  != @ x  *  128  + @ move_x  or @ real_y  != @ y  *  128  + @ move_y )
 end 
 #--------------------------------------------------------------------------
 def moveto ( x ,  y )
 x  =  x  %  $game_map . width
 @ y  =  y  %  $game_map . height
 @ real_x  = @ x  *  128
 @ real_y  = @ y  *  128
 @ prelock_direction  =  0
 @ move_x  =  0
 @ move_y  =  0
 #--------------------------------------------------------------------------
 def move_down ( turn_enabled  =  true ,  steping  =  false )
 turn_down  if  turn_enabled
 if  passable_down ?
 step_down
 else
 check_event_trigger_touch (@ x , @ y  +  1 )
 end
 #--------------------------------------------------------------------------
 def move_left ( turn_enabled  =  true ,  steping  =  false )
 turn_left  if  turn_enabled
 if  passable_left ?
 step_left
 else
 check_event_trigger_touch (@ x  -  1 , @ y )
 end
 #--------------------------------------------------------------------------
 def move_right ( turn_enabled  =  true ,  steping  =  false )
 turn_right  if  turn_enabled
 if  passable_right ?
 step_right
 else
 check_event_trigger_touch (@ x  +  1 , @ y )
 end
 #--------------------------------------------------------------------------
 def move_up ( turn_enabled  =  true ,  steping  =  false )
 turn_up  if  turn_enabled
 if  passable_up ?
 step_up
 else
 check_event_trigger_touch (@ x , @ y  -  1 )
 end
 #--------------------------------------------------------------------------
 def move_lower_left ( turn_enabled  =  true ,  steping  =  false )
 turn_lower_left  if  turn_enabled
 if  passable_lower_left ?
 step_lower_left
 ?
 step_left
 ?
 step_down
 else
 check_event_trigger_touch (@ x  -  1 , @ y  +  1 )
 end
 #--------------------------------------------------------------------------
 def move_lower_right ( turn_enabled  =  true ,  steping  =  false )
 turn_lower_right  if  turn_enabled
 if  passable_lower_right ?
 step_lower_right
 ?
 step_right
 ?
 step_down
 else
 check_event_trigger_touch (@ x  +  1 , @ y  +  1 )
 end
 #--------------------------------------------------------------------------
 def move_upper_left ( turn_enabled  =  true ,  steping  =  false )
 turn_upper_left  if  turn_enabled
 if  passable_upper_left ?
 step_upper_left
 ?
 step_left
 ?
 step_up
 else
 check_event_trigger_touch (@ x  -  1 , @ y  -  1 )
 end
 #--------------------------------------------------------------------------
 def move_upper_right ( turn_enabled  =  true ,  steping  =  false )
 turn_upper_right  if  turn_enabled
 if  passable_upper_right ?
 step_upper_right
 ?
 step_right
 ?
 step_up
 else
 check_event_trigger_touch (@ x  +  1 , @ y  -  1 )
 end
 #--------------------------------------------------------------------------
 def jump ( x_plus ,  y_plus )
 x_plus  !=  0  or  y_plus  !=  0
 if  x_plus . abs  >  y_plus . abs
 <  0  ?  turn_left  :  turn_right
 else
 y_plus  <  0  ?  turn_up  :  turn_down
 = @ x  +  x_plus
 = @ y  +  y_plus
 if  passable_jump ?( new_x ,  new_y ,  x_plus ,  y_plus )
 jump_move ( new_x ,  new_y ,  x_plus ,  y_plus )
 end
 #--------------------------------------------------------------------------
 def passable_jump ?( new_x ,  new_y ,  x_plus ,  y_plus )
 true  if  x_plus  ==  0  and  y_plus  ==  0
 return  true  if  passable ?( new_x ,  new_y ,  0 )
 false
 #--------------------------------------------------------------------------
 def jump_move ( new_x ,  new_y ,  x_plus ,  y_plus )
 straighten
 @ x  =  new_x
 @ y  =  new_y
 =  Math . sqrt ( x_plus  *  x_plus  +  y_plus  *  y_plus ). round
 @ jump_peak  =  10  +  distance  - @ move_speed
 @ jump_count  = @ jump_peak  *  2
 @ stop_count  =  0
 #--------------------------------------------------------------------------
 def passable_down ?
 passable ?(@ x , @ y ,  2 )
 end
 #--------------------------------------------------------------------------
 def passable_left ?
 passable ?(@ x , @ y ,  4 )
 end
 #--------------------------------------------------------------------------
 def passable_right ?
 passable ?(@ x , @ y ,  6 )
 end
 #--------------------------------------------------------------------------
 def passable_up ?
 passable ?(@ x , @ y ,  8 )
 end
 #--------------------------------------------------------------------------
 def passable_lower_left ?
 passable ?(@ x , @ y ,  2 ) and  passable ?(@ x , @ y  +  1 ,  4 )) and
 passable ?(@ x , @ y ,  4 ) and  passable ?(@ x  -  1 , @ y ,  2 )))
 end  
 #--------------------------------------------------------------------------
 def passable_lower_right ?
 passable ?(@ x , @ y ,  2 ) and  passable ?(@ x , @ y  +  1 ,  6 )) and
 passable ?(@ x , @ y ,  6 ) and  passable ?(@ x  +  1 , @ y ,  2 )))
 end
 #--------------------------------------------------------------------------
 def passable_upper_left ?
 passable ?(@ x , @ y ,  8 ) and  passable ?(@ x , @ y  -  1 ,  4 )) and
 passable ?(@ x , @ y ,  4 ) and  passable ?(@ x  -  1 , @ y ,  8 )))
 end  
 #--------------------------------------------------------------------------
 def passable_upper_right ?
 passable ?(@ x , @ y ,  8 ) and  passable ?(@ x , @ y  -  1 ,  6 )) and
 passable ?(@ x , @ y ,  6 ) and  passable ?(@ x  +  1 , @ y ,  8 )))
 end
 #--------------------------------------------------------------------------
 def step_down ( steping  =  false )
 turn_down
 @ y  +=  1
 #--------------------------------------------------------------------------
 def step_left ( steping  =  false )
 turn_left
 @ x  -=  1
 #--------------------------------------------------------------------------
 def step_right ( steping  =  false )
 turn_right
 @ x  +=  1
 #--------------------------------------------------------------------------
 def step_up ( steping  =  false )
 turn_up
 @ y  -=  1
 #--------------------------------------------------------------------------
 def step_lower_left ( steping  =  false )
 turn_lower_left
 @ x  -=  1
 @ y  +=  1
 #--------------------------------------------------------------------------
 def step_lower_right ( steping  =  false )
 turn_lower_right
 @ x  +=  1
 @ y  +=  1
 #--------------------------------------------------------------------------
 def step_upper_left ( steping  =  false )
 turn_upper_left
 @ x  -=  1
 @ y  -=  1
 #--------------------------------------------------------------------------
 def step_upper_right ( steping  =  false )
 turn_upper_right
 @ x  +=  1
 @ y  -=  1
 #--------------------------------------------------------------------------
 def turn_lower_left
 @ direction_fix
 @ direction   = (@ direction  ==  6  ?  4  : @ direction  ==  8  ?  2  : @ direction )
 stop_count  =  0
 #--------------------------------------------------------------------------
 def turn_lower_right
 @ direction_fix
 @ direction   = (@ direction  ==  4  ?  6  : @ direction  ==  8  ?  2  : @ direction )
 stop_count  =  0
 #--------------------------------------------------------------------------
 def turn_upper_left
 @ direction_fix
 @ direction   = (@ direction  ==  6  ?  4  : @ direction  ==  2  ?  8  : @ direction )
 stop_count  =  0
 #--------------------------------------------------------------------------
 def turn_upper_right
 @ direction_fix
 @ direction   = (@ direction  ==  4  ?  6  : @ direction  ==  2  ?  8  : @ direction )
 stop_count  =  0
 #--------------------------------------------------------------------------
 def update
 if  jumping ?
 update_jump
 ?
 update_move
 else
 update_stop
 return @ wait_count  -=  1  if @ wait_count  >  0
 return  move_type_custom  if @ move_route_forcing
 return if @ starting  or  lock ?
 movement_update
 #--------------------------------------------------------------------------
 def update_animation
 if @ anime_count  >  18  - @ move_speed  *  2
 if  not  @ step_anime  and @ stop_count  >  0
 @ pattern  = @ original_pattern
 else
 pattern  = (@ pattern  +  1 ) %  4
 @ anime_count  =  0
 #--------------------------------------------------------------------------
 def movement_update
 if  update_frequency  and  not moving ?
 move_type
 #--------------------------------------------------------------------------
 def update_frequency
 return (@ stop_count  > ( 40  - @ move_frequency  *  2 ) * ( 6  - @ move_frequency ))
 end
 #--------------------------------------------------------------------------
 def distance
 return ( 2  ** @ move_speed ). to_i
 #--------------------------------------------------------------------------
 def update_move
 #--------------------------------------------------------------------------
 def postion_update
 = (@ x  *  128  + @ move_x )
 move_y  = (@ y  *  128  + @ move_y )
 real_y  = [@ real_y  +  distance ,  move_y ]. min . to_i  if  move_y  > @ real_y
 @ real_x  = [@ real_x  -  distance ,  move_x ]. max . to_i  if  move_x  < @ real_x
 @ real_x  = [@ real_x  +  distance ,  move_x ]. min . to_i  if  move_x  > @ real_x
 @ real_y  = [@ real_y  -  distance ,  move_y ]. max . to_i  if  move_y  < @ real_y
 #--------------------------------------------------------------------------
 def fix_position
 if @ x  !=  $game_map . round_x (@ x )
 plus  =  $game_map . round_x (@ x ) - @ x
 @ x  +=  plus
 @ real_x  +=  plus  *  128
 if @ y  !=  $game_map . round_y (@ y )
 plus  =  $game_map . round_y (@ y ) - @ y
 @ y  +=  plus
 @ real_y  +=  plus  *  128
 #--------------------------------------------------------------------------
 def screen_x
 return ( $game_map . adjust_x (@ real_x ) +  3 ) /  4  +  16
 #--------------------------------------------------------------------------
 def screen_y
 = ( $game_map . adjust_y (@ real_y ) +  3 ) /  4  +  32
 if @ jump_count  >= @ jump_peak
 = @ jump_count  - @ jump_peak
 else
 n  = @ jump_peak  - @ jump_count
 return  y  - (@ jump_peak  * @ jump_peak  -  n  *  n ) /  2
 #--------------------------------------------------------------------------
 def screen_z ( height  =  0 )
 999  if @ always_on_top
 = ( $game_map . adjust_y (@ real_y ) +  3 ) /  4  +  32
 if @ tile_id  >  0
 return  z  +  $game_map . priorities [@ tile_id ] *  32
 else
 z  + (( height  >  32 ) ?  31  :  0 )
 end
 #--------------------------------------------------------------------------
 def anime_count_update
 if @ walk_anime
 @ anime_count  +=  1.5
 @ step_anime
 @ anime_count  +=  1
 #--------------------------------------------------------------------------
 def distance_x_from_character ( character )
 sx  = @ x  -  character . x
 return  sx
 #--------------------------------------------------------------------------
 def distance_y_from_character ( character )
 sy  = @ y  -  character . y
 return  sy
 #--------------------------------------------------------------------------
 def move_toward_player
 =  distance_x_from_character ( $game_player )
 sy  =  distance_y_from_character ( $game_player )
 sx  !=  0  or  sy  !=  0
 if  sx . abs  >  sy . abs
 >  0  ?  move_left  :  move_right
 >  0  ?  move_up  :  move_down  if  not moving ? and  sy  !=  0
 else
 sy  >  0  ?  move_up  :  move_down
 >  0  ?  move_left  :  move_right  if  not moving ? and  sx  !=  0
 #--------------------------------------------------------------------------
 def move_away_from_player
 =  distance_x_from_character ( $game_player )
 sy  =  distance_y_from_character ( $game_player )
 sx  !=  0  or  sy  !=  0
 if  sx . abs  >  sy . abs
 >  0  ?  move_right  :  move_left
 >  0  ?  move_down  :  move_up  if  not moving ? and  sy  !=  0
 else
 sy  >  0  ?  move_down  :  move_up
 >  0  ?  move_right  :  move_left  if  not moving ? and  sx  !=  0
 #--------------------------------------------------------------------------
 def turn_toward_player
 =  distance_x_from_character ( $game_player )
 sy  =  distance_y_from_character ( $game_player )
 sx  ==  0  and  sy  ==  0
 if  sx . abs  >  sy . abs
 >  0  ?  turn_left  :  turn_right
 else
 sy  >  0  ?  turn_up  :  turn_down
 #--------------------------------------------------------------------------
 def turn_away_from_player
 =  distance_x_from_character ( $game_player )
 sy  =  distance_y_from_character ( $game_player )
 sx  ==  0  and  sy  ==  0
 if  sx . abs  >  sy . abs
 >  0  ?  turn_right  :  turn_left
 else
 sy  >  0  ?  turn_down  :  turn_up
 #--------------------------------------------------------------------------
 def frames
 return  4
 #--------------------------------------------------------------------------
 def box_width
 @ box_width  =  128
 return @ box_width
 #--------------------------------------------------------------------------
 def box_height
 @ box_height  =  128
 return @ box_height
 #--------------------------------------------------------------------------
 def player ?
 false
 #--------------------------------------------------------------------------
 def event ?
 false
 #==============================================================================
 class  Game_Player  <  Game_Character
 #--------------------------------------------------------------------------
 def update
 #--------------------------------------------------------------------------
 def last_real_postion
 @ last_moving  =  moving ?
 last_real_x  = @ real_x
 @ last_real_y  = @ real_y
 #--------------------------------------------------------------------------
 def move_by_input
 return  unless movable ?
 $game_system . map_interpreter . running ?
 Input . dir4
 #--------------------------------------------------------------------------
 def movable ?
 false  if  moving ?
 false  if @ move_route_forcing
 return  false  if  $game_temp . message_window_showing
 return  true
 #--------------------------------------------------------------------------
 def update_scroll
 =  $game_map . adjust_x (@ last_real_x )
 ay1  =  $game_map . adjust_y (@ last_real_y )
 ax2  =  $game_map . adjust_x (@ real_x )
 ay2  =  $game_map . adjust_y (@ real_y )
 $game_map . scroll_down ( ay2  -  ay1 ) if  ay2  >  ay1  and  ay2  >  CENTER_Y
 . scroll_left ( ax1  -  ax2 ) if  ax2  <  ax1  and  ax2  <  CENTER_X
 . scroll_right ( ax2  -  ax1 ) if  ax2  >  ax1  and  ax2  >  CENTER_X
 . scroll_up ( ay1  -  ay2 ) if  ay2  <  ay1  and  ay2  <  CENTER_Y
 #--------------------------------------------------------------------------
 def update_nonmoving
 return if  moving ?
 last_moving
 =  check_event_trigger_here ([ 1 , 2 ])
 update_encounter unless result
 if  Input . trigger ?( Input :: C )
 check_event_trigger_here ([ 0 ])
 check_event_trigger_there ([ 0 , 1 , 2 ])
 end
 #--------------------------------------------------------------------------
 def update_encounter
 return if  $DEBUG  and  Input . press ?( Input :: CTRL )
 encounter_count  -=  1  if @ encounter_count  >  0
 #--------------------------------------------------------------------------
 def player ?
 true
 #--------------------------------------------------------------------------
 def event ?
 false
 #==============================================================================
 class  Game_Event  <  Game_Character
 #--------------------------------------------------------------------------
 def name
 return @ event . name
 #--------------------------------------------------------------------------
 def player ?
 false
 #--------------------------------------------------------------------------
 def event ?
 true
 #--------------------------------------------------------------------------
 def comments
 return [] if @ page . nil ? or @ page .list. nil ? or 
 page .list. size  <=  0
 = []
 item in  @ page .list
 next  if  item . nil ?
 next unless item . code  ==  108  or  item . code  ==  408
 <<  item . parameters [ 0 ]
 end
 return  comment_list
 #==============================================================================
 class  Sprite_Character  <  RPG :: Sprite
 #--------------------------------------------------------------------------
 def update
 #--------------------------------------------------------------------------
 def update_character
 return  unless update_character ?
 update_character_info
 if @ tile_id  >=  384
 else
 set_character_bitmap
 #--------------------------------------------------------------------------
 def update_character ?
 true  if @ tile_id  != @ character . tile_id
 return  true  if @ character_name  != @ character . character_name
 return  true  if @ character_hue  != @ character . character_hue
 return  false
 #--------------------------------------------------------------------------
 def update_character_info
 @ tile_id  = @ character . tile_id
 @ character_name  = @ character . character_name
 @ character_hue  = @ character . character_hue
 #--------------------------------------------------------------------------
 def set_tile_bitmap
 . bitmap  =  RPG :: Cache . tile ( $game_map . tileset_name ,
 tile_id , @ character . character_hue )
 self . src_rect . set ( 0 ,  0 ,  32 ,  32 )
 self . ox  =  16
 . oy  =  32
 #--------------------------------------------------------------------------
 def set_character_bitmap
 . bitmap  =  RPG :: Cache . character (@ character . character_name ,
 character . character_hue )
 cw  =  bitmap . width  / @ character . frames
 @ ch  =  bitmap . height  /  4
 . ox  = @ cw  /  2
 . oy  = @ ch
 #--------------------------------------------------------------------------
 def direction
 return @ character . direction
 #--------------------------------------------------------------------------
 def update_rect
 if @ tile_id  ==  0
 = @ character . pattern  * @ cw
 = ( direction  -  2 ) /  2  * @ ch
 . src_rect . set ( sx ,  sy , @ cw , @ ch )
 end
 #--------------------------------------------------------------------------
 def update_misc
 . visible  = ( not  @ character . transparent )
 self . x  = @ character . screen_x
 . y  = @ character . screen_y
 . z  = @ character . screen_z (@ ch )
 self . opacity  = @ character . opacity
 . blend_type  = @ character . blend_type
 . bush_depth  = @ character . bush_depth    
 #--------------------------------------------------------------------------
 def update_battle_animation
 if @ character . animation_id  !=  0
 =  $data_animations [@ character . animation_id ]
 animation ( animation ,  true )
 character . animation_id  =  0
 #==============================================================================
 class  Spriteset_Map
 #--------------------------------------------------------------------------
 def initialize
 #--------------------------------------------------------------------------
 def create_viewports
 @ viewport1  =  Viewport .new( 0 ,  0 ,  640 ,  480 )
 viewport2  =  Viewport .new( 0 ,  0 ,  640 ,  480 )
 viewport3  =  Viewport .new( 0 ,  0 ,  640 ,  480 )
 viewport2 . z  =  200
 @ viewport3 . z  =  5000
 #--------------------------------------------------------------------------
 def create_tilemap
 @ tilemap  =  Tilemap .new(@ viewport1 )
 tilemap . tileset  =  RPG :: Cache . tileset ( $game_map . tileset_name )
 i in 0..6
 =  $game_map . autotile_names [ i ]
 tilemap . autotiles [ i ] =  RPG :: Cache . autotile ( autotile_name )
 end
 @ tilemap . map_data  =  $game_map . data
 @ tilemap . priorities  =  $game_map . priorities
 #--------------------------------------------------------------------------
 def create_panorama
 @ panorama  =  Plane .new(@ viewport1 )
 panorama . z  = - 1000
 #--------------------------------------------------------------------------
 def create_fog
 @ fog  =  Plane .new(@ viewport1 )
 fog . z  =  3000
 #--------------------------------------------------------------------------
 def create_characters
 @ character_sprites  = []
 i in $game_map . events . keys . sort
 =  Sprite_Character .new(@ viewport1 ,  $game_map . events [ i ])
 character_sprites . push ( sprite )
 end
 @ character_sprites . push ( Sprite_Character .new(@ viewport1 ,  $game_player ))
 end
 #--------------------------------------------------------------------------
 def create_weather
 @ weather  =  RPG :: Weather .new(@ viewport1 )
 end
 #--------------------------------------------------------------------------
 def create_pictures
 @ picture_sprites  = []
 i in 1..50
 @ picture_sprites . push ( Sprite_Picture .new(@ viewport2 ,
 $game_screen . pictures [ i ]))
 end
 #--------------------------------------------------------------------------
 def create_timer
 @ timer_sprite  =  Sprite_Timer .new
 end
 #--------------------------------------------------------------------------
 def dispose
 #--------------------------------------------------------------------------
 def dispose_tilemap
 @ tilemap . tileset . dispose
 for  i in 0..6
 @ tilemap . autotiles [ i ]. dispose
 @ tilemap . dispose
 #--------------------------------------------------------------------------
 def dispose_panorama
 @ panorama . dispose
 #--------------------------------------------------------------------------
 def dispose_fog
 @ fog . dispose
 #--------------------------------------------------------------------------
 def dispose_characters
 for  sprite in  @ character_sprites
 . dispose
 #--------------------------------------------------------------------------
 def dispose_weather
 @ weather . dispose
 #--------------------------------------------------------------------------
 def dispose_pictures
 for  sprite in  @ picture_sprites
 . dispose
 #--------------------------------------------------------------------------
 def dispose_timer
 @ timer_sprite . dispose
 #--------------------------------------------------------------------------
 def dispose_viewports
 @ viewport1 . dispose
 @ viewport2 . dispose
 @ viewport3 . dispose
 #--------------------------------------------------------------------------
 def update
 #--------------------------------------------------------------------------
 def update_tilemap
 @ tilemap . ox  =  $game_map . display_x  /  4
 @ tilemap . oy  =  $game_map . display_y  /  4
 @ tilemap . update
 #--------------------------------------------------------------------------
 def update_panorama
 if @ panorama_name  !=  $game_map . panorama_name  or
 panorama_hue  !=  $game_map . panorama_hue
 @ panorama_name  =  $game_map . panorama_name
 @ panorama_hue  =  $game_map . panorama_hue
 if @ panorama . bitmap  !=  nil
 @ panorama . bitmap . dispose
 @ panorama . bitmap  =  nil
 if @ panorama_name  !=  ""
 @ panorama . bitmap  =  RPG :: Cache . panorama (@ panorama_name , @ panorama_hue )
 end
 . frame_reset
 @ panorama . ox  =  $game_map . display_x  /  8
 @ panorama . oy  =  $game_map . display_y  /  8
 #--------------------------------------------------------------------------
 def update_fog
 if @ fog_name  !=  $game_map . fog_name  or @ fog_hue  !=  $game_map . fog_hue
 @ fog_name  =  $game_map . fog_name
 @ fog_hue  =  $game_map . fog_hue
 if @ fog . bitmap  !=  nil
 @ fog . bitmap . dispose
 @ fog . bitmap  =  nil
 if @ fog_name  !=  ""
 @ fog . bitmap  =  RPG :: Cache . fog (@ fog_name , @ fog_hue )
 end
 . frame_reset
 @ fog . zoom_x  =  $game_map . fog_zoom  /  100.0
 @ fog . zoom_y  =  $game_map . fog_zoom  /  100.0
 @ fog . opacity  =  $game_map . fog_opacity
 @ fog . blend_type  =  $game_map . fog_blend_type
 @ fog . ox  =  $game_map . display_x  /  4  +  $game_map . fog_ox
 @ fog . oy  =  $game_map . display_y  /  4  +  $game_map . fog_oy
 @ fog . tone  =  $game_map . fog_tone
 #--------------------------------------------------------------------------
 def update_characters
 for  sprite in  @ character_sprites
 . update
 #--------------------------------------------------------------------------
 def update_weather
 @ weather . type  =  $game_screen . weather_type
 @ weather . max  =  $game_screen . weather_max
 @ weather . ox  =  $game_map . display_x  /  4
 @ weather . oy  =  $game_map . display_y  /  4
 @ weather . update
 #--------------------------------------------------------------------------
 def update_pictures
 for  sprite in  @ picture_sprites
 . update
 #--------------------------------------------------------------------------
 def update_timer
 @ timer_sprite . update
 #--------------------------------------------------------------------------
 def update_viewports
 @ viewport1 . tone  =  $game_screen . tone
 @ viewport1 . ox  =  $game_screen . shake
 @ viewport3 . color  =  $game_screen . flash_color
 @ viewport1 . update
 @ viewport3 . update
 
 
  
	PHP-Code:
	
#==============================================================================
 $legacy_engine  = {} if  $legacy_engine . nil ?
 $legacy_engine [ "Light Effect" ] =  true
 #==============================================================================
 module RPG :: Cache
 #--------------------------------------------------------------------------
 def self . lights ( filename )
 self . load_bitmap ( 'Graphics/Lights/' ,  filename )
 end
 #==============================================================================
 class  Sprite_Light  <  RPG :: Sprite
 #--------------------------------------------------------------------------
 attr_reader  : lights
 : update_tone
 #--------------------------------------------------------------------------
 def initialize (* args )
 args . flatten !
 super ( args . last )
 self . bitmap  =  Bitmap .new( 640 ,  480 )
 self . blend_type  =  args [ 0 ]
 self . opacity   =  args [ 4 ]
 new_opacity   =  $game_map . new_opacity . nil ? ?  args [ 4 ] :  $game_map . new_opacity
 @ max_opacity   =  $game_map . max_opacity . nil ? ?  args [ 4 ] :  $game_map . max_opacity
 @ change_speed  =  $game_map . change_speed . nil ? ?  0  :  $game_map . change_speed
 . z  =  100
 ( args [ 1 ],  args [ 2 ],  args [ 3 ])
 lights  = {}
 update_list  = []
 end
 #--------------------------------------------------------------------------
 def update
 . ox  =  $game_map . adjust_x ( $game_map . display_x ) /  4
 . oy  =  $game_map . adjust_y ( $game_map . display_y ) /  4
 #--------------------------------------------------------------------------
 def update_lights
 =  $game_map . adjust_x ( $game_map . display_x ) /  4
 =  $game_map . adjust_y ( $game_map . display_y ) /  4
 =  Rect .new( map_x ,  map_y ,  640 ,  480 )
 self . bitmap . fill_rect ( rect , @ color ) 
 light in  @ lights . values
 . update
 ?( light ,  map_x ,  map_y ) 
 draw_light ( light ,  light . x ,  light . y )
 end
 #--------------------------------------------------------------------------
 def on_screen ?( light ,  map_x ,  map_y )
 false unless  ( light . x . between ?( map_x ,  map_x  +  640 ) or
 light . x  +  light . width ). between ?( map_x ,  map_x  +  640 ))
 false unless  ( light . y . between ?( map_y ,  map_y  +  480 ) or
 light . y  +  light . height ). between ?( map_y ,  map_y  +  480 ))
 true
 #--------------------------------------------------------------------------
 def draw_light ( light ,  x ,  y )
 img  =  light . bitmap
 =  Rect .new( x ,  y ,  light . width ,  light . height )
 self . bitmap . stretch_blt ( rect ,  img ,  img . rect ,  light . opacity )
 end
 #--------------------------------------------------------------------------
 def color ( red  =  0 ,  green  =  0 ,  blue  =  0 )
 self . blend_type  ==  2
 @ color  =  Color .new( 255  -  red ,  255  -  green ,  255  -  blue ,  255 )
 color  =  Color .new( red ,  green ,  blue ,  255 )
 end
 #--------------------------------------------------------------------------
 def create_light ( value )
 args  =  value . dup
 ( args [ 0 ])
 lights [ args [ 0 ]] =  Light_Sprite .new( args )
 end
 #--------------------------------------------------------------------------
 def remove_light ( id )
 lights [ id ]. nil ?
 lights . delete ( id )
 end
 #--------------------------------------------------------------------------
 def update_opacity
 if @ max_opacity  !=  self . opacity
 if @ max_opacity  >  self . opacity
 @ new_opacity  += @ change_speed
 . opacity  = [@ new_opacity , @ max_opacity ]. min . to_i
 @ max_opacity  <  self . opacity
 @ new_opacity  -= @ change_speed
 . opacity  = [@ new_opacity , @ max_opacity ]. max . to_i
 . shade_opacity  =  self . opacity
 . new_opacity    = @ new_opacity
 . max_opacity    = @ max_opacity 
 . change_speed   = @ change_speed
 #--------------------------------------------------------------------------
 def opacity_change (* args )
 args . flatten !
 max_opacity  =  args [ 0 ]
 new_opacity  =  self . opacity . to_f
 @ change_speed  =  args [ 1 ]. to_f
 #--------------------------------------------------------------------------
 def dispose
 @ lights . values  {| light |  light . dispose unless light . bitmap . disposed ?}
 end
 #==============================================================================
 class  Light_Sprite
 #--------------------------------------------------------------------------
 attr_reader    : values
 : bitmap
 : opacity
 : x
 : y
 : real_x
 : real_y
 : width
 : height
 #--------------------------------------------------------------------------
 def initialize (* args )
 args . flatten !
 values   =  args . dup
 @ bitmap   =  RPG :: Cache . lights ( args [ 1 ])
 target   =  set_target ( args [ 2 ])
 opacity  =  args [ 3 ]
 plus_x   =  args [ 4 ]
 plus_y   =  args [ 5 ]
 width    = @ bitmap . width   *  args [ 8 ]
 height   = @ bitmap . height  *  args [ 8 ]
 base_opacity   =  args [ 3 ]
 base_variance  =  args [ 6 ]
 speed  =  args [ 7 ]
 variance  =  0.0
 #--------------------------------------------------------------------------
 def update
 #--------------------------------------------------------------------------
 def update_position
 if @ target . is_a ?( Game_Character )
 x  =  $game_map . adjust_x (@ target . real_x ) /  4  - @ width  /  2   + @ plus_x  +  16
 @ y  =  $game_map . adjust_y (@ target . real_y ) /  4  - @ height  /  2  + @ plus_y  +  16
 @ real_x  = (@ target . real_x  /  32 ). to_i
 @ real_y  = (@ target . real_y  /  32 ). to_i
 else
 x  =  $game_map . adjust_x (@ target [: x ] *  128 ) /  4  - @ width  /  2   + @ plus_x  +  16
 @ y  =  $game_map . adjust_y (@ target [: y ] *  128 ) /  4  - @ height  /  2  + @ plus_y  +  16
 @ real_x  = @ target [: x ]
 real_y  = @ target [: y ]
 end
 #--------------------------------------------------------------------------
 def update_opacity
 @ variance  += @ speed
 @ speed  *= - 1  if (@ speed  >  0  and @ variance  > @ base_variance ) or
 speed  <  0  and @ variance  < -@ base_variance )
 opacity  = [[@ base_opacity  + @ variance ,  0 ]. max ,  255 ]. min
 #--------------------------------------------------------------------------
 def dispose
 @ bitmap . dispose
 #--------------------------------------------------------------------------
 def set_target ( value )
 value .include?( 'actor' )
 $legacy_engine [ "Caterpillar" ] and  value [ 'actor' ] >  0 ) ? 
 $game_player . actors [ value [ 'actor' ] -  1 ] :  $game_player )
 elsif value .include?( 'event' )
 $game_map . events [ value [ 'event' ]]
 value
 #==============================================================================
 class  Game_Map
 #--------------------------------------------------------------------------
 attr_accessor  : light_effect
 : lights
 : remove_lights
 : shade_opacity
 : opacity_change
 : max_opacity
 : new_opacity
 : change_speed
 #--------------------------------------------------------------------------
 alias setup_lighteffects setup
 ( map_id )
 clear_lights
 ( map_id )
 end
 #--------------------------------------------------------------------------
 def clear_lights
 @ lights  = {}
 remove_lights  = []
 shade_opacity  =  0
 @ light_effect  =  nil
 @ max_opacity   =  nil
 @ new_opacity   =  nil
 @ change_speed  =  nil
 #==============================================================================
 class  Game_Character  
 #--------------------------------------------------------------------------
 attr_accessor  : lantern
 #--------------------------------------------------------------------------
 alias initialize_lighteffects initialize
 @ lantern  =  0
 #--------------------------------------------------------------------------
 alias update_lighteffects update
 =  $legacy_engine [ "Rotational Move" ] ? @ new_direction  : @ direction
 if @ lantern  !=  0  and @ lantern_direction  !=  dir
 @ lantern_direction  =  dir
 =  self . event ? ?  "EL#{@id}"  :  "AL#{@id}"
 tp  =  self . event ? ?  'event'  :  'actor'
 case @ lantern_direction
 =  'lantern_downleft'
 value  = [ id ,  img , { tp  => @ id }, @ lantern , - 48 ,  48 ,  0 ,  0 ,  1.0 ]
 when 2
 =  'lantern_down'
 value  = [ id ,  img , { tp  => @ id }, @ lantern ,  0 ,  64 ,  0 ,  0 ,  1.0 ]
 when 3
 =  'lantern_downright'
 value  = [ id ,  img , { tp  => @ id }, @ lantern ,  48 ,  48 ,  0 ,  0 ,  1.0 ]
 when 4
 =  'lantern_left'
 value  = [ id ,  img , { tp  => @ id }, @ lantern , - 64 ,  0 ,  0 ,  0 ,  1.0 ]
 when 6
 =  'lantern_right'
 value  = [ id ,  img , { tp  => @ id }, @ lantern ,  64 ,  0 ,  0 ,  0 ,  1.0 ]
 when 7
 =  'lantern_upleft'
 value  = [ id ,  img , { tp  => @ id }, @ lantern , - 48 , - 48 ,  0 ,  0 ,  1.0 ]
 when 8
 =  'lantern_up'
 value  = [ id ,  img , { tp  => @ id }, @ lantern ,  0 , - 64 ,  0 ,  0 ,  1.0 ]
 when 9
 =  'lantern_upright'
 value  = [ id ,  img , { tp  => @ id }, @ lantern ,  48 , - 48 ,  0 ,  0 ,  1.0 ]
 end
 . lights [ id ] =  value
 @ lantern  ==  0  and @ lantern_direction  !=  nil
 =  self . event ? ?  "EL#{@id}"  :  "AL#{@id}"
 $game_map . remove_lights  <<  id  if  $game_map . remove_lights  !=  nil
 @ lantern_direction  =  nil
 #==============================================================================
 class  Game_Event  <  Game_Character
 #--------------------------------------------------------------------------
 alias clear_starting_lighteffects clear_starting
 @ lantern  =  0
 . remove_lights  <<  "EV#{@id}"  if  $game_map . remove_lights  !=  nil 
 @ page . nil ?
 end
 #--------------------------------------------------------------------------
 def refresh_lights
 for  comment in comments
 if  comment  =~ / SIMPLE [ ]* LIGHT [ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "light" , $ 1 )
 elsif comment  =~ / SIMPLE [ ]* LAMP [ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "lamp" , $ 1 )
 elsif comment  =~ / SIMPLE [ ]* TORCH [ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "torch" , $ 1 )
 elsif comment  =~ / SIMPLE [ ]* WINDOW [ ]* A [ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "window" , $ 1 )
 elsif comment  =~ / SIMPLE [ ]* WINDOW [ ]* B [ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "window" , $ 1 ,  0 ,  0 ,  0 , - 14 )
 elsif comment  =~ / FLASH [ ]* LIGHT [ ]*(\ d +)?[ ]*(\ d +)?[ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "light" , $ 1 , $ 2 , $ 3 )
 elsif comment  =~ / FLASH [ ]* LAMP [ ]*(\ d +)?[ ]*(\ d +)?[ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "lamp" , $ 1 , $ 2 , $ 3 )
 elsif comment  =~ / FLASH [ ]* TORCH [ ]*(\ d +)?[ ]*(\ d +)?[ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "torch" , $ 1 , $ 2 , $ 3 ,  0 ,  0 ,  2.0 )
 elsif comment  =~ / FLASH [ ]* WINDOW [ ]* A [ ]*(\ d +)?[ ]*(\ d +)?[ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "window" , $ 1 , $ 2 , $ 3 )
 elsif comment  =~ / FLASH [ ]* WINDOW [ ]* B [ ]*(\ d +)?[ ]*(\ d +)?[ ]*(\ d +)?/ i
 ( "EV#{@id}" ,  "window" , $ 1 , $ 2 , $ 3 ,  0 , - 14 )        
 elsif comment  =~ / LIGHT [ ]\((\ w +)\)((?:[ ]*(?:[\+\-]?\ d +))*)/ i
 = []
 name  = $ 1.dup
 $ 2.scan (/\ d +/). each  {| i |  v  <<  i }
 set_light ( "EV#{@id}" ,  name ,  v [ 0 ],  v [ 1 ],  v [ 1 ],  v [ 3 ],  v [ 4 ],  v [ 5 ])        
 elsif comment  =~ / LANTERN [ ]*(\ d +)?/ i
 @ lantern  = ($ 1.nil ? ?  255  : $ 1.to_i )
 end
 #--------------------------------------------------------------------------
 def set_light ( id ,  name ,  op ,  vr  =  0 ,  sp  =  0 ,  x  =  0 ,  y  =  0 ,  zm  =  1.0 )
 op  =  op . nil ? ?  255  :  op . to_i
 =  vr . nil ? ?   50  :  vr . to_i
 =  sp . nil ? ?    2  :  sp . to_i
 =  x . nil ?  ?    0  :  x . to_i
 =  y . nil ?  ?    0  :  x . to_i
 =  zm . nil ? ?  1.0  :  zm . to_f
 = [ id ,  name , { 'event'  => @ id },  op ,  x ,  y ,  vr ,  sp ,  zm ]
 $game_map . lights [ id ] =  value
 . remove_lights . delete ( id )
 end
 #==============================================================================
 class  Spriteset_Map
 #--------------------------------------------------------------------------
 attr_reader  : light_effects
 #--------------------------------------------------------------------------
 alias initialize_lighteffects initialize
 #--------------------------------------------------------------------------
 alias update_lighteffects update
 #--------------------------------------------------------------------------
 alias dispose_lighteffects dispose
 . is_a ?( Scene_Map )
 end
 #--------------------------------------------------------------------------
 def update_light
 #--------------------------------------------------------------------------
 def dispose_light
 if @ light_effect  !=  nil
 @ light_effect . dispose
 @ light_effect  =  nil
 @ light_values  =  nil
 #--------------------------------------------------------------------------
 def update_shade
 if  $game_map . light_effect  !=  nil  and (@ light_effect . nil ? or
 $game_map . light_effect  != @ light_values )
 light_effect . dispose  if @ light_effect  !=  nil
 @ light_values  =  $game_map . light_effect
 @ light_effect  =  Sprite_Light .new(@ light_values , @ viewport2 )
 $game_map . event_list . each  {| ev |  ev . refresh_lights }
 elsif $game_map . light_effect  !=  nil  and @ light_effect  !=  nil
 @ light_effect . update
 . light_effect . nil ? and @ light_effect  !=  nil
 #--------------------------------------------------------------------------
 def update_effects
 return if @ light_effect . nil ? or  $game_map . lights .empty?
 key in $game_map . lights . keys
 if  $game_map . remove_lights .include?( key )
 light_effect . remove_light ( key )
 $game_map . lights . delete ( key )
 next
 if @ light_effect . lights [ key ] !=  nil  and 
 light_effect . lights [ key ]. values  ==  $game_map . lights [ key ]
 light_effect . create_light ( $game_map . lights [ key ])
 end
 . remove_lights . clear
 #--------------------------------------------------------------------------
 def update_shade_opacity
 if  $game_map . opacity_change  !=  nil
 @ light_effect . opacity_change ( $game_map . opacity_change )
 $game_map . opacity_change  =  nil
 #==============================================================================
 class  Interpreter
 #--------------------------------------------------------------------------
 def create_shade ( op  =  160 ,  red  =  0 ,  green  =  0 ,  blue  =  0 ,  type  =  2 )
 $game_map . light_effect  = [ type ,  red ,  green ,  blue ,  op ,  true ]
 end
 #--------------------------------------------------------------------------
 def change_opacity ( op  =  160 ,  speed  =  1 )
 $game_map . light_effect . nil ?
 $game_map . opacity_change  = [ op ,  speed ]
 end
 #--------------------------------------------------------------------------
 def player_light ( img ,  id ,  index  =  0 ,  op  =  160 ,  x  =  0 ,  y  =  0 ,
 0 ,  speed  =  0 ,  zoom  =  1.0 )
 actor  = ( $legacy_engine [ "Caterpillar" ] and  index  >  0 ) ? 
 $game_player . actors [ index  -  1 ] :  $game_player
 return if  actor . nil ?
 actor  = { 'actor'  =>  index }
 $game_map . lights [ id ] = [ id ,  img ,  actor ,  op ,  x ,  y , var,  speed ,  zoom ]
 end
 #--------------------------------------------------------------------------
 def event_light ( img ,  id ,  index  =  0 ,  op  =  160 ,  x  =  0 ,  y  =  0 ,
 0 ,  speed  =  0 ,  zoom  =  1.0 )
 $game_map . events [ index ]. nil ?
 event  = { 'event'  =>  index }
 $game_map . lights [ id ] = [ id ,  img ,  event ,  op ,  x ,  y , var,  speed ,  zoom ]
 end
 #--------------------------------------------------------------------------
 def map_light ( img ,  id ,  mx  =  0 ,  my  =  0 ,  op  =  160 ,  x  =  0 ,  y  =  0 ,
 0 ,  speed  =  0 ,  zoom  =  1.0 )
 pos  = {: x  =>  mx , : y  =>  my }
 $game_map . lights [ id ] = [ id ,  img ,  pos ,  op ,  x ,  y , var,  speed ,  zoom ]
 end
 #--------------------------------------------------------------------------
 def remove_light ( id )
 $game_map . remove_lights  <<  id  if  $game_map . remove_lights  !=  nil 
 #--------------------------------------------------------------------------
 def shade_opacity
 return  $game_map . shade_opacity
 #--------------------------------------------------------------------------
 def player_lantern_on ( index  =  0 ,  opacity  =  255 )
 actor  = ( $legacy_engine [ "Caterpillar" ] and  index  >  0 ) ? 
 $game_player . actors [ index  -  1 ] :  $game_player
 return if  actor . nil ?
 actor . lantern  =  opacity
 #--------------------------------------------------------------------------
 def player_lantern_off ( index  =  0 )
 actor  = ( $legacy_engine [ "Caterpillar" ] and  index  >  0 ) ? 
 $game_player . actors [ index  -  1 ] :  $game_player
 return if  actor . nil ?
 actor . lantern  =  0
 #--------------------------------------------------------------------------
 def event_lantern_on ( index  =  0 ,  opacity  =  255 )
 $game_map . events [ index ]. nil ?
 $game_map . events [ index ]. lantern  =  opacity
 #--------------------------------------------------------------------------
 def event_lantern_off ( index  =  0 )
 $game_map . events [ index ]. nil ?
 $game_map . events [ index ]. lantern  =  0
 #==============================================================================
 class  Scene_Map
 #--------------------------------------------------------------------------
 attr_reader  : spriteset
 #--------------------------------------------------------------------------
 alias transfer_player_lighteffects transfer_player
 @ spriteset . dispose_light
 . clear_lights
 
 
  Download http://ascare.as.ohost.de/rgss/rgss_lichteffekt.png  
	 
 
	
	
	
	
		Hey das Skript ist ziemlich gut, vielen Dank fürs übersetzten und vorstellen.  
	 
 
	
	
	
	
		Hey, 
	 
 
	
	
	
	
		Ich habe mir nun die Zeit genommen mich durch das Script zu lesen. Der Script-Stil ist nicht sonderlich freundlich wenn man das sagen darf und erschwert das Verständnis zunehmend. 
	 
 
	
	
	
	
		Oh man ich liebe euch gerade dafür, dass ihr dieses Script gefunden habt! Das ist GENAU das, was ich auch gesucht habe!!! 
	 
 
	
	
	
	
		Musman beides, also Basis und das Skript selber in 2 verschiedene "Skript-Slots" kopieren, oder muss man ncoh etwas beachten? 
	 
 
	
	
	
	
		Man muss sie nichteinmal an verschieden Stellen einfügen, solange das Script oberhalb der Main Funktion steht sollte es funktionstüchtig sein.