collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Nightlights Isolated  (Gelesen 3555 mal)

Offline Onkel Hell

  • Sol Invictus
  • Administrator
  • VX-Kenner
  • ****
  • Beiträge: 562
  • You can't shoot me, I'm AIDS !
Nightlights Isolated
« am: Mai 02, 2008, 15:24:27 »
Kaefer wollte ja als erster das ich meinem Nightlights-System aus meinem Simple Day And Night als Solo-Script reinstelle und jetz habters hier

Beschreibung :
Es zeigt im grunde eigentlich nur ein festes bild auf der Karte an , dies kann allerdings dazu benutzt werden um Lightmaps und Shadowmaps anzuzeigen, dies ist nur eine Solo-Script Version
und sollte daher nicht mit Simple Day and Night v1.0 oder höher benutzt werden da dort dies schon automatisch integriert ist


Anleitung

#==============================================================================
# Nightslights F.A.Q.
#==============================================================================
# Erstellt einen Ordner names Nightlights in eurem Graphics Ordner und tut
# ein Bild mit dem selben namen und größe wie eure karte im Spiel hinein
# Dieses Bild wird dann automatisch angezeigt

 PIC_FORMAT = "png" # Format für die Nightlight-Maps

Script v1.0
Spoiler for Hiden:
#==============================================================================
#  Nightlights Isolated
#
#  Version : 1.0 - 30.04.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : My Nightlighting-System from Simple Day And Night as single
#                Script, do NOT use with it with Simple Day and Night v1.0 or
#                above.
#
#==============================================================================
# Nightslights F.A.Q.
#==============================================================================
# Create a folder named Nightlights in your Graphics folder and put a picture
# with the same name,width and height as your map into it.
# The picture will automatically shown

 PIC_FORMAT = "png" # Format for the Nightlight-Maps

#==============================================================================
module Cache
#==============================================================================
  def self.nightlights(filename)
    load_bitmap("graphics/nightlights/", filename)
  end
  
end
#==============================================================================
class Game_Map
#==============================================================================
  def setup(map_id)
    @map_id = map_id
    @map = load_data(sprintf("Data/Map%03d.rvdata", @map_id))
    @display_x = 0
    @display_y = 0
    @passages = $data_system.passages
    referesh_vehicles
    setup_events
    setup_scroll
    setup_parallax
    setup_nightlights
    @need_refresh = false
  end
#------------------------------------------------------------------------------
  def setup_nightlights
    @nightlights_mapname = $game_map.name
    @nightlights_loop_x = 0
    @nightlights_loop_y = 0
    @nightlights_sx = 0
    @nightlights_sy = 0
    @nightlights_x = 0
    @nightlights_y = 0
  end
#------------------------------------------------------------------------------
  def update
    refresh if $game_map.need_refresh
    update_scroll
    update_events
    update_vehicles
    update_parallax
    if $active && $timesystem == 1
      update_nightlights
      $dayandnight.updateclock
    end
    @screen.update
  end
#------------------------------------------------------------------------------
  def update_nightlights
    @nightlights_x += @nightlights_sx * 4 if @nightlights_loop_x
    @nightlights_y += @nightlights_sy * 4 if @nightlights_loop_y
  end
#------------------------------------------------------------------------------
  def set_display_pos(x, y)
    @display_x = (x + @map.width * 256) % (@map.width * 256)
    @display_y = (y + @map.height * 256) % (@map.height * 256)
    @parallax_x = x
    @parallax_y = y
    @nightlights_x = x
    @nightlights_y = y
  end
#------------------------------------------------------------------------------
  def calc_nightlights_x(bitmap)
    if bitmap == nil
      return 0
    else
      w1 = bitmap.width - 544
      w2 = @map.width * 32 - 544
      if w1 <= 0 or w2 <= 0
        return 0
      else
        return @nightlights_x * w1 / w2 / 8
      end
    end
  end
#------------------------------------------------------------------------------
  def calc_nightlights_y(bitmap)
    if bitmap == nil
      return 0
    else
      h1 = bitmap.height - 416
      h2 = @map.height * 32 - 416
      if h1 <= 0 or h2 <= 0
        return 0
      else
        return @nightlights_y * h1 / h2 / 8
      end
    end
  end
#------------------------------------------------------------------------------
  def scroll_down(distance)
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance
      @nightlights_y += distance
    else
      last_y = @display_y
      @display_y = [@display_y + distance, (height - 13) * 256].min
      @parallax_y += @display_y - last_y
      @nightlights_y += @display_y - last_y
    end
  end
#------------------------------------------------------------------------------
  def scroll_left(distance)
    if loop_horizontal?
      @display_x += @map.width * 256 - distance
      @display_x %= @map.width * 256
      @parallax_x -= distance
      @nightlights_x -= distance
    else
      last_x = @display_x
      @display_x = [@display_x - distance, 0].max
      @parallax_x += @display_x - last_x
      @nightlights_x += @display_x - last_x
    end
  end
#------------------------------------------------------------------------------
  def scroll_right(distance)
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance
      @nightlights_x += distance
    else
      last_x = @display_x
      @display_x = [@display_x + distance, (width - 17) * 256].min
      @parallax_x += @display_x - last_x
      @nightlights_x += @display_x - last_x
    end
  end
