RolandMelvinZ Novice
Posts : 294 Thanked : 3 Engine : RMXP Skill : Beginner Type : Composer
| Subyek: [SOLVED] scripter help me! (masuk dulu, liat dulu) 2012-04-06, 18:26 | |
| Nah jadi begini... saya sedang belajar scripting dengan mengikuti tuts nya dubealex.. dan saya sampai d lesson untuk membuat menu sederhana.. saya baca dan ikuti tutorial yang ada.. akhirnya setelah selesai menulis script sesuai panduan, saya mau melihat hasil akhir.. pencet F12 masih bisa.. tp begitu jalan ke event yang ud d kasi perintah call script "$Scene=Scene_Chapter_2.new" malah error :hammer:tulisannya "Script 'Windows_1' line 17: NameError occured. uninitialized constant Window_1::Graphic" Ada yang taw apa yang salah :hammer:berikut script yang aku pke. Window_1 - Code:
-
class Window_1 < Window_Base def initialize super(0, 0, 640, 100) self.contents = Bitmap.new(width-32,height-32) self.contents.font.name= "Arial" self.contents.font.size= 24 refresh end
def refresh self.contents.clear self.contents.font.color = text_color(6) self.contents.draw_text(0, 0, 100, 32, "PLAYTIME:") #=============================================================================== #code to show PLAYTIME #=============================================================================== @total_sec = Graphics.frame_count / Graphic.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec)
#=============================================================================== #end of code to show PLAYTIME #===============================================================================
self.contents.font.color = text_color(6) self.contents.draw_text(250, 0, 120, 32, "Gold:") self.contents.font.color = text_color(0) self.contents.draw_text(305, 0, 120, 32, $game_party.gold.to_s) self.contents.font.color = text_color(6) self.contents.draw_text(400, 0, 120, 32, "Map:") self.contents.font.color = text_color(0) self.contents.draw_text(480, 0, 120, 32, $game_map.mapid.to_s) end def update if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end WIndow_2 - Code:
-
class Window_2 < Window_Base #BLOCK 1 def initialize super(0, 0, 200,380) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.font.size = 24
#BLOCK 2 for i in 0...$game_party.actors.size x = 0 y = i * 90 actor = $game_party.actors self.contents.font.color = text_color(6) self.contents.draw_text(x, y, 200, 32, $game_party.actors.name) self.contents.font.color = text_color(4) self.contents.draw_text(x, y+32, 200, 32, actor.class_name) end end end Window_3 - Code:
-
class Window_3 < Window_Base #BLOCK 1 def initialize super(0, 0, 440,380) self.contents = Bitmap.new(width-32, height-32) self.contents.font.name = "Arial" self.contents.font.size = 24 #BLOCK 2 for i in 0...$game_party.actors.size x = 0 y = i * 150 if i >= 2 x=250 y -= 300 end
actor = $game_party.actors self.contents.font.color = text_color(6) self.contents.draw_text(x, y, 200, 32, actor.name) offset_x=contents.text_size(actor.name).width+10 self.contents.font.color = text_color(4) self.contents.draw_text(x+offset_x, y, 200, 32, "Lv: " + actor.level.to_s) draw_actor_hp(actor, x, y+32) draw_actor_sp(actor, x, y+64) draw_actor_exp(actor, x, y+96) end end end Scene_Chapter_2 - Code:
-
class Scene_Chapter_2 #BLOCK 1 def main @window_1=Window_1.new @window_2=Window_2.new @window_2.y=100 @window_3=Window_3.new @window_3.x=200 @window_3.y=100 #BLOCK 2 Graphics.transition loop do Graphics.update Input.update update if $scene != self break end
end
#BLOCK 3 Graphics.freeze @window_1.dispose @window_2.dispose @window_3.dispose end #BLOCK 4 def update @window_1.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new end
end end | |
|
wltr3565 Senior
Posts : 870 Thanked : 28 Engine : RMVX Skill : Skilled Type : Scripter
Trophies
Awards:
| Subyek: Re: [SOLVED] scripter help me! (masuk dulu, liat dulu) 2012-04-06, 19:05 | |
| Graphic... Mana ada Graphic? Adanya Graphics. | |
|
RolandMelvinZ Novice
Posts : 294 Thanked : 3 Engine : RMXP Skill : Beginner Type : Composer
| Subyek: Re: [SOLVED] scripter help me! (masuk dulu, liat dulu) 2012-04-06, 19:12 | |
| oh salah tulis *jedueng ok makasi close this trid plis Edited by Theo: DAFUQ jawabannya faceplam banget *Locked* | |
|
Sponsored content
| Subyek: Re: [SOLVED] scripter help me! (masuk dulu, liat dulu) | |
| |
|