• Anmelden

1

Donnerstag, 5. Mai 2005, 17:54

MiniMap Script V 1.8[/u:b97d495472]

HIER die Demo.
Weiter unten sieht ihr die Anleitung

Hier noch ein Screenshot :
Bild

So beginnt man:
1. Mich (KHORN) und markusmks in den Credits erwähnen. >.>

2. Ein Ordner mit dem Namen "Minimaps" in den Pictures Ordner erstellen.

3. Diesen Script am besten direkt über Main einfügen:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
#==============================================================================
# ■ MiniMapScript
#------------------------------------------------------------------------------
# Credits  : KHORN, markusmks
#==============================================================================
 
class MiniMapScript < Window_Base
  attr_accessor :modus
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  def initialize(mapname=nil)
    super(0, 0, 200, 67)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.color = normal_color
    self.contents.font.name = "Arial"
    self.contents.font.size = 20
    self.windowskin = nil
    # ---------------------------OPTIONEN-------------------------
    # Modus 1 = Echter Map name zu "mapname.png" zB: "Dungeon.png"
    # Modus 2 = Echte Map ID name zu "mapID.png" zB: "1.png"
    # Modus 3 = $name_minim[MapID] = "BILD" / bitte ohne ".png"
    # ============================================================
    @modus = 3
    # ------------------------------------------------------------
    @mapname = mapname
    if @modus == 1
      real_map = $game_map.name
    elsif @modus == 2
      real_map = $game_map.map_id.to_s
    elsif @modus == 3
      real_map = $name_minim[$game_map.map_id]
    end
    @real_map = real_map
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+real_map+".png")
      @mapname = real_map
    end
    if @mapname != nil
      #--<Farben>--
      player_color = Color.new(0,0,0)
      npc_color = Color.new(255,0,0)
      #----MAP------------------------#
      @player_color=player_color
      @npc_color=npc_color
      @gra_dir = "Graphics/Pictures/MiniMaps/"
      @mmap = @gra_dir+@mapname+".png"
      map = Bitmap.new(@mmap)
      @map_sprite = Sprite.new
      @map_sprite.bitmap = map
      @map_sprite.x = 0
      @map_sprite.y = 0
      @map_sprite.opacity = 180
      @map_sprite.zoom_x = 0.98
      @map_sprite.zoom_y = 0.98
      #------PLAYER------------#
      @player_sprite = Sprite.new
      @player_sprite.bitmap = Bitmap.new(3,3) ###
      @player_sprite.bitmap.fill_rect(0,0,3,3,@player_color) 
      @event_sprite = []
      for i in $game_map.events.keys.sort
        if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
          @event_sprite[i] = Sprite.new   
          @event_sprite[i].bitmap = Bitmap.new(3,3) 
          if $game_map.events[i].list[1].parameters[0] != nil
            colors = $game_map.events[i].list[1].parameters[0].split
            red = colors[0].to_i
            green = colors[1].to_i
            blue = colors[2].to_i
            @npc_color = Color.new(red,green,blue)
          else
            @npc_color = Color.new(255,0,0)
          end
          @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color) 
        end
        #----
         if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_pic"])
            @event_sprite[i] = Sprite.new
            graphic = $game_map.events[i].list[1].parameters[0]
            @event_sprite[i].bitmap = Bitmap.new(graphic)
         end
        #---
      end
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @event_sprite == []
      renew
    end
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
      @mapname = @real_map
    else
      @mapname = nil
    end
    if @mapname != nil
      for i in $game_map.events.keys.sort
        if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
          if @event_sprite == []
            renew
            return
          end
          @event_sprite[i].x = $game_map.events[i].real_x / 16
          @event_sprite[i].y = $game_map.events[i].real_y / 16
          @event_sprite[i].opacity = 255
          @event_sprite[i].zoom_x = 1
          @event_sprite[i].zoom_y = 1
        end
        #----
        if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_pic"])
          @event_sprite[i].x = $game_map.events[i].real_x/16
          @event_sprite[i].y = $game_map.events[i].real_y/16
          @event_sprite[i].opacity = 255
          @event_sprite[i].zoom_x = 1
          @event_sprite[i].zoom_y = 1
        end
        #----
        i += 1
      end
      #----PLAYER MOVE---------#
      @player_sprite.x = $game_player.real_x/16
      @player_sprite.y = $game_player.real_y/16
      @player_sprite.opacity = 255
      @player_sprite.zoom_x = 1
      @player_sprite.zoom_y = 1  
      #----------------------------#
    end
  end
  #--------------------------------------------------------------------------
  # ● Renew Graphics
  #--------------------------------------------------------------------------
  def renew
    dispose
    if @modus == 1
      real_map = $game_map.name
    elsif @modus == 2
      real_map = $game_map.map_id.to_s
    elsif @modus == 3
      real_map = $name_minim[$game_map.map_id]
    end
    @real_map = real_map
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
      @mapname = real_map
    end
    @gra_dir = "Graphics/Pictures/MiniMaps/"
    @mmap = @gra_dir+@mapname+".png"
    map = Bitmap.new(@mmap)
    @map_sprite = Sprite.new
    @map_sprite.bitmap = map
    @map_sprite.x = 0
    @map_sprite.y = 0
    @map_sprite.opacity = 180
    @map_sprite.zoom_x = 0.98
    @map_sprite.zoom_y = 0.98
    @player_sprite = Sprite.new
    @player_sprite.bitmap = Bitmap.new(3,3) 
 
    @player_sprite.bitmap.fill_rect(0,0,3,3,@player_color=Color.new(0,0,0)) 
    @event_sprite = []
    for i in $game_map.events.keys.sort
      if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
        @event_sprite[i] = Sprite.new   
        @event_sprite[i].bitmap = Bitmap.new(3,3) 
        if $game_map.events[i].list[1].parameters[0] != nil
          colors = $game_map.events[i].list[1].parameters[0].split
          red = colors[0].to_i
          green = colors[1].to_i
          blue = colors[2].to_i
          @npc_color = Color.new(red,green,blue)
        else
          @npc_color = Color.new(255,0,0)
        end
        @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color) 
      end
      #----
      if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_pic"])
         @event_sprite[i] = Sprite.new
         graphic = $game_map.events[i].list[1].parameters[0]
         @event_sprite[i].bitmap = Bitmap.new(graphic)
      end
      #---
 
    end
  end
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------
  def update
    if @modus == 3 and $name_minim[$game_map.map_id] != ""
      renew
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● Dispose all
  #--------------------------------------------------------------------------
  def dispose
    if @event_sprite != nil
      for sprite in @event_sprite
        if sprite != nil
          sprite.dispose
        end
      end
    end
    if @player_sprite != nil
      @player_sprite.dispose
    end
    if @map_sprite != nil
      @map_sprite.dispose
    end
  end
