Hello guys, i'm new to Ruby scripting and i need some help.
I'm using a Scene_login script by Trebor777 from the Netplay 2.0 scripts.
though i am making an offline demo at the moment.
I'm using the Login GUI with 2 clickable icons "Login" and "News"
The problem im having is, since i am offline i do not want the login box window to pop up.
I want to be taken straight to the title screen once the "Login" button is clicked.
I'm not sure, but i think i need to edit the "@win_login =" part.
I have been messing around with it all day and cant come up with anything.
in the script i have posted i have added "nil" after "@win_login = ".
here is the Scene_Login script. I appreciate all the help
I'm using a Scene_login script by Trebor777 from the Netplay 2.0 scripts.
though i am making an offline demo at the moment.
I'm using the Login GUI with 2 clickable icons "Login" and "News"
The problem im having is, since i am offline i do not want the login box window to pop up.
I want to be taken straight to the title screen once the "Login" button is clicked.
I'm not sure, but i think i need to edit the "@win_login =" part.
I have been messing around with it all day and cant come up with anything.
in the script i have posted i have added "nil" after "@win_login = ".
here is the Scene_Login script. I appreciate all the help
Code:
#===============================================================================
# ** Scene_Login
# By Trebor777
#-------------------------------------------------------------------------------
#===============================================================================
class Scene_Login < Scene_Base
def initialize
# Create Mouse Object
$Mouse = Game_Mouse.new
$Mouse.visible
# Load database
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
# Data creation
$game_system = Game_System.new
$game_temp = Game_Temp.new
# Background Media
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title("login"+(rand(3)+1).to_s)
$game_system.bgm_play($data_system.battle_bgm)
# Stop playing ME and BGS
Audio.me_stop
Audio.bgs_stop
end
#--------------------------------------------------------------------------
def main_windows
# Creation of Windows
@win_login = nil
@win_news = Window_News.new
@icon_log = Icon.new(nil,"grunty",["The World"],10,20,["The World MMORPG"]){@win_login.visible = !@win_login.visible}
@icon_news = Icon.new(nil,"033-Item02",["News"],25,65,["World News"]){@win_news.visible = !@win_news.visible}
end
#--------------------------------------------------------------------------
def main_dispose
# Dispose of windows
@icon_log.dispose
@icon_news.dispose
automatic_dispose
end
#--------------------------------------------------------------------------
def update
win_update
update_control
end
#--------------------------------------------------------------------------
def win_update
@icon_log.update
@icon_news.update
@win_login.update
@win_news.update
if @win_login.update
go_to_title
end
end
#--------------------------------------------------------------------------
def update_control
if Input.triggerd?(Input::DN) or Input.triggerd?(Input::Tab)
@cursor +=1
@cursor = 0 if @cursor > 1
elsif Input.triggerd?(Input::UPs) or Input.triggerd?(Input::Tab)
@cursor -=1
@cursor = 1 if @cursor < 0
end
case @cursor
when 0
@win_login.login_box.active=true
@win_login.passw_box.active=false
@win_login.passw_box.refresh
when 1
@win_login.login_box.active=false
@win_login.login_box.refresh
@win_login.passw_box.active=true
end
end
#--------------------------------------------------------------------------
def go_to_title # Instead of Character Selection
File.new("news.rxdata", "w+").close
File.delete("news.rxdata")
$scene = Scene_Title.new
end
end