查看: 2024|回复: 6

[已经解决] 求大大帮忙,怎么把以下脚本在运行结束后加入场景移动.....

[复制链接]
梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
发表于 2013-7-6 05:17:19 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 632808263 于 2013-7-9 21:28 编辑

请问怎么把下面的xp脚本 在登陆成功后 场景移动到指定的地图,而且不是默认进入第一个设定的地图?(就是我设定了个开头动画,动画结束 开启这个脚本,  登陆成功 又回到开头动画,然后就是一直重复。。。。。。哎,!!!在第一次登陆成功后转移地图。。。求助!!!!!)(我在下面加入了场所移动的脚本,可是没反映?)谢谢!




[pre lang="ruby" line="1"]#==============================================================================
# ■ Scene_Login
#------------------------------------------------------------------------------
#  处理用户登录的类。
#==============================================================================

class Scene_Login
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    @mouse_press_register = false # 注册按钮
    @mouse_press_login = false # 登录按钮
    @focus_index = 1 #焦点
    @get_focus = false #获得焦点
    @textcursor_count = 0 # 用来控制光标闪烁
    @textcursor_index = 0 # 用来控制光标位置
    @text_index = 0 # 字符计数
    # 在文件不存在的情况下创建默认的测试帐号
    filename = "Data/Message.log"
    unless FileTest.exist?(filename)
      newuser = {"test"=>["gm","gm","gm"]}
      file = File.open(filename, "wb")
      Marshal.dump(newuser, file)
      file.close
    end
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 载入数据库
    $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")
    # 生成系统对像
    $game_system = Game_System.new
    # 生成背景图形
    @sprite_back = Sprite.new
    @sprite_back.bitmap = RPG::Cache.picture("用户登录.png")
    # 生成登录按钮
    @sprite_login = Sprite.new
    @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
    @sprite_login.x = 320
    @sprite_login.y = 300
    # 生成注册按钮
    @sprite_register = Sprite.new
    @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
    @sprite_register.x = 400
    @sprite_register.y = 300
    # 生成文本光标
    @sprite_textcursor = Sprite.new
    @sprite_textcursor.bitmap = RPG::Cache.picture("文本光标.png")
    @sprite_textcursor.x = 247
    @sprite_textcursor.y = 200
    @sprite_textcursor.opacity = 0
    @login_window = Window_Login.new
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入情报
      Mouse.update
      # 刷新画面
      update
      # 如果画面切换的话就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @sprite_back.dispose
    @sprite_back.bitmap.dispose
    @sprite_login.dispose
    @sprite_login.bitmap.dispose
    @sprite_register.dispose
    @sprite_register.bitmap.dispose
    @sprite_textcursor.dispose
    @sprite_textcursor.bitmap.dispose
    @login_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 在获得焦点的情况下监听键盘输入
    if @get_focus == true
      listen_keyboard_input
      # 按TAB键切换光标位置
      if Kboard.keyboard($R_Key_TAB)
        case @focus_index
        when 1
          @focus_index = 2
          @textcursor_index = $password.length
          @text_index = $password.length
        when 2
          @focus_index = 1
          @textcursor_index = $username.length
          @text_index = $username.length
        end
      end
    end
    if @get_focus == true # 在获得焦点的情况下刷新文本光标
      if @textcursor_count%40 < 20 # 每秒钟刷新一次
        @sprite_textcursor.opacity = 0
      else
        @sprite_textcursor.opacity = 255
      end
      # 刷新光标位置,因为背景图片的文本框没有对齐,所以设置比较麻烦
      @sprite_textcursor.x = 247 + @textcursor_index * 10 # 8为每个字符的间距
      case @focus_index
      when 1
        @sprite_textcursor.y = 200
      when 2
        @sprite_textcursor.y = 200 + 53
      end
      @textcursor_count += 1
    else
      @sprite_textcursor.opacity = 0
    end
    mouse_x,mouse_y = Mouse.get_mouse_pos
    Mouse.click_lock
    # 用户登录
    if (mouse_x > @sprite_login.x) and (mouse_y > @sprite_login.y) and
        (mouse_x < @sprite_login.x + @sprite_login.bitmap.width) and
        (mouse_y < @sprite_login.y + @sprite_login.bitmap.height)
      Mouse.click_unlock
      @sprite_login.bitmap = RPG::Cache.picture("登录2.png")
      if Mouse.press?(Mouse::LEFT)
        @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
        @mouse_press_login = true
        return
      end
      if Input.trigger?(Input::C)
        @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
        @mouse_press_login = true
        return
        end
      if @mouse_press_login
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        # 读取数据库
        filename = "Data/Message.log"
        file = File.open(filename, "r")
        user_info = Marshal.load(file)
        file.close
        if $username.length <= 0 #如果用户名为空
          p "请输入用户名"
          @mouse_press_login = false
          return
        end
        if $password.length <= 0 #如果密码为空
          p "请输入密码"
          @mouse_press_login = false
          return
        end
        if user_info.include?($username.to_s)
          if $password.to_s == user_info[$username.to_s][0]
            $scene = Scene_Title.new
          else
            p "密码错误"
          end
        else
          p "用户名不存在"
        end
        # 移动场景
        