end
 
#==============================================================================
# ■ Game_MiniMap
#------------------------------------------------------------------------------
# © markusmks
#==============================================================================
 
class Game_MiniMap
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  def initialize
    @data = []
  end
  #--------------------------------------------------------------------------
  # ● Map ID
  #     variable_id : Map ID
  #--------------------------------------------------------------------------
  def [](variable_id)
    if variable_id <= 5000 and @data[variable_id] != nil
      return @data[variable_id]
    else
      return ""
    end
  end
  #--------------------------------------------------------------------------
  # ● MiniMap Bild angeben...
  #     variable_id : Map ID
  #     value       : Bild Name
  #--------------------------------------------------------------------------
  def []=(variable_id, value)
    if variable_id <= 5000
      @data[variable_id] = value
    end
  end
end
 
# ==================== ab hier unwichtig ===========================
# Beschreibung:
# Da dieser Teil eigentlich unwichtig ist, hat er trotzdem einen
# wichtigkeits grad. 
# Jeder der: Scene_Titel,Scene_Save,Scene_Load
# schonmal editiert haben sollte, soll nur den teil unter # EDIT --
# in den dazugehörigen Scene_ einfügen... 
# Danach Muss man die ganzen codes unterhalb von "ab hier unwichtig"
# löschen
# ==================================================================
class Scene_Title
  def command_new_game
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_stop
    Graphics.frame_count = 0
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # EDIT -------------------------------
    $name_minim         = Game_MiniMap.new
    # ------------------------------------
    $game_party.setup_starting_members
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end
end
class Scene_Save
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    # EDIT ------------------------
    Marshal.dump($name_minim, file)
    # -----------------------------
  end
end
class Scene_Load
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    # EDIT ---------------------------------
    $name_minim         = Marshal.load(file)
    # --------------------------------------
    if $game_system.magic_number != $data_system.magic_number
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
  end
end


4. Scene_Map durch diesen Script ersetzen :

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#==============================================================================
# ■ Show Map .name
#------------------------------------------------------------------------------
#  shows map name
#==============================================================================
 
class Game_Map
 def name
   $map_infos[@map_id]
 end
end
 
class Scene_Title
 $map_infos = load_data("Data/MapInfos.rxdata")
 for key in $map_infos.keys
   $map_infos[key] = $map_infos[key].name
 end
end
 
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
#  einige edits für minimap, von markusmks
#   1) line 1-18
#   2) line 43
#   3) line 65
#   4) line 85-89
#   5) line 304-305
#   
#   Diese Codes in schon editierte Scene_Maps einfügen, oder wenn man nichts
#   editiert hat, einfach Scene_Map ersetzen
#==============================================================================
 
class Scene_Map
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    # スプライトセットを作成
    @spriteset = Spriteset_Map.new
    # メッセージウィンドウを作成
    @message_window = Window_Message.new
    @mini_map = MiniMapScript.new
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # スプライトセットを解放
    @spriteset.dispose
    # メッセージウィンドウを解放
    @message_window.dispose
    @mini_map.dispose
    # タイトル画面に切り替え中の場合
    if $scene.is_a?(Scene_Title)
      # 画面をフェードアウト
      Graphics.transition
      Graphics.freeze
    end
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # ループ
    loop do
      # マップ、インタプリタ、プレイヤーの順に更新
      # (この更新順序は、イベントを実行する条件が満たされているときに
      #  プレイヤーに一瞬移動する機会を与えないなどの理由で重要)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      if @mini_map != nil
        @mini_map.update
      else
        @mini_map = MiniMapScript.new
      end
      # システム (タイマー)、画面を更新
      $game_system.update
      $game_screen.update
      # プレイヤーの場所移動中でなければループを中断
      unless $game_temp.player_transferring
        break
      end
      # 場所移動を実行
      transfer_player
      # トランジション処理中の場合、ループを中断
      if $game_temp.transition_processing
        break
      end
    end
    # スプライトセットを更新
    @spriteset.update
    # メッセージウィンドウを更新
    @message_window.update
    # ゲームオーバーの場合
    if $game_temp.gameover
      # ゲームオーバー画面に切り替え
      $scene = Scene_Gameover.new
      return
    end
    # タイトル画面に戻す場合
    if $game_temp.to_title
      # タイトル画面に切り替え
      $scene = Scene_Title.new
      return
    end
    # トランジション処理中の場合
    if $game_temp.transition_processing
      # トランジション処理中フラグをクリア
      $game_temp.transition_processing = false
      # トランジション実行
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # メッセージウィンドウ表示中の場合
    if $game_temp.message_window_showing
      return
    end
    # エンカウント カウントが 0 で、エンカウントリストが空ではない場合
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # イベント実行中かエンカウント禁止中でなければ
      unless $game_system.map_interpreter.running? or
             $game_system.encounter_disabled
        # トループを決定
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # トループが有効なら
        if $data_troops[troop_id] != nil
          # バトル呼び出しフラグをセット
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      # イベント実行中かメニュー禁止中でなければ
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # メニュー呼び出しフラグと SE 演奏フラグをセット
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # デバッグモードが ON かつ F9 キーが押されている場合
    if $DEBUG and Input.press?(Input::F9)
      # デバッグ呼び出しフラグをセット
      $game_temp.debug_calling = true
    end
    # プレイヤーの移動中ではない場合
    unless $game_player.moving?
      # 各種画面の呼び出しを実行
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● バトルの呼び出し
  #--------------------------------------------------------------------------
  def call_battle
    # バトル呼び出しフラグをクリア
    $game_temp.battle_calling = false
    # メニュー呼び出しフラグをクリア
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # エンカウント カウントを作成
    $game_player.make_encounter_count
    # マップ BGM を記憶し、BGM を停止
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # バトル開始 SE を演奏
    $game_system.se_play($data_system.battle_start_se)
    # バトル BGM を演奏
    $game_system.bgm_play($game_system.battle_bgm)
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # バトル画面に切り替え
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # ● ショップの呼び出し
  #--------------------------------------------------------------------------
  def call_shop
    # ショップ呼び出しフラグをクリア
    $game_temp.shop_calling = false
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # ショップ画面に切り替え
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # ● 名前入力の呼び出し
  #--------------------------------------------------------------------------
  def call_name
    # 名前入力呼び出しフラグをクリア
    $game_temp.name_calling = false
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # 名前入力画面に切り替え
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # ● メニューの呼び出し
  #--------------------------------------------------------------------------
  def call_menu
    # メニュー呼び出しフラグをクリア
    $game_temp.menu_calling = false
    # メニュー SE 演奏フラグがセットされている場合
    if $game_temp.menu_beep
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      # メニュー SE 演奏フラグをクリア
      $game_temp.menu_beep = false
    end
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # メニュー画面に切り替え
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # ● セーブの呼び出し
  #--------------------------------------------------------------------------
  def call_save
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # セーブ画面に切り替え
    $scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # ● デバッグの呼び出し
  #--------------------------------------------------------------------------
  def call_debug
    # デバッグ呼び出しフラグをクリア
    $game_temp.debug_calling = false
    # 決定 SE を演奏
    $game_system.se_play($data_system.decision_se)
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # デバッグ画面に切り替え
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # ● プレイヤーの場所移動
  #--------------------------------------------------------------------------
  def transfer_player
    # プレイヤー場所移動フラグをクリア
    $game_temp.player_transferring = false
    # 移動先が現在のマップと異なる場合
    if $game_map.map_id != $game_temp.player_new_map_id
      # 新しいマップをセットアップ
      $game_map.setup($game_temp.player_new_map_id)
    end
    # プレイヤーの位置を設定
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # プレイヤーの向きを設定
    case $game_temp.player_new_direction
    when 2  # 下
      $game_player.turn_down
    when 4  # 左
      $game_player.turn_left
    when 6  # 右
      $game_player.turn_right
    when 8  # 上
      $game_player.turn_up
    end
    # プレイヤーの姿勢を矯正
    $game_player.straighten
    # マップを更新 (並列イベント実行)
    $game_map.update
    # スプライトセットを再作成
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    @mini_map.dispose
    @mini_map = MiniMapScript.new
    # トランジション処理中の場合
    if $game_temp.transition_processing
      # トランジション処理中フラグをクリア
      $game_temp.transition_processing = false
      # トランジション実行
      Graphics.transition(20)
    end
    # マップに設定されている BGM と BGS の自動切り替えを実行
    $game_map.autoplay
    # フレームリセット
    Graphics.frame_reset
    # 入力情報を更新
    Input.update
  end
end
 

[b:b97d495472][size=120]----//----//----//----//----//----//----//----//----//----//----


So, jetzt haben wir den Minimap-Script eingebaut.

Aber jetzt brauchen wir noch die MiniMaps ...
Also als erstes erstellen wir eine Map.
Dann müssen wir diese Map im Maker auszoomen (1/4).
Dann machen wir ein Screenshot und schneiden die Map zu recht, so das man nur noch die Map sieht, und speichern es in den Pictures/Minimaps Ordner den wir erstellt haben.

TUTORIAL:
F) Wie mach ich ein Screenshot?
A) Mit der [Druck] (S-Abf) Taste auf der Tastatur. Achtung, manche Tastaturen haben diese Taste nicht. Hierfür muss man sich ein Programm suchen, welches das kann.

F) Wenn die Map Größer ist, und das ganze nicht auf 1/4 passt, was mache ich dann (Weltkarte)?
A) Kanns easy. Einfach die mehrere Bilder machen (also immer mit den scroll balken wo anders hinfahren) und zurechtschneiden...

Ok, jetzt zu den Events.
Als erstes erstellen wir ein Event.
Dann machen wir folgendes :

Das Event muss auf Autostart geschaltet sein!
<>Call Script:

Quellcode

1
$name_minim[1] = "map01"


<>Erase Event



Hier nochmal mit Erklärung :

$name_minim[MapID] = "Dateiname der Minimap"
MapID : Die Map ID steht im Maker unten in der "Statusleiste".
Dateiname der Minimap : Hier muss die Dateiname der Minimap, die wir erstellt haben und in den Minimap Ordner gespeichert haben. (Ohne .png oder ähnliches am ende!).

Soweit so gut...
Wenn ihr jetzt das Spiel startet, dann sieht ihr die Minimap und den Spieler auf der Minimap.

Wie füge ich NPC zu der Minimap hinzu?
Als erstes macht ihr ein Event.
Dann macht ihr in dem Event als erstes ein Kommentar mit dem Inhalt :

Quellcode

1
2
mm_point
0 0 0

Die Zahlen 0 0 0 stehen für die Farben des Punktes. Also in dieser Farbe wird der Punkt angezeigt. Jede null kann bis 255 erweitert werden.
zB: 160 255 0
------------------------------------------------------------------------------

Das wars auch eigentlich schon :D
Falls ihr diesen Script in eurem Game benutzen wollt, dann erwähnt uns bitte in den Credits : KHORN, markusmks[/b:b97d495472] ^^

Danke

2

Donnerstag, 5. Mai 2005, 18:48

also ich kann nur sagen:



[size=140]GEIL!!!!![/size]


ich werde es auf jeden fall benutzen!


aber was ist wenn die map riesig ist und nicht auf den 1/4 zoom des makers passt(wie eine worldmap)?

3

Donnerstag, 5. Mai 2005, 19:04

dann kann man scrollen und ein bischen zurechtschneiden ;)

4

Donnerstag, 5. Mai 2005, 19:22

so eins gabs doch schonma 0.o?
[ALIGN="center"] Bild [/align]

5

Donnerstag, 5. Mai 2005, 19:28

Zitat von »"Lelli"«

so eins gabs doch schonma 0.o?

das glaub ich nicht...
wenn doch, poste bitte Link.

6

Donnerstag, 5. Mai 2005, 19:35

Bei mir kommt ne fehlermeldung:

?????`MiniMapScript`?32???NoMethodError ??????????
undefined method `[]` for nil:NilClass


help
There was a Cave,
below a Silent's Grave.
Tunnels, extending far, running wide,
going deep into the World on the other Side.
Poor little Child, that was to brave,
died painfully deep down, in the Devil's Cave.

7

Donnerstag, 5. Mai 2005, 19:36

ne das war nur so ähnlich das sah von der map her au genauso aus 0.ô ich hatte es heute morgen noch gesehen weiß aber nich mehr wo (da ich firefox benutze hab ich meistens sehr viele tabs auf mit seiten un komm durcheinander... bei ca 30 tabs kein wunder ~.~...) naja auf jedenfall toll gemacht ^^ aber was hab ich zu ändern damit man nur den spieler sieht un nich die npcs? und wie kann ich den cursor des spielers anstelle mit nem schwarzen punkt mit nem bild versehen o.ô (mich mit der art von skripten garnich auskenn)
[ALIGN="center"] Bild [/align]

8

Donnerstag, 5. Mai 2005, 19:38

Zitat von »"Sir Lord Biowulve"«

Bei mir kommt ne fehlermeldung:

?????`MiniMapScript`?32???NoMethodError ??????????
undefined method `[]` for nil:NilClass


help


kommt das auch in der demo ?
sieh nochmal nach ich wette du hast was falsch gemacht ;)
ließ dir nochmal mein TUT durch zum einbauen, an der Stelle wo man die ersten Events macht.

9

Donnerstag, 5. Mai 2005, 20:10

*hüstel* un mei problem? ^^ in der demo kommt kein fehler
[ALIGN="center"] Bild [/align]

10

Donnerstag, 5. Mai 2005, 20:11

Zitat von »"Sir Lord Biowulve"«

Bei mir kommt ne fehlermeldung:

?????`MiniMapScript`?32???NoMethodError ??????????
undefined method `[]` for nil:NilClass


help


du hast vll Game_MiniMap unten von script vergessen...
also kopier nochmal den ganzen script

wenn das nicht das problem ist, dann stimmt was mit $game_map.name nicht, aber das trifft nur zu, wenn du Scene_Map nicht ersetzt hast (mit den neuen script)...
ansonsten fällt mir nichts spontan ein...

11

Donnerstag, 5. Mai 2005, 20:12

Zitat von »"Lelli"«

*hüstel* un mei problem? ^^ in der demo kommt kein fehler

du willst kene NPC´s anzeigen lassen ?
dann ließ den TUT durch und lass die Stelle mit den NPC´s weg.

12

Donnerstag, 5. Mai 2005, 20:13

Whoa...
Es funzt... hab des was ich in Scene-Title, Scene_Save und load umeditieren muss übersehen... Kleiner Tipp... Mach dir des nächste mal die Mühe und mach des zum umeditiern einzeln, dann übersieht man des ned.

Newbies werden ja wohl schlecht jedes neue Skript auf Edits untersuchen...



Jetzt des Lob:[size=140]KRASSER ALS KRASS[/size]


Eine Frage die Lelli schon fragte:
Wie kann man dem Spieler statt nem Punkt z.B. ein Bild aus dem Picture Ordner nehmen... Ich hätte en 6x6 großes fadenkruez dafür
There was a Cave,
below a Silent's Grave.
Tunnels, extending far, running wide,
going deep into the World on the other Side.
Poor little Child, that was to brave,
died painfully deep down, in the Devil's Cave.

13

Donnerstag, 5. Mai 2005, 21:01

OK
So macht man, dass die charakter grafik kein punkt ist sondern ein Bild :
Einfach MiniMapScript durch diesen editierten MinimapScript ersetzen :

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#==============================================================================
# ■ MiniMapScript
#------------------------------------------------------------------------------
# Credits  : KHORN, markusmks
#==============================================================================
#CHARAKTER GRAFIK AUF DER MINIMAP
$player_point = Bitmap.new("Graphics/Pictures/point.png")#HIER PFAD EINSTELLEN
 
class MiniMapScript < Window_Base
  attr_accessor :modus
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  def initialize(mapname=nil)
    super(0, 0, 200, 67)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.color = normal_color
    self.contents.font.name = "Arial"
    self.contents.font.size = 20
    self.windowskin = nil
    # ---------------------------OPTIONEN-------------------------
    # Modus 1 = Echter Map name zu "mapname.png" zB: "Dungeon.png"
    # Modus 2 = Echte Map ID name zu "mapID.png" zB: "1.png"
    # Modus 3 = $name_minim[MapID] = "BILD" / bitte ohne ".png"
    # ============================================================
    @modus = 3
    # ------------------------------------------------------------
    @mapname = mapname
    if @modus == 1
      real_map = $game_map.name
    elsif @modus == 2
      real_map = $game_map.map_id.to_s
    elsif @modus == 3
      real_map = $name_minim[$game_map.map_id]
    end
    @real_map = real_map
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+real_map+".png")
      @mapname = real_map
    end
    if @mapname != nil
      #--<Farben>--
      player_color = Color.new(0,0,0)
      npc_color = Color.new(255,0,0)
      #----MAP------------------------#
      @player_color=player_color
      @npc_color=npc_color
      @gra_dir = "Graphics/Pictures/MiniMaps/"
      @mmap = @gra_dir+@mapname+".png"
      map = Bitmap.new(@mmap)
      @map_sprite = Sprite.new
      @map_sprite.bitmap = map
      @map_sprite.x = 0
      @map_sprite.y = 0
      @map_sprite.opacity = 180
      @map_sprite.zoom_x = 0.98
      @map_sprite.zoom_y = 0.98
      #------PLAYER------------#
      @player_sprite = Sprite.new
      @player_sprite.bitmap = $player_point
      @event_sprite = []
      for i in $game_map.events.keys.sort
        if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
          @event_sprite[i] = Sprite.new   
          @event_sprite[i].bitmap = Bitmap.new(3,3)
          if $game_map.events[i].list[1].parameters[0] != nil
            colors = $game_map.events[i].list[1].parameters[0].split
            red = colors[0].to_i
            green = colors[1].to_i
            blue = colors[2].to_i
            @npc_color = Color.new(red,green,blue)
          else
            @npc_color = Color.new(255,0,0)
          end
          @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color)
        end
      end
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @event_sprite == []
      renew
    end
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
      @mapname = @real_map
    else
      @mapname = nil
    end
    if @mapname != nil
      for i in $game_map.events.keys.sort
        if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
          if @event_sprite == []
            renew
            return
          end
          @event_sprite[i].x = $game_map.events[i].real_x/16
          @event_sprite[i].y = $game_map.events[i].real_y/16
          @event_sprite[i].opacity = 255
          @event_sprite[i].zoom_x = 1
          @event_sprite[i].zoom_y = 1
        end
        i += 1
      end
      #----PLAYER MOVE---------#
      @player_sprite.x = $game_player.real_x/16
      @player_sprite.y = $game_player.real_y/16
      @player_sprite.opacity = 255
      @player_sprite.zoom_x = 1
      @player_sprite.zoom_y = 1 
      #----------------------------#
    end
  end
  #--------------------------------------------------------------------------
  # ● Renew Graphics
  #--------------------------------------------------------------------------
  def renew
    dispose
    if @modus == 1
      real_map = $game_map.name
    elsif @modus == 2
      real_map = $game_map.map_id.to_s
    elsif @modus == 3
      real_map = $name_minim[$game_map.map_id]
    end
 
    @real_map = real_map
    if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
      @mapname = real_map
 
    end
    @gra_dir = "Graphics/Pictures/MiniMaps/"
    @mmap = @gra_dir+@mapname+".png"
    map = Bitmap.new(@mmap)
    @map_sprite = Sprite.new
    @map_sprite.bitmap = map
    @map_sprite.x = 0
    @map_sprite.y = 0
    @map_sprite.opacity = 180
    @map_sprite.zoom_x = 0.98
    @map_sprite.zoom_y = 0.98
    @player_sprite = Sprite.new
    @player_sprite.bitmap = $player_point#*****
    #
    #
 
    @event_sprite = []
    for i in $game_map.events.keys.sort
      if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
        @event_sprite[i] = Sprite.new   
        @event_sprite[i].bitmap = Bitmap.new(3,3)
        if $game_map.events[i].list[1].parameters[0] != nil
          colors = $game_map.events[i].list[1].parameters[0].split
          red = colors[0].to_i
          green = colors[1].to_i
          blue = colors[2].to_i
          @npc_color = Color.new(red,green,blue)
        else
          @npc_color = Color.new(255,0,0)
        end
        @event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------
  def update
    if @modus == 3 and $name_minim[$game_map.map_id] != ""
      renew
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # ● Dispose all
  #--------------------------------------------------------------------------
  def dispose
    if @event_sprite != nil
      for sprite in @event_sprite
        if sprite != nil
          sprite.dispose
        end
      end
    end
    if @player_sprite != nil
      @player_sprite.dispose
    end
    if @map_sprite != nil
      @map_sprite.dispose
    end
  end
end
 
#==============================================================================
# ■ Game_MiniMap
#------------------------------------------------------------------------------
# © markusmks
#==============================================================================
 
class Game_MiniMap
  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  def initialize
    @data = []
  end
  #--------------------------------------------------------------------------
  # ● Map ID
  #     variable_id : Map ID
  #--------------------------------------------------------------------------
  def [](variable_id)
    if variable_id <= 5000 and @data[variable_id] != nil
      return @data[variable_id]
    else
      return ""
    end
  end
  #--------------------------------------------------------------------------
  # ● MiniMap Bild angeben...
  #     variable_id : Map ID
  #     value       : Bild Name
  #--------------------------------------------------------------------------
  def []=(variable_id, value)
    if variable_id <= 5000
      @data[variable_id] = value
    end
  end
end
 
# ==================== ab hier unwichtig ===========================
# Beschreibung:
# Da dieser Teil eigentlich unwichtig ist, hat er trotzdem einen
# wichtigkeits grad.
# Jeder der: Scene_Titel,Scene_Save,Scene_Load
# schonmal editiert haben sollte, soll nur den teil unter # EDIT --
# in den dazugehörigen Scene_ einfügen...
# Danach Muss man die ganzen codes unterhalb von "ab hier unwichtig"
# löschen
# ==================================================================
 
class Scene_Title
  def command_new_game
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_stop
    Graphics.frame_count = 0
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    # EDIT -------------------------------
    $name_minim         = Game_MiniMap.new
    # ------------------------------------
    $game_party.setup_starting_members
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end
end
class Scene_Save
  def write_save_data(file)
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    Marshal.dump(characters, file)
 
    Marshal.dump(Graphics.frame_count, file)
    $game_system.save_count += 1
    $game_system.magic_number = $data_system.magic_number
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    # EDIT ------------------------
    Marshal.dump($name_minim, file)
    # -----------------------------
  end
end
class Scene_Load
  def read_save_data(file)
    characters = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    # EDIT ---------------------------------
    $name_minim         = Marshal.load(file)
    # --------------------------------------
    if $game_system.magic_number != $data_system.magic_number
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    $game_party.refresh
  end
end


WICHTIG : Den Pfad zu der Graifik vom Charakter steht in der Zeile : 7

14

Donnerstag, 5. Mai 2005, 21:07

Ist cool keine Frage das script...steckt auch sicher ne Menge an Arbeit dahinter...(übernimm dich nicht mein junge^^)

Aber ich glaube ich benutze es nich......wenn dann mach mir
was eigenes....der "Special Thanx to:" Abschnitt in meinen
Credits soll ja auch nicht zu lan werden :P


Nes tolles script, großes Lob, und Gute Nacht^^
Bild Greetz an Special Thx: Emixp, Eddi, Geo, Rabu, Lelli, Eddi, Ryo Sakura, GruSy, Sasuke und natürlich alle Mods und Admins die so wunderbar auf das Forum hier aufpassen.

15

Donnerstag, 5. Mai 2005, 21:08

also wie man das skript startet weiß ich ja nu, tut man das löschen mit .dispose?
[ALIGN="center"] Bild [/align]

16

Freitag, 6. Mai 2005, 18:56

Thx... viel besser... COOL
There was a Cave,
below a Silent's Grave.
Tunnels, extending far, running wide,
going deep into the World on the other Side.
Poor little Child, that was to brave,
died painfully deep down, in the Devil's Cave.

17

Sonntag, 8. Mai 2005, 16:19

Also...

Wenn man negrößere map hat, z.B. 100x100
Dann macht man es wie folgt:


- Man zoomt die map auf 1/4
- man macht nen Screenshot und fügt des bild mit STRG + C in Paint ein. Zurechtschneiden
- Dann, falls di Karte zu groß iss, Scrollt man des gante bis man den rest hat und macht wieder nen Screenshot.
- Diesesmal öffnet man en neues paint und macht des elbe wie mit dem ersten Screenshot.

- Nun speichern wir den ersten MAP01.png und den zwieten MPA02.png


- Im maker machen wir en neues Event auf Autostart und Fügen ein:
<> Call Skript: $name_minim[1] = "MAP01"
<> Event Löschen

- nun macht man da en neues Event wo die MiniMap MAP01.png aufhört +1 ( also noch ein feld weiter.
- Das Event auf Heldenberührung.
<> Call Skript: $name_minim[1] = "MAP02"
<> Set variable[XXXX] = 1

- Mach ne zweite Seite die leer iss und nur an iss wenn Vraiable XXXX = 1 ist.


- mach en neues Event ein Feld weiter hinten. Und mach folgendes:
- Event Seite 1 iss leer.
- Eventseite zwei iss aktiv wenn Variable XXXX = 1.
- mach auf die zweite Seite:
<> Call Skript: $name_minim[1] = "MAP01"
<> Set variable[XXXX] = 0


jetzt wechselt die Minimap immer wenn der held den rand der Minimap ereicht hat und nen Schritt weitergeht.
There was a Cave,
below a Silent's Grave.
Tunnels, extending far, running wide,
going deep into the World on the other Side.
Poor little Child, that was to brave,
died painfully deep down, in the Devil's Cave.

18

Sonntag, 8. Mai 2005, 20:04

Wie jetzt, bei mir kommt auch der Fehler, dass Biowulve hatte. Wie behebt man das jetzt?

19

Montag, 9. Mai 2005, 10:11

[quote==============================================================================
# ■ MiniMapScript
#------------------------------------------------------------------------------
# Credits : KHORN, markusmks
#==============================================================================

class MiniMapScript < Window_Base
attr_accessor :modus
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(mapname=nil)
super(0, 0, 200, 67)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.color = normal_color
self.contents.font.name = "Arial"
self.contents.font.size = 20
self.windowskin = nil
# ---------------------------OPTIONEN-------------------------
# Modus 1 = Echter Map name zu "mapname.png" zB: "Dungeon.png"
# Modus 2 = Echte Map ID name zu "mapID.png" zB: "1.png"
# Modus 3 = $name_minim[MapID] = "BILD" / bitte ohne ".png"
# ============================================================
@modus = 3
# ------------------------------------------------------------
@mapname = mapname
if @modus == 1
real_map = $game_map.name
elsif @modus == 2
real_map = $game_map.map_id.to_s
elsif @modus == 3
real_map = $name_minim[$game_map.map_id]
end
@real_map = real_map
if FileTest.exist?("Graphics/Pictures/MiniMaps/"+real_map+".png")
@mapname = real_map
end
if @mapname != nil
#--<Farben>--
player_color = Color.new(0,0,0)
npc_color = Color.new(255,0,0)
#----MAP------------------------#
@player_color=player_color
@npc_color=npc_color
@gra_dir = "Graphics/Pictures/MiniMaps/"
@mmap = @gra_dir+@mapname+".png"
map = Bitmap.new(@mmap)
@map_sprite = Sprite.new
@map_sprite.bitmap = map
@map_sprite.x = 0
@map_sprite.y = 0
@map_sprite.opacity = 180
@map_sprite.zoom_x = 0.98
@map_sprite.zoom_y = 0.98
#------PLAYER------------#
@player_sprite = Sprite.new
@player_sprite.bitmap = Bitmap.new(3,3)
@player_sprite.bitmap.fill_rect(0,0,3,3,@player_color)
@event_sprite = []
for i in $game_map.events.keys.sort
if ($game_map.events.is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
@event_sprite[i] = Sprite.new
@event_sprite[i].bitmap = Bitmap.new(3,3)
if $game_map.events[i].list[1].parameters[0] != nil
colors = $game_map.events[i].list[1].parameters[0].split
red = colors[0].to_i
green = colors[1].to_i
blue = colors[2].to_i
@npc_color = Color.new(red,green,blue)
else
@npc_color = Color.new(255,0,0)
end
@event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color)
end
end
refresh
end
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @event_sprite == []
renew
end
if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
@mapname = @real_map
else
@mapname = nil
end
if @mapname != nil
for i in $game_map.events.keys.sort
if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
if @event_sprite == []
renew
return
end
@event_sprite[i].x = $game_map.events[i].real_x/16
@event_sprite[i].y = $game_map.events[i].real_y/16
@event_sprite[i].opacity = 255
@event_sprite[i].zoom_x = 1
@event_sprite[i].zoom_y = 1
end
i += 1
end
#----PLAYER MOVE---------#
@player_sprite.x = $game_player.real_x/16
@player_sprite.y = $game_player.real_y/16
@player_sprite.opacity = 255
@player_sprite.zoom_x = 1
@player_sprite.zoom_y = 1
#----------------------------#
end
end
#--------------------------------------------------------------------------
# ● Renew Graphics
#--------------------------------------------------------------------------
def renew
dispose
if @modus == 1
real_map = $game_map.name
elsif @modus == 2
real_map = $game_map.map_id.to_s
elsif @modus == 3
real_map = $name_minim[$game_map.map_id]
end

@real_map = real_map
if FileTest.exist?("Graphics/Pictures/MiniMaps/"+@real_map+".png")
@mapname = real_map

end
@gra_dir = "Graphics/Pictures/MiniMaps/"
@mmap = @gra_dir+@mapname+".png"
map = Bitmap.new(@mmap)
@map_sprite = Sprite.new
@map_sprite.bitmap = map
@map_sprite.x = 0
@map_sprite.y = 0
@map_sprite.opacity = 180
@map_sprite.zoom_x = 0.98
@map_sprite.zoom_y = 0.98
@player_sprite = Sprite.new
@player_sprite.bitmap = Bitmap.new(3,3)

@player_sprite.bitmap.fill_rect(0,0,3,3,@player_color=Color.new(0,0,0))
@event_sprite = []
for i in $game_map.events.keys.sort
if ($game_map.events[i].is_a?(Game_Event) and $game_map.events[i].list!=nil and $game_map.events[i].list[0].code == 108 and $game_map.events[i].list[0].parameters == ["mm_point"])
@event_sprite[i] = Sprite.new
@event_sprite[i].bitmap = Bitmap.new(3,3)
if $game_map.events[i].list[1].parameters[0] != nil
colors = $game_map.events[i].list[1].parameters[0].split
red = colors[0].to_i
green = colors[1].to_i
blue = colors[2].to_i
@npc_color = Color.new(red,green,blue)
else
@npc_color = Color.new(255,0,0)
end
@event_sprite[i].bitmap.fill_rect(0,0,3,3,@npc_color)
end
end
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
if @modus == 3 and $name_minim[$game_map.map_id] != ""
renew
end
refresh
end
#--------------------------------------------------------------------------
# ● Dispose all
#--------------------------------------------------------------------------
def dispose
if @event_sprite != nil
for sprite in @event_sprite
if sprite != nil
sprite.dispose
end
end
end
if @player_sprite != nil
@player_sprite.dispose
end
if @map_sprite != nil
@map_sprite.dispose
end
end
end

#==============================================================================
# ■ Game_MiniMap
#------------------------------------------------------------------------------
# © markusmks
#==============================================================================

class Game_MiniMap
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
@data = []
end
#--------------------------------------------------------------------------
# ● Map ID
# variable_id : Map ID
#--------------------------------------------------------------------------
def [](variable_id)
if variable_id <= 5000 and @data[variable_id] != nil
return @data[variable_id]
else
return ""
end
end
#--------------------------------------------------------------------------
# ● MiniMap Bild angeben...
# variable_id : Map ID
# value : Bild Name
#--------------------------------------------------------------------------
def []=(variable_id, value)
if variable_id <= 5000
@data[variable_id] = value
end
end
end

# ==================== ab hier unwichtig ===========================
# Beschreibung:
# Da dieser Teil eigentlich unwichtig ist, hat er trotzdem einen
# wichtigkeits grad.
# Jeder der: Scene_Titel,Scene_Save,Scene_Load
# schonmal editiert haben sollte, soll nur den teil unter # EDIT --
# in den dazugehörigen Scene_ einfügen...
# Danach Muss man die ganzen codes unterhalb von "ab hier unwichtig"
# löschen
# ==================================================================

class Scene_Title
def command_new_game
$game_system.se_play($data_system.decision_se)
Audio.bgm_stop
Graphics.frame_count = 0
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# EDIT -------------------------------
$name_minim = Game_MiniMap.new
# ------------------------------------
$game_party.setup_starting_members
$game_map.setup($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$game_map.autoplay
$game_map.update
$scene = Scene_Map.new
end
end
class Scene_Save
def write_save_data(file)
characters = []
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
characters.push([actor.character_name, actor.character_hue])
end
Marshal.dump(characters, file)

Marshal.dump(Graphics.frame_count, file)
$game_system.save_count += 1
$game_system.magic_number = $data_system.magic_number
Marshal.dump($game_system, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_screen, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
# EDIT ------------------------
Marshal.dump($name_minim, file)
# -----------------------------
end
end
class Scene_Load
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# EDIT ---------------------------------
$name_minim = Marshal.load(file)
# --------------------------------------
if $game_system.magic_number != $data_system.magic_number
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
$game_party.refresh
end
end
[/quote]

Des rote hast wahrscheinlich au übersehen... Ich hab ja schon gesagt das es leichter iss des in nem eigenen Zitat zu schreiben... Editier des dadrin und es funzt...





edit:
Ok...

Wäre es möglich nen weiteren Code einzufügen? ich meine damit folgendes:

Wenn man Kommentar

Zitat

mm_point
30 30 200
eingibt, erscheint en neuer NPC Punkt...


geht es wenn man z.B.

Zitat

mm_pic1
30 30 200
eingibt, z.B. die Grafik eines kleinen Totenkopfs aus dem Pictureordner kommt... So ne Art Gegneranzeige. Und wenn man die zahl ändert erscheinen verschiedene Bilder... z.B. mm_pic1, mm_pic2, mm_pic3...usw...


Bitte sag Bescheid...
There was a Cave,
below a Silent's Grave.
Tunnels, extending far, running wide,
going deep into the World on the other Side.
Poor little Child, that was to brave,
died painfully deep down, in the Devil's Cave.

20

Montag, 9. Mai 2005, 16:22

??????????? NoMehodError ???????????
undefined method `[]='for nil:NilClass

Gaanz toll.. könnte vielleicht mal einer eine Anleitung für RGSS-Noobs posten, die auch verständlich ist? Ich habe soeben mein Game gefetzt (dank dem Script) und habe keine Sicherheitskopie...

Social Bookmarks