#------------------------------------------------------------------------------
  def scroll_up(distance)
    if loop_vertical?
      @display_y += @map.height * 256 - distance
      @display_y %= @map.height * 256
      @parallax_y -= distance
      @nightlights_y -= distance
    else
      last_y = @display_y
      @display_y = [@display_y - distance, 0].max
      @parallax_y += @display_y - last_y
      @nightlights_y += @display_y - last_y
    end
  end
#------------------------------------------------------------------------------
  def name
    $data_mapinfos[@map_id]
  end
    
end
  
#==============================================================================
class Spriteset_Map
#==============================================================================
  def initialize
    create_viewports
    create_tilemap
    create_parallax
    create_characters
    create_shadow
    create_weather
    create_pictures
    create_timer
    create_nightlights
    update
  end
#------------------------------------------------------------------------------
  def create_nightlights
    $nightlights = Plane.new(@viewport3)
  end
#------------------------------------------------------------------------------
  alias dispose_nl_adds dispose
  def dispose
    dispose_nl_adds
    dispose_nightlights
  end
#------------------------------------------------------------------------------
  def dispose_nightlights
    $nightlights.dispose
  end
#------------------------------------------------------------------------------
  alias update_nl_adds update
  def update
    update_nl_adds
    update_nightlights
  end
#------------------------------------------------------------------------------
  def update_nightlights
    if @nightlights_mapname != $game_map.name
      @nightlights_mapname = $game_map.name
      if $nightlights.bitmap != nil
        $nightlights.bitmap.dispose
        $nightlights.bitmap = nil
      end
      if @nightlights_mapname != ""
        if File.exist?("Graphics/Nightlights/"+@nightlights_mapname+"."+PIC_FORMAT)
          $nightlights.bitmap = Cache.nightlights(@nightlights_mapname)
        end
      end
      Graphics.frame_reset
    end
    $nightlights.ox = $game_map.calc_nightlights_x($nightlights.bitmap)
    $nightlights.oy = $game_map.calc_nightlights_y($nightlights.bitmap)
  end
  
end

#==============================================================================
class Scene_Title
#==============================================================================
  alias load_database_nl_adds load_database
  def load_database
    load_database_nl_adds
    $data_mapinfos      = load_data("Data/MapInfos.rvdata")
    for key in $data_mapinfos.keys
      $data_mapinfos[key] = $data_mapinfos[key].name
    end
  end
  
end
« Letzte Änderung: Mai 03, 2008, 03:50:33 von hellMinor »
Verborgen in der Dunkelheit
Ich kenne nur die Einsamkeit
Auf das kein Gott mich sieht, ich bin ein Eremit


Mega Man Battle Engine


Nightlights Isolated

Kaefer

  • Gast
Nightlights Isolated
« Antwort #1 am: Mai 03, 2008, 15:24:58 »
Cool :)danke danke danke :)werds gleich mal austesten :)



EDIT:
Ähm was muss ich denn einstellen das er das nachts anzeigt???
Mein Tag/Nacht System läuft ja über Common Events.
« Letzte Änderung: Mai 03, 2008, 15:31:14 von Kaefer »

Re: Nightlights Isolated

Offline Evil95

  • Aktuelles Projekt: Demon - Beginning of Chaos VX
  • Mr. MACK-Tile
  • ***
  • Beiträge: 289
    • http://demonvx-online.de.vu
Re: Nightlights Isolated
« Antwort #2 am: Juli 16, 2008, 13:00:09 »
wie kann ich das mit meinem commonevent-basierten day-night-system kombinieren?

Re: Nightlights Isolated

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Re: Nightlights Isolated
« Antwort #3 am: Februar 07, 2009, 14:23:27 »
Hi,

hat das Script nun schon mal jemand getestet? Funktioniert es?

Wird die Lightmap nur nachts angezeigt oder kann man es auch so bewerkstelligen, dass Nachts und Tags unterschiedliche Lightmaps gezeigt werden?

Gruß, Markus.

Re: Nightlights Isolated

Offline Kyoshiro

  • Global Mod
  • RPGVX-Forengott
  • ****
  • Beiträge: 1623
  • Stand up and fight!
    • Mein Blog
Re: Nightlights Isolated
« Antwort #4 am: Februar 07, 2009, 14:25:40 »
Mit dem Script werden die Lightmaps immer angezeigt, egal ob Tag oder Nacht.
Ich weiß nicht, ob man da etwas umstellen kann, dass die LEs nur zu bestimmten Zeiten eingefügt werden oder gar unterschiedliche LEs für ein und den selben Ort.

Kyoshiro

Re: Nightlights Isolated

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Re: Nightlights Isolated
« Antwort #5 am: Februar 08, 2009, 13:34:32 »
Ok, danke für die schnelle Antwort.

Re:Nightlights Isolated

Offline jarkill

  • Ralph
  • *
  • Beiträge: 7
Re:Nightlights Isolated
« Antwort #6 am: Oktober 12, 2010, 17:42:58 »
Sorry fürs Nekroposting aber bei einem verschlüsselten Installer werden die Bilder aus dem Nightlight nicht übernommen, es fehlt wo die "Fileabfrage" dafür.
Ein Hotfix wäre super, da ich das Isolated Nightlights gerne verwende.

jarkill

Re: Nightlights Isolated

Offline Valentine

  • Eventmeister
  • ***
  • Beiträge: 352
Re: Nightlights Isolated
« Antwort #7 am: April 18, 2012, 20:25:35 »
... hat sich erledigt.
« Letzte Änderung: Juni 01, 2012, 16:27:54 von Valentine »

 


 Bild des Monats

rooftop party

Views: 3578
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal