- Joined
- Jul 12, 2014
- Messages
- 37
- Reaction score
- 11
- Primarily Uses
Hello.
I tried learning RGSS3 Scripting. It has only been one day since learning, so please bear with me.
I first learned how to create Windows. For my first trial, I attempted making a script that will list locations the player can teleport to.
The first problem I have come across is that I am having difficulty calling the add_map() method using an event.
The second problem is I am not sure if I am using the @Locations array properly to store map information.
Please note that this script is incomplete, and does not have the functionality to teleport or draw content in the help window yet.
I tried learning RGSS3 Scripting. It has only been one day since learning, so please bear with me.
I first learned how to create Windows. For my first trial, I attempted making a script that will list locations the player can teleport to.
The first problem I have come across is that I am having difficulty calling the add_map() method using an event.
The second problem is I am not sure if I am using the @Locations array properly to store map information.
Please note that this script is incomplete, and does not have the functionality to teleport or draw content in the help window yet.
Code:
class Window_Fly_Location < Window_Selectable def initialize super(0,0,182,416) @Locations = [] draw_content() end def add_map(name, id, x, y) @Data = [name, id, x, y] # 0 = Name # 1 = Map ID # 2 = X-Coordinate # 3 = Y-Coordinate @Locations[@Locations.size] = @Data end def draw_content() #Locations Read Loop #draw_text(x, y, text) @Locations.size.times {|i| draw_text(0, i*24, @Locations[i-1][0]) } end def item_max super @Locations ? @Locations.size() : 1 end endclass Window_Fly_Help < Window_Base def initialize super(182,0,362,416) end endclass Scene_Fly < Scene_Base def start super create_location_window() create_help_window() end def create_location_window() @Location_Window = Window_Fly_Location.new() end def create_help_window() @Help_Window = Window_Fly_Help.new() end def update super SceneManager.call(Scene_Map) if Input.trigger?(: end def terminate super @Location_Window.dispose() @Help_Window.dispose() end end
Last edited by a moderator:
