collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Map_Fog_Script  (Gelesen 7959 mal)

Dainreth

  • Gast
Map_Fog_Script
« Antwort #30 am: Februar 23, 2008, 11:01:44 »
DeadlyDan wollte das Problem auch fixen, allerdings hat er momentan Probleme mit seinem Rechner, ich sag bescheid, wenn er was verändert hat.

@Dark Angel
Willkommen im Forum. Hört sich gut an, ich bin gespannt.

Map_Fog_Script

Offline Dark Angel

  • Ralph
  • *
  • Beiträge: 12
Map_Fog_Script
« Antwort #31 am: Februar 27, 2008, 12:48:15 »
So Leutz. :)
Das Fogscript hat nur noch wenige Bugs und ich denke das ich es bald hochladen kann.
Es enthält die RPGXP-Fogs und darüber hinaus habe ich einen 2. FOG-Typ eingebaut.
Ihr kennt ja alle den Auto-Battlebackground. Nun es ist mir gelungen einen FOG-Typ zu schreiben,
der z.B. Hitze darstellt. Dann ist es kein Plane was eine andauernde Grafik ist sondern ein Sprite,
welches wie beim Battleback sich "wellt" aber nicht ineinander gedreht ist.
Kann aber leider noch keinen Fertigstellungstermin nennen, da ich nebenbei für Abi lernen muss.
Wenn es wieder was neues gibt geb ich euch bescheid.

@Dainreth

dankeschön ^^
[size=]>> Auf Wunsch programmiere ich Anwendugssoftware ^^ <<
>> RGSS 4 all <<[/size]

Map_Fog_Script

Offline Dark Angel

  • Ralph
  • *
  • Beiträge: 12
Map_Fog_Script
« Antwort #32 am: Februar 27, 2008, 17:23:14 »
Mein Script ist fertig und funktioniert einwandfrei.^^

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']=begin

    Fog Scriptsystem VX 1.0 Release
                by Dark Angel

Deutsch/German:        
  Dieses Script wurde auf eigener Basis
  entwickelt und hat nur die scroll-Funktionen
  von DeadlyDan

Englisch/English
  This Script was developped at own base.
  It only uses the scroll-functions from the script
  by DeadlyDan
 
=end
##########################################################
##########################################################
##########################################################
# Konstanten/Constants
$FOG_FIX = 8
$FOG_DELAY = 3
$FT1DIST = 0
$FT2DIST = 8.0
$i = 0 # Zählvariable für delay / countvar for delay
##########################################################
##########################################################
##########################################################
# Andere benötigte Funktionen / other used functions
def  var_in(a,v)
  i = 0
  r = 0
  for i in a
    if v == i
      r=1
      break
    end
  end
  return r
end
##########################################################
##########################################################
##########################################################
# Andere Klassen wegen Aussehen ändern / Change other classes because of the style
class Scene_Skill
  def start
    super
    create_menu_background
    @actor = $game_party.members[@actor_index]
    @viewport = Viewport.new(0, 0, 544, 416)
    @viewport.z = 110 # NEW
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @status_window = Window_SkillStatus.new(0, 56, @actor)
    @status_window.viewport = @viewport
    @skill_window = Window_Skill.new(0, 112, 544, 304, @actor)
    @skill_window.viewport = @viewport
    @skill_window.help_window = @help_window
    @target_window = Window_MenuStatus.new(0, 0)
    hide_target_window
  end
end
##########################################################
##########################################################
##########################################################
class Scene_Item
  def start
    super
    create_menu_background
    @viewport = Viewport.new(0, 0, 544, 416)
    @viewport.z = 110 # NEW
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @item_window = Window_Item.new(0, 56, 544, 360)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.active = false
    @target_window = Window_MenuStatus.new(0, 0)
    hide_target_window
  end