$game_temp.player_transferring = true
$game_temp.player_new_map_id = (23)
$game_temp.player_new_x = (10)
$game_temp.player_new_y = (7)
$game_temp.player_new_direction = 0

        @mouse_press_login = false
      end
         
    else
      Mouse.click_lock
      @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
      @mouse_press_login = false
    end
       # 用户名注册
    if (mouse_x > @sprite_register.x) and (mouse_y > @sprite_register.y) and
        (mouse_x < @sprite_register.x + @sprite_register.bitmap.width) and
        (mouse_y < @sprite_register.y + @sprite_register.bitmap.height)
      Mouse.click_unlock
      @sprite_register.bitmap = RPG::Cache.picture("注册2.png")
      if Mouse.press?(Mouse::LEFT)
        @sprite_register.bitmap = RPG::Cache.picture("注册3.png")
        @mouse_press_register = true
        return
      end
      if @mouse_press_register
        # 演奏确定 SE
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Register.new
        @mouse_press_register = false
      end
    else
      Mouse.click_lock
      @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
      @mouse_press_register = false
    end
    # 用户名文本框区域
    if (mouse_x > 248 - 5) and (mouse_y > 202 - 10) and
       (mouse_x < 475 + 5) and (mouse_y < 220)
      Mouse.click_unlock
      $mouse_tag = "text"
      if Mouse.trigger?(Mouse::LEFT)
        @get_focus = true
        @focus_index = 1
        @textcursor_index = $username.length
        @text_index = $username.length
      end
      return
    else
      Mouse.click_lock
      $mouse_tag = nil
    end
    # 密码文本框区域
    if (mouse_x > 248 - 5) and (mouse_y > 255 - 10) and
       (mouse_x < 475 + 5) and (mouse_y < 272)
      Mouse.click_unlock
      $mouse_tag = "text"
      if Mouse.trigger?(Mouse::LEFT)
        @get_focus = true
        @focus_index = 2
        @textcursor_index = $password.length
        @text_index = $password.length
      end
      return
    else
      Mouse.click_lock
      $mouse_tag = nil
    end
  end
  ############################################################################
  # 监听键盘输入
  def listen_keyboard_input
    case @focus_index
    when 1
      # 字母A
      if Kboard.keyboard($R_Key_A)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "a"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母B
      if Kboard.keyboard($R_Key_B)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "b"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母C
      if Kboard.keyboard($R_Key_C)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "c"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母D
      if Kboard.keyboard($R_Key_D)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "d"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母E
      if Kboard.keyboard($R_Key_E)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "e"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母F
      if Kboard.keyboard($R_Key_F)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "f"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母G
      if Kboard.keyboard($R_Key_G)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "g"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母H
      if Kboard.keyboard($R_Key_H)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "h"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母I
      if Kboard.keyboard($R_Key_I)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "i"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母J
      if Kboard.keyboard($R_Key_J)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "j"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母K
      if Kboard.keyboard($R_Key_K)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "k"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母L
      if Kboard.keyboard($R_Key_L)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "l"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母M
      if Kboard.keyboard($R_Key_M)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "m"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母N
      if Kboard.keyboard($R_Key_N)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "n"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母O
      if Kboard.keyboard($R_Key_O)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "o"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母P
      if Kboard.keyboard($R_Key_P)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "p"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Q
      if Kboard.keyboard($R_Key_Q)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "q"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母R
      if Kboard.keyboard($R_Key_R)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "r"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母S
      if Kboard.keyboard($R_Key_S)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "s"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母T
      if Kboard.keyboard($R_Key_T)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "t"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母U
      if Kboard.keyboard($R_Key_U)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "u"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母V
      if Kboard.keyboard($R_Key_V)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "v"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母W
      if Kboard.keyboard($R_Key_W)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "w"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母X
      if Kboard.keyboard($R_Key_X)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "x"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Y
      if Kboard.keyboard($R_Key_Y)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "y"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Z
      if Kboard.keyboard($R_Key_Z)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "z"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字0
      if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "0"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字1
      if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "1"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字2
      if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "2"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字3
      if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "3"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字4
      if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "4"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字5
      if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "5"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字6
      if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "6"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字7
      if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "7"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字8
      if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "8"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字9
      if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
        if $username.length >= 15
          return
        end
        $username[@text_index] = "9"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 删除键
      if Kboard.keyboard($R_Key_BACK)
        if $username.length > 0
          $username.pop
          @textcursor_index -= 1
          @text_index -= 1
          @login_window.refresh
        end
      end
    when 2
      # 字母A
      if Kboard.keyboard($R_Key_A)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "a"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母B
      if Kboard.keyboard($R_Key_B)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "b"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母C
      if Kboard.keyboard($R_Key_C)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "c"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母D
      if Kboard.keyboard($R_Key_D)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "d"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母E
      if Kboard.keyboard($R_Key_E)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "e"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母F
      if Kboard.keyboard($R_Key_F)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "f"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母G
      if Kboard.keyboard($R_Key_G)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "g"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母H
      if Kboard.keyboard($R_Key_H)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "h"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母I
      if Kboard.keyboard($R_Key_I)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "i"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母J
      if Kboard.keyboard($R_Key_J)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "j"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母K
      if Kboard.keyboard($R_Key_K)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "k"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母L
      if Kboard.keyboard($R_Key_L)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "l"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母M
      if Kboard.keyboard($R_Key_M)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "m"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母N
      if Kboard.keyboard($R_Key_N)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "n"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母O
      if Kboard.keyboard($R_Key_O)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "o"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母P
      if Kboard.keyboard($R_Key_P)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "p"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Q
      if Kboard.keyboard($R_Key_Q)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "q"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母R
      if Kboard.keyboard($R_Key_R)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "r"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母S
      if Kboard.keyboard($R_Key_S)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "s"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母T
      if Kboard.keyboard($R_Key_T)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "t"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母U
      if Kboard.keyboard($R_Key_U)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "u"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母V
      if Kboard.keyboard($R_Key_V)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "v"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母W
      if Kboard.keyboard($R_Key_W)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "w"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母X
      if Kboard.keyboard($R_Key_X)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "x"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Y
      if Kboard.keyboard($R_Key_Y)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "y"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 字母Z
      if Kboard.keyboard($R_Key_Z)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "z"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字0
      if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "0"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字1
      if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "1"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字2
      if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "2"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字3
      if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "3"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字4
      if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "4"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字5
      if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "5"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字6
      if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "6"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字7
      if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "7"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字8
      if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "8"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 数字9
      if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
        if $password.length >= 15
          return
        end
        $password[@text_index] = "9"
        @textcursor_index += 1
        @text_index += 1
        @login_window.refresh
      end
      # 删除键
      if Kboard.keyboard($R_Key_BACK)
        if $password.length > 0
          $password.pop
          @textcursor_index -= 1
          @text_index -= 1
          @login_window.refresh
        end
      end
    end
  end
end[/pre]

游戏工程 下载地址
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
回帖
711
发表于 2013-7-6 09:14:14 来自手机 | 显示全部楼层
$game_temp.player_new_map_id = (23)把23改成你想去地图的Id

点评

这几段是我加进去的没反应,不知道加入的地方是否正确,还是加什么地方?帮帮忙,谢谢!  发表于 2013-7-7 05:23
回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-7 05:17:42 | 显示全部楼层
wwwcctvty 发表于 2013-7-6 02:14
$game_temp.player_new_map_id = (23)把23改成你想去地图的Id

改过很多遍了,什么方法都试过,还是一样脚本运行完成就重新进入开始角色设定的那张地图。
请问还有什么脚本可转移场景?
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
回帖
711
发表于 2013-7-7 08:12:16 | 显示全部楼层
632808263 发表于 2013-7-7 05:17
改过很多遍了,什么方法都试过,还是一样脚本运行完成就重新进入开始角色设定的那张地图。
请问还有什么 ...

        $game_map.setup(176)         #移动到地图
        $game_player.moveto(113, 75) #移动到坐标
        $game_player.refresh         #刷 新人物
好吧、、、你写成这样应该可以了

点评

工程上传了。  发表于 2013-7-9 07:28
咳咳。我工程很复杂, 我先整理个新的发出来把  发表于 2013-7-9 06:52
回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-8 04:46:08 | 显示全部楼层
wwwcctvty 发表于 2013-7-7 01:12
$game_map.setup(176)         #移动到地图
        $game_player.moveto(113, 75) #移动到坐标
...

还是解决不了,应该脚本里的哪句是  脚本运行结束返回标题 把,  我是脚本盲,所以找不到!哎,

点评

咳咳。我工程很复杂, 我先整理个新的发出来把。  发表于 2013-7-9 06:52
可以放上工程,可以帮你解决的、、、、  发表于 2013-7-8 12:28
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
回帖
711
发表于 2013-7-9 09:25:43 | 显示全部楼层
楼主应该多看看新手教程、、、、、
工程已经弄了下,楼主看下是不是你要的效果
Data.rar (180.7 KB, 下载次数: 52)

评分

参与人数 1星屑 +100 收起 理由
明特·布兰马修 + 100 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-10 04:27:37 | 显示全部楼层
wwwcctvty 发表于 2013-7-9 02:25
楼主应该多看看新手教程、、、、、
工程已经弄了下,楼主看下是不是你要的效果
...

万分感谢,,,,原来要放那边啊。。。看来真的要去看教程学习下了。

点评

想做个可外连和单机并存。。。。  发表于 2013-7-13 04:43
原来没奖励呀、、、、、、、、、、、、、  发表于 2013-7-10 13:56
你准备做成联网的游戏吗?  发表于 2013-7-10 10:17
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部