Problem, bitte helfen
Ich habn porblem ich benutz dieses Ringmenü
und benutz von hindi das script
Nur kommt diese fehlermeldung dann:
|
|
Ruby 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 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
#------------------------------------------------------------------------------ # Ring_Menu #------------------------------------------------------------------------------ # By: XRXS, Dubealex, and Hypershadow180 # Edited by: phantasmo and Nahchito #------------------------------------------------------------------------------ class Scene_Menu #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ # → [R, G, B, alpha] ) PAUSE_TONE = [0, 0, 0, 0] def initialize(menu_index = 0) @menu_index = menu_index $location_text=[] $gold_text=[] $window_size=[] $ring_menu_text=[] $chara_select=[] @window_opacity=[] @chara_select=[] $ring_menu_text_opt = [] @window_position=[] $location_text[0]="Tahoma" # Font Type $location_text[1]=24 # Font Size $location_text[2]=0 # Location Title Color $location_text[4]=0 # Map Name Color $location_text[3]="Location:" # Text $gold_text[0]="Tahoma" # Font Type $gold_text[1]=20 # Font Size $gold_text[2]=0 # Gold Title Color $gold_text[3]=0 # Gold Color $gold_text[4]="Gold" # Text @window_opacity[0]=255 # Border Opacity @window_opacity[1]=130 # Background Opacity $window_location_skin="001-Blue01" # Location Windowskin $window_gold_skin="001-Blue01" # Gold Windowskin @window_position[0]=0 # X Axis Position @window_position[1]=0 # Location Y Axis Position @window_position[2]=384 # Gold Y Axis Position $window_size[0]=160 # Length $window_size[1]=96 # Height $ring_menu_text_opt[0]="Tahoma" # Font Type $ring_menu_text_opt[1]=0 # Font Color $ring_menu_text_opt[2]=20 # Font Size $ring_menu_text[1]="Gegenstände" $ring_menu_text[2]="Fähigkeiten" $ring_menu_text[3]="Ausrüstung" $ring_menu_text[4]="Status" $ring_menu_text[5]="Notitzbuch" $ring_menu_text[6]="Speichern" $ring_menu_text[7]="Beenden" $ring_menu_text[8] = "Fraktionen" @chara_select[0]=408 # X Axis Position @chara_select[1]=0 # Y Axis Position $chara_select[0]="Niew CroMagnon" # Font Type $chara_select[1]=0 # Font Color $chara_select[5]=24 # Font Size $chara_select[2]=255 # Border Opacity $chara_select[3]=130 # Background Opacity $chara_select[4]="001-Blue01" # Windowskin end #------------------------------------------------------------------------------ # Main #------------------------------------------------------------------------------ def main dummy_tone = $game_screen.tone.clone # ビューポートの作成 viewport1 = Viewport.new(0, 0, 640, 480) viewport1.z = 10000 viewport1.tone = Tone.new(*PAUSE_TONE) @window_gold = Window_MenuGold.new @window_gold.x = @window_position[0] @window_gold.y = @window_position[2] @window_gold.opacity = @window_opacity[0] @window_gold.back_opacity = @window_opacity[1] @spriteset = Spriteset_Map.new px = $game_player.screen_x - 15 py = $game_player.screen_y - 24 @command_window = Window_RingMenu.new(px,py) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) @command_window.disable_item(4) end @command_window.z = 100 if $game_system.save_disabled @command_window.disable_item(5) end @status_window = Window_RingMenuStatus.new @status_window.x = @chara_select[0] @status_window.y = @chara_select[1] @status_window.z = 200 @status_window.opacity=$chara_select[2] @status_window.back_opacity=$chara_select[3] @status_window.visible = false Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze viewport1.dispose @spriteset.dispose @window_gold.dispose @command_window.dispose @status_window.dispose end #------------------------------------------------------------------------------ # Update #------------------------------------------------------------------------------ def update @window_gold.update @command_window.update @status_window.update if @command_window.active update_command return end if @status_window.active update_status return end end #------------------------------------------------------------------------------ # Update Comman #------------------------------------------------------------------------------ def update_command if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return end case @command_window.index when 0 $game_system.se_play($data_system.decision_se) $scene = Scene_Item.new when 1 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 2 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 3 $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.active = true @status_window.visible = true @status_window.index = 0 when 4 $game_system.se_play($data_system.decision_se) $scene = Scene_Questlog.new when 5 if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Save.new when 6 $game_system.se_play($data_system.decision_se) $scene = Scene_End.new when 7 $game_system.se_play($data_system.decision_se) $scene = Scene_Reputation.new end return end return if @command_window.animation? if Input.press?(Input::UP) or Input.press?(Input::LEFT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL) return end if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) @command_window.setup_move_move(Window_RingMenu::MODE_MOVER) return end end #------------------------------------------------------------------------------ # Update Status #------------------------------------------------------------------------------ def update_status if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @command_window.active = true @status_window.active = false @status_window.visible = false @status_window.index = -1 return end if Input.trigger?(Input::C) case @command_window.index when 1 if $game_party.actors[@status_window.index].restriction >= 2 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Scene_Skill.new(@status_window.index) when 2 $game_system.se_play($data_system.decision_se) $scene = Scene_Equip.new(@status_window.index) when 3 $game_system.se_play($data_system.decision_se) $scene = Scene_Status.new(@status_window.index) end return end end #------------------------------------------------------------------------------ # Window_RingMenu #------------------------------------------------------------------------------ class Window_RingMenu < Window_Base STARTUP_FRAMES = 20 MOVING_FRAMES = 5 RING_R = 64 ICON_ITEM = RPG::Cache.icon("034-Item03") ICON_SKILL = RPG::Cache.icon("044-Skill01") ICON_EQUIP = RPG::Cache.icon("001-Weapon01") ICON_STATUS = RPG::Cache.icon("050-Skill07") ICON_QUESTLOG = RPG::Cache.icon("050-Skill07") ICON_SAVE = RPG::Cache.icon("038-Item07") ICON_EXIT = RPG::Cache.icon("046-Skill03") ICON_DISABLE= RPG::Cache.icon("") ICON_RUF = RPG::Cache.icon("gutböse") SE_STARTUP = "056-Right02" MODE_START = 1 MODE_WAIT = 2 MODE_MOVER = 3 MODE_MOVEL = 4 attr_accessor :index #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize( center_x, center_y ) super(0, 0, 640, 480) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = $ring_menu_text_opt[0] self.contents.font.color = text_color($ring_menu_text_opt[1]) self.contents.font.size = $ring_menu_text_opt[2] self.opacity = 0 self.back_opacity = 0 @item_max = 8 @commands = [] 1.upto(@item_max) {|n| @commands << $ring_menu_text[n]} @index = 0 @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_QUESTLOG, ICON_SAVE, ICON_EXIT, ICON_RUF] @disabled = [ false, false, false, false, false, false, false, false] @cx = center_x - 16 @cy = center_y - 16 setup_move_start refresh end #------------------------------------------------------------------------------ # Update #------------------------------------------------------------------------------ def update super refresh end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear case @mode when MODE_START refresh_start when MODE_WAIT refresh_wait when MODE_MOVER refresh_move(1) when MODE_MOVEL refresh_move(0) end rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32) self.contents.draw_text(rect, @commands[@index],1) end #------------------------------------------------------------------------------ # Refresh Start #------------------------------------------------------------------------------ def refresh_start d1 = 2.0 * Math::PI / @item_max d2 = 1.0 * Math::PI / STARTUP_FRAMES r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES for i in 0...@item_max j = i - @index d = d1 * j + d2 * @steps x = @cx + ( r * Math.sin( d ) ).to_i y = @cy - ( r * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #------------------------------------------------------------------------------ # Refresh Wait #------------------------------------------------------------------------------ def refresh_wait d = 2.0 * Math::PI / @item_max for i in 0...@item_max j = i - @index x = @cx + (RING_R * Math.sin( d * j )).to_i y = @cy - (RING_R * Math.cos( d * j )).to_i draw_item(x, y, i) end end #------------------------------------------------------------------------------ # Refresh Move #------------------------------------------------------------------------------ def refresh_move( mode ) d1 = 2.0 * Math::PI / @item_max d2 = d1 / MOVING_FRAMES d2 *= -1 if mode != 0 for i in 0...@item_max j = i - @index d = d1 * j + d2 * @steps x = @cx + ( RING_R * Math.sin( d ) ).to_i y = @cy - ( RING_R * Math.cos( d ) ).to_i draw_item(x, y, i) end @steps -= 1 if @steps < 1 @mode = MODE_WAIT end end #------------------------------------------------------------------------------ # Draw Item #------------------------------------------------------------------------------ def draw_item(x, y, i) rect = Rect.new(0, 0, @items[i].width, @items[i].height) if @index == i self.contents.blt( x, y, @items[i], rect ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect ) end else self.contents.blt( x, y, @items[i], rect, 128 ) if @disabled[@index] self.contents.blt( x, y, ICON_DISABLE, rect, 128 ) end end end #------------------------------------------------------------------------------ # Disable Item #------------------------------------------------------------------------------ def disable_item(index) @disabled[index] = true end #------------------------------------------------------------------------------ # Setup Move Start #------------------------------------------------------------------------------ def setup_move_start @mode = MODE_START @steps = STARTUP_FRAMES if SE_STARTUP != nil and SE_STARTUP != "" Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100) end end #------------------------------------------------------------------------------ # Setup Move Move #------------------------------------------------------------------------------ def setup_move_move(mode) if mode == MODE_MOVER @index -= 1 @index = @items.size - 1 if @index < 0 elsif mode == MODE_MOVEL @index += 1 @index = 0 if @index >= @items.size else return end @mode = mode @steps = MOVING_FRAMES end #------------------------------------------------------------------------------ # Animation #------------------------------------------------------------------------------ def animation? return @mode != MODE_WAIT end end #------------------------------------------------------------------------------ # Window_RingMenuStatus #------------------------------------------------------------------------------ class Window_RingMenuStatus < Window_Selectable #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize super(204, 64, 232, 352) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.size = $chara_select[5] refresh self.active = false self.index = -1 end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($chara_select[4]) self.contents.font.name = $chara_select[0] self.contents.font.color = text_color($chara_select[1]) @item_max = $game_party.actors.size for i in 0...$game_party.actors.size x = 80 y = 80 * i actor = $game_party.actors[i] draw_actor_graphic(actor, x - 60, y + 65) draw_actor_name(actor, x, y + 2) draw_actor_hp(actor, x - 40, y + 26) draw_actor_sp(actor, x - 40, y + 50) end end #------------------------------------------------------------------------------ # Update Cursor Rect #------------------------------------------------------------------------------ def update_cursor_rect if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(0, @index * 80, self.width - 32, 80) end end end #------------------------------------------------------------------------------ # Window_MenuGold #------------------------------------------------------------------------------ class Window_MenuGold < Window_Base #------------------------------------------------------------------------------ # Initialize #------------------------------------------------------------------------------ def initialize super(0, 0, $window_size[0], $window_size[1]) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $gold_text[0] self.contents.font.size = $gold_text[1] refresh end #------------------------------------------------------------------------------ # Refresh #------------------------------------------------------------------------------ def refresh self.contents.clear self.windowskin = RPG::Cache.windowskin($window_gold_skin) self.contents.font.color = text_color($gold_text[2]) self.contents.draw_text(4, 0, 120, 32, $gold_text[4]) self.contents.font.color = text_color($gold_text[3]) self.contents.draw_text(4, 32, 120, 32, $game_party.gold.to_s, 2) end end end |
zum Lesen den Text mit der Maus markieren
und benutz von hindi das script
|
|
Ruby 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 |
$rubiene = 0 if $rubiene == nil class Scene_Menu def main s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Save" s6 = "End Game" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.actors.size == 0 @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end if $game_system.save_disabled @command_window.disable_item(4) end @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 386 @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @playtime_window.dispose @steps_window.dispose @gold_window.dispose @status_window.dispose end end class Window_Steps < Window_Base def initialize super(0, 0, 160, 64) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size("Steps").width self.contents.font.color = system_color self.contents.draw_text(4, 0, 120-cx-2+50, 32, "Steps", 2) self.contents.font.color = normal_color self.contents.draw_text(0-10, 0, 22, 32, $game_party.steps.to_s, 2) end end class Window_Gold < Window_Base def initialize super(0, 0, 160, 94) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2) self.contents.font.color = system_color self.contents.draw_text(4, 30, 120-cx-2+17, 32, "Rubine: ", 2) self.contents.font.color = normal_color self.contents.draw_text(107-cx, 30, cx, 32, $rubiene.to_s, 2) end end |
zum Lesen den Text mit der Maus markieren
Nur kommt diese fehlermeldung dann:
Kann mir da jemand helfen?
Zitat
Script 'Ringmenü' line 127: NoMethodError occurred.
undefined method `update' for nil:NilClass
Ändere die entsprechende Zeile im Ringemenü (" @window_gold.update" ) in
Edit:
Diese Anpassung sorgt aber nur dafür, dass der Fehler nicht auftritt. Ein anderer Fehler mit dem Ringmenü-eigenen Gold-Window wird auftreten.
Das Problem liegt bei Hindis skript. Hindi sollte
alias_method :new_method :old_method
verwenden...
|
|
Ruby Quellcode |
1 |
@gold_window.update |
Edit:
Diese Anpassung sorgt aber nur dafür, dass der Fehler nicht auftritt. Ein anderer Fehler mit dem Ringmenü-eigenen Gold-Window wird auftreten.
Das Problem liegt bei Hindis skript. Hindi sollte
alias_method :new_method :old_method
verwenden...
Benutzerinformationen überspringen
Motto: Wer anderen eine Bratwurst brät, der hat ein Bratwurstbratgerät.
Frag am besten Hindi,er hat das Skript schließlich gemacht ;)
Ähnliche Themen
-
RGSS 1 Probleme & Talk »-
Rpg maker xp Problem
(13. November 2008, 20:02)
-
Einsteigerhilfe »-
Problem beim import von charkteren
(27. Mai 2008, 15:28)
-
Maker-Talk »-
Fragen zum Mapping...
(5. November 2006, 08:52)
-
RGSS 1 Probleme & Talk »-
Problem mit CBS und enter hero name
(20. April 2006, 08:38)

