11-15-2012, 02:02 PM
I think the all RGSS code should be open source. There are some scripts that require DLL or executable to work. The custom DLL's should have included source. The scripter reading other scripts, learns how to making scripts. Why people uses DLL in RGSS scripts? The first thing is - to hide source.
Some coding standards prefered by me :
98 % of Rpg Maker users edits RGSS Default Interpreter Scripts. This is not good idea.
The better is make new * Mods script and paste in it modified segments.
For ex.
This is Window Playtime class.
You want to edit a part of this class to change the text "Play Time" at the "Real Time" and you want to make visible your computer, real hour instead of PlayTime.
In * Mods :
Copy object you want to edit and edit features in the mods class.
Using this method makes code clean :)
That's all my suggestions.
Some coding standards prefered by me :
98 % of Rpg Maker users edits RGSS Default Interpreter Scripts. This is not good idea.
The better is make new * Mods script and paste in it modified segments.
For ex.
This is Window Playtime class.
Code:
class Window_PlayTime < Window_Base
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $font.get($actual_font, 0)
self.contents.font.size = $font.get($actual_font, 1)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Play Time")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("d:d:d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
You want to edit a part of this class to change the text "Play Time" at the "Real Time" and you want to make visible your computer, real hour instead of PlayTime.
In * Mods :
Copy object you want to edit and edit features in the mods class.
Using this method makes code clean :)
Code:
class Window_PlayTime < Window_Base
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Real Time")
text = "#{Time.now.hour} : #{Time.now.min} : #{Time.now.sec}"
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
end
end
That's all my suggestions.
Skills: Android, Ruby, PHP, Linux