Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Help with Scene_login

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


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
 
To explain my objective a little better, I am using The intro from Netplay + 2.0, which is Scene_Login, that imitates a "pc desktop screen". At this moment it contains 2 icons, "News" and "Login". I am making an Offline demo of my game, So i have taken out ALLOT of stuff from the script that uses networking. I don't want to skip the "fake" desktop (scene_login) and go straight to the game. I just want The icon "Login" to jump me straight to the Title screen. and by experimenting with changing "@win_login =" to "@win_login = Window_News.new" I can make it do exactly what "News" icon does.

Here is a screen of the Scene_login:

http://img179.imageshack.us/img179/4043 ... etari4.png[/img]


I apologize if that isnt any help to the matter, but like i said in my initial post, i am very new to Ruby.. first 5 days of use actually. lol

Thanks in advance.
 
Thanks Arbiter, i'll attempt that, if it doesn't work i will post all the scripts here for ya asap.

*what i have tried to do is change the outcome of "@win_login =" to "@win_login = Scene_Title.new" because that was my best guess of the login command. i may be incorrect though.. but anyway that didnt work. i get an error*
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top