end
##########################################################
##########################################################
##########################################################
class Game_Fog
  # Fogsprite
  attr_accessor :fog
  # Fog aktiv? / Fog active?
  attr_reader :fog_enabled
  # Fogdaten / Fogdata
  attr_reader :speed_x
  attr_reader :speed_y
  attr_reader :start_x
  attr_reader :start_y
  attr_reader :opacity
  attr_reader :zoom
  attr_reader :file
  attr_reader :running
  # Typ / Type
  attr_reader :fog_type
 
  # init
  def initialize(file, typ, opacity=200, sx=1, sy=1, spx=0, spy=0, zoom=100)
    @fog = nil
    @fog_enabled = false
    @speed_x = spy
    @speed_y = spx
    @fog_type = typ
    @start_x = sx
    @start_y = sy
    @opacity = opacity
    @zoom = zoom/100
    @file = file
  end
  # Fog-Typ 1 (um Hitze darzustellen) / Fog Type 1 (to simulate Hot air)
  def start_fog_type_1
    @fog.dispose if @fog != nil
    source = @file
    bitmap = Bitmap.new(640, 480)
    bitmap.stretch_blt(bitmap.rect, source, source.rect)
#    bitmap.radial_blur(90, 12)
    @fog = Sprite.new()
    @fog.bitmap = bitmap
    @fog.opacity = @opacity
    @fog.ox = 320
    @fog.oy = 240
    @fog.x = 272
    @fog.y = 176
    @fog.zoom_x = @fog.zoom_y = @zoom
    @fog.wave_amp = 8
    @fog.wave_length = 240
    @fog.wave_speed = 520
    @fog_enabled=true
  end
  # Fog-Typ 2 (Wolken, Sandsturm, etc) / Fog Type 2 (Sky, Sandstorm, etc)
  def start_fog_type_2
    @fog.dispose if @fog != nil
    @fog = Plane.new()
    @fog.bitmap = @file
    @fog.opacity = @opacity
    @fog.ox = @start_x
    @fog.oy = @start_y
    @fog_enabled = true
    @fog.zoom_x = @fog.zoom_y = @zoom
  end
  # update
  def update
    if @fog_type == 1 and @fog_enabled
      @fog.update
    end
    if @fog_type == 2 and @fog_enabled and @speed_x != 0 and @speed_y != 0
      if $i == $FOG_DELAY
        @fog.ox += @speed_x
        @fog.oy += @speed_y
        $i = 0
      else
        $i += 1
      end
    end
  end
  # dispose
  def dispose
    @fog.dispose if @fog != nil
    @fog = nil
    @fog_enabled=false
  end
  # start fog
  def start_fog
    if @fog_type == 1
      start_fog_type_1
    end
    if @fog_type == 2
      start_fog_type_2
    end
  end
end
##########################################################
##########################################################
##########################################################
class Scene_Base
  # alias
  alias sm_up update
  # update
  def update
    sm_up
    if $game_fog != nil
      $game_fog.update
    end
  end
end
##########################################################
##########################################################
##########################################################
module Fog
  def self.Data(mid,opacity=180,ox=1,oy=1,spx=1,spy=1,zoom=100)
  end
end
##########################################################
##########################################################
##########################################################
class Spriteset_Map
  alias st initialize
  def initialize
    st
    Fog::Data($game_map.map_id)
  end
end
##########################################################
##########################################################
##########################################################
class Scene_Map
  def perform_battle_transition
    Graphics.transition(80, "Graphics/System/BattleStart", 80)
    Graphics.freeze
    $game_fog.dispose
    $game_fog = nil
  end
end
class Scene_Title
  alias st start
  def start
    if $game_fog != nil
      $game_fog.dispose
      $game_fog = nil
    end
    st
  end
end
##########################################################
##########################################################
##########################################################
class Game_Map
  def scroll_up ( distance )
    if $game_fog != nil
      if ( loop_vertical? )
        @display_y += @map.height * 256 - distance
        @display_y %= @map.height * 256
        @parallax_y -= distance
        $game_fog.fog.oy -= $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.oy -= distance / $FT2DIST if $game_fog.fog_type == 2
      else
        last_y = @display_y
        @display_y = [@display_y - distance, 0].max
        @parallax_y += @display_y - last_y
        $game_fog.fog.oy += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.oy += ( @display_y - last_y ) / $FT2DIST  if $game_fog.fog_type == 2
      end
    else
      if ( loop_vertical? )
        @display_y += @map.height * 256 - distance
        @display_y %= @map.height * 256
        @parallax_y -= distance
      else
        last_y = @display_y
        @display_y = [@display_y - distance, 0].max
        @parallax_y += @display_y - last_y
      end
    end
  end
  ##########################################################
  def scroll_down ( distance )
    if $game_fog != nil
      if ( loop_vertical? )
        @display_y += distance
        @display_y %= @map.height * 256
        @parallax_y += distance
        $game_fog.fog.oy += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.oy += distance / $FT2DIST if $game_fog.fog_type == 2
      else
        last_y = @display_y
        @display_y = [@display_y + distance, (height - 13) * 256].min
        @parallax_y += @display_y - last_y
        $game_fog.fog.oy += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.oy += ( @display_y - last_y ) / $FT2DIST if $game_fog.fog_type == 2
      end
    else
      if ( loop_vertical? )
        @display_y += distance
        @display_y %= @map.height * 256
        @parallax_y += distance
      else
        last_y = @display_y
        @display_y = [@display_y + distance, (height - 13) * 256].min
        @parallax_y += @display_y - last_y
      end
    end
  end
  ##########################################################
  def scroll_left ( distance )
    if $game_fog != nil
      if ( loop_horizontal? )
        @display_x += @map.width * 256 - distance
        @display_x %= @map.width * 256
        @parallax_x -= distance
        $game_fog.fog.ox -= $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.ox -= distance / $FT2DIST if $game_fog.fog_type == 2
      else
        last_x = @display_x
        @display_x = [@display_x - distance, 0].max
        @parallax_x += @display_x - last_x
        $game_fog.fog.ox += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.ox += ( @display_x - last_x ) / $FT2DIST if $game_fog.fog_type == 2
      end
    else
      if ( loop_horizontal? )
        @display_x += @map.width * 256 - distance
        @display_x %= @map.width * 256
        @parallax_x -= distance
      else
        last_x = @display_x
        @display_x = [@display_x - distance, 0].max
        @parallax_x += @display_x - last_x
      end
    end
  end
  ##########################################################
  def scroll_right ( distance )
    if $game_fog != nil
      if ( loop_horizontal? )
        @display_x += distance
        @display_x %= @map.width * 256
        @parallax_x += distance
        $game_fog.fog.ox += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.ox += distance / $FT2DIST if $game_fog.fog_type == 2
      else
        last_x = @display_x
        @display_x = [@display_x + distance, (width - 17) * 256].min
        @parallax_x += @display_x - last_x
        $game_fog.fog.ox += $FT1DIST if $game_fog.fog_type == 1
        $game_fog.fog.ox += ( @display_x - last_x ) / $FT2DIST if $game_fog.fog_type == 2
      end
    else
      if ( loop_horizontal? )
        @display_x += distance
        @display_x %= @map.width * 256
        @parallax_x += distance
      else
        last_x = @display_x
        @display_x = [@display_x + distance, (width - 17) * 256].min
        @parallax_x += @display_x - last_x
      end
    end
  end
end


####################################################################
module Fog
  def self.Data(mid,opacity=180,ox=1,oy=1,spx=1,spy=1,zoom=100)
    if $game_fog != nil
      $game_fog.dispose
    end
    ###############################################################################
    ###############################################################################
    ###############################################################################
    # Benutzung:
    # mid ist die Mapid des Fogs.
    # Alle Daten werden hier spezifisch eingetragen.
    # Usage:
    # mid is the MAPID of the Fog
    # All data must be inserted here
    ###############################################################################
    ###############################################################################
    ###############################################################################
    if mid == 0 # Dummy
      $game_fog = Game_Fog.new(Cache::picture("Dummy.png"),1,opacity)
    end
    ###############################################################################
    if var_in([4,9,19],mid) # Himmel / Sky
      $game_fog = Game_Fog.new(Cache::picture("Wolken.png"),2,opacity,ox,oy,spx,spy,zoom)
    end
    ###############################################################################
    if mid == 2 # Wüste / Dessert
      $game_fog = Game_Fog.new(Cache::picture("Sandstorm.png"),2,opacity,ox,oy,spy,spy,zoom)
    end
    ###############################################################################
    if mid == 3 # Hitze / Hot area
      $game_fog = Game_Fog.new(Cache::picture("Hitze.png"),1,opacity)
    end
    ###############################################################################
    if mid == 4 # Dungeon
      $game_fog = Game_Fog.new(Cache::picture("Dungeon.png"),2,opacity,ox,oy,spy,spy,zoom)
    end
    ###############################################################################
    if mid == 5 # Wald / Forest
      $game_fog = Game_Fog.new(Cache::picture("Wald1.png"),2,opacity,ox,oy,spy,spy,zoom)
    end
    ###############################################################################
    $game_fog.start_fog() if $game_fog != nil
    ###############################################################################
  end
end

Jetzt werden die meisten sagen das sie die Dateien nicht haben.
Ich habe hier die Fogs vom RMXP verwendet.
Für Fragen stehe ich gern zur Verfügung.
[size=]>> Auf Wunsch programmiere ich Anwendugssoftware ^^ <<
>> RGSS 4 all <<[/size]

Map_Fog_Script

Yatzumo

  • Gast
Map_Fog_Script
« Antwort #33 am: Februar 27, 2008, 18:05:31 »
Wenn du jetzt noch die Datein hochladest, ist alles perfekt. =)

Frage:
Wie stellt man denn ein, welches Fog man verwenden will?

MFG Yatzumo

Map_Fog_Script

ERZENGEL

  • Gast
Map_Fog_Script
« Antwort #34 am: Februar 27, 2008, 18:24:30 »
@Yatzumo: Am Ende des Skriptes ist eine Anleitung plus Einstellungsmöglichkeiten.

@DarkAngel: Gute Arbeit, obwohl ich finde, dass es sehr umständlich einzustellen ist für Anfänger. Aber mal gucken wie es sich gegen woratanas oder deadlyDans Skript durchsetzen wird.

P.S.: Ist $FT2DIST doche eine globale Variable (hab noch nie vor ner Konstante nen $ gesehen und würde auch nie eines machen)!? Oder doch ne Konstante (deren erster Buchstabe groß geschrieben wird)??
« Letzte Änderung: Februar 27, 2008, 18:35:24 von ERZENGEL »

Map_Fog_Script

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Map_Fog_Script
« Antwort #35 am: Februar 27, 2008, 18:31:55 »
Hi,

würde mich auch interessieren. Habe das Script eingebaut, aber will ja nicht ständig Wolken sehen. Vorallemdingen nicht in Höhlen.
Wie kann ich die anderen Fogs machen, bzw. die Fogs ausstellen?

MFG Markus

Edit:@Erzengel: Stimmt zwar, aber daraus werde ich nicht schlau. ^^
« Letzte Änderung: Februar 27, 2008, 18:32:30 von Goldenboss »

Map_Fog_Script

ERZENGEL

  • Gast
Map_Fog_Script
« Antwort #36 am: Februar 27, 2008, 18:41:15 »
Also man hat z.B. diese Zeilen:
if mid == 5 # Wald / Forest
$game_fog = Game_Fog.new(Cache::picture("Wald1.png"),2,opacity,ox,oy,spy,spy,zoom)
end
Die 5 ist die ID der Map. Wald1 (das png kann man weglassen) ist der Name des Fogs, der im Ordner Pictures liegt.
Wenn man jetzt einen neueun Fog hinzufügen will muss man die Zeilen ändern oder kopieren und darunter einfügen. Dann die 5 in z.B. 6 ändern und je nach Karte den Fog von Wald1 in z.B. Stadt2.

@DarkAngel: Mach ma bitte nen neuen Thread auf + Beispielprojekt + ausführliche Anleitung, sonst kommt es hier noch zu Verwirrung ^^
« Letzte Änderung: Februar 27, 2008, 18:41:45 von ERZENGEL »

Map_Fog_Script

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Map_Fog_Script
« Antwort #37 am: Februar 27, 2008, 18:55:15 »
Jo und wie kann ich nun z.B. nen normalen Fog machen? Bei mir kommen immer diese Wölkchen.

Map_Fog_Script

ERZENGEL

  • Gast
Map_Fog_Script
« Antwort #38 am: Februar 27, 2008, 19:03:28 »
Bist du auf der Map mit ID 1 ^^ ? Müsstest halt das Wolken.png ersetzen durch Nebel. Darüber steht ja: if $mid == 1, das ja bedeutet das bei der Map mit ID 1 die Wolken.png angezeigt wird ;)

P.S.: Das meinte ich mit Einstellungsschwierigkeiten...
« Letzte Änderung: Februar 27, 2008, 19:04:25 von ERZENGEL »

Map_Fog_Script

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Map_Fog_Script
« Antwort #39 am: Februar 27, 2008, 20:23:45 »
Hi,
die Mapid ist 15...

MFG Markus

Map_Fog_Script

Offline Dark Angel

  • Ralph
  • *
  • Beiträge: 12
Map_Fog_Script
« Antwort #40 am: Februar 28, 2008, 13:22:34 »
Also...ich sehe ich hab das wichtigste vergessen.
habe ich etwas weiter "geforscht".

Einfach diese Funktion über dem Script einfügen:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']def var_in(a,v)
 i = 0
 for i in 0..a.size
  if v == a
   return true
  end
  next i
 end
 return false
end

Dann wird im modul FOG wie folgt definiert:

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']if var_in([1,2,3],mid)
 $game_fog = Game_Fog.new(Cache::picture("Wolken.png"),2,opacity,oy,oy,spx,spy,zoom)
end

Dieser Code erzeugt auf den Maps mit den ID's 1, 2 und 3 Wolken.
Die Mapids werden als array übergeben und danach wird mid übergeben.
Ich denke so dürften eure Probleme gelöst sein.

PS.: wo lad ich die FOG-Demo hoch? bzw. wie?*schäm*
EDIT: habs gerad gefunden.
« Letzte Änderung: Februar 28, 2008, 13:25:50 von Dark Angel »
[size=]>> Auf Wunsch programmiere ich Anwendugssoftware ^^ <<
>> RGSS 4 all <<[/size]

Map_Fog_Script

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Map_Fog_Script
« Antwort #41 am: Februar 29, 2008, 10:55:41 »
Hi... Bei mir zeigt er immer noch auf jeder Map den Fog an.

MFG Markus

Map_Fog_Script

Dainreth

  • Gast
Map_Fog_Script
« Antwort #42 am: Februar 29, 2008, 13:29:52 »
Eine weitere Alternative für Fogs: http://www.rpgrevolution.com/forums/?showtopic=9385
Ich verlinke nur mal, da woratana nicht möchte, dass es außerhalb von RRR gepostet wird, ich hoffe ihr könnt soweit englisch. Ah ja, ich finde alle Lösungen gut, will damit nicht, dass die anderen untergehen, nur kann man sich bei der Auswahl vielleicht besser entscheiden, was das beste für einen persönlich ist.

Map_Fog_Script

Offline Dark Angel

  • Ralph
  • *
  • Beiträge: 12
Map_Fog_Script
« Antwort #43 am: Februar 29, 2008, 13:48:28 »
@Goldenboss
Um den MapFog auf einer Map zu deaktivieren muss die MapId
in den Dummyfog.
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']if var_in([4],mid)
$game_fog = Game_Fog.new(Cache::picture("Dummy.png"),2,0,oy,oy,spx,spy,zoom)
end
Hier gehen wir davon aus das die Map mit ID 4 ein Haus ist un darin gibts bekanntlich keine Wolken ;)
Der Dummy is extra für diese Situation angefertigt worden.
Dummy kann eine beliebige leere Grafik sein.
[size=]>> Auf Wunsch programmiere ich Anwendugssoftware ^^ <<
>> RGSS 4 all <<[/size]

Map_Fog_Script

Offline Goldenboss

  • Mr. MACK-Tile
  • ***
  • Beiträge: 251
    • http://www.goldenboss.de
Map_Fog_Script
« Antwort #44 am: März 01, 2008, 12:50:51 »
Hi,

so geht es auch nicht. Fog wird trotzdem angezeigt. Wird immer der zuletzt genannte Fog angezeigt.

Kannst du das ganze nicht vielleicht so ändern, dass man mit einem Event den Fog anzeigen lassen kann?

MFG Markus

 


 Bild des Monats

rooftop party

Views: 3585
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