设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1412|回复: 5

[已经过期] 求大大帮忙,脚本 在登陆成功后 场景移动到指定的地图,...

[复制链接]

Lv1.梦旅人

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
帖子
213
发表于 2013-7-3 05:59:24 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 632808263 于 2013-7-4 22:15 编辑

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




RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_Login
  3. #------------------------------------------------------------------------------
  4. #  处理用户登录的类。
  5. #==============================================================================
  6.  
  7. class Scene_Login
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     @mouse_press_register = false # 注册按钮
  13.     @mouse_press_login = false # 登录按钮
  14.     @focus_index = 1 #焦点
  15.     @get_focus = false #获得焦点
  16.     @textcursor_count = 0 # 用来控制光标闪烁
  17.     @textcursor_index = 0 # 用来控制光标位置
  18.     @text_index = 0 # 字符计数
  19.     # 在文件不存在的情况下创建默认的测试帐号
  20.     filename = "Data/Message.log"
  21.     unless FileTest.exist?(filename)
  22.       newuser = {"test"=>["gm","gm","gm"]}
  23.       file = File.open(filename, "wb")
  24.       Marshal.dump(newuser, file)
  25.       file.close
  26.     end
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 主处理
  30.   #--------------------------------------------------------------------------
  31.   def main
  32.     # 载入数据库
  33.     $data_actors        = load_data("Data/Actors.rxdata")
  34.     $data_classes       = load_data("Data/Classes.rxdata")
  35.     $data_skills        = load_data("Data/Skills.rxdata")
  36.     $data_items         = load_data("Data/Items.rxdata")
  37.     $data_weapons       = load_data("Data/Weapons.rxdata")
  38.     $data_armors        = load_data("Data/Armors.rxdata")
  39.     $data_enemies       = load_data("Data/Enemies.rxdata")
  40.     $data_troops        = load_data("Data/Troops.rxdata")
  41.     $data_states        = load_data("Data/States.rxdata")
  42.     $data_animations    = load_data("Data/Animations.rxdata")
  43.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  44.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  45.     $data_system        = load_data("Data/System.rxdata")
  46.     # 生成系统对像
  47.     $game_system = Game_System.new
  48.     # 生成背景图形
  49.     @sprite_back = Sprite.new
  50.     @sprite_back.bitmap = RPG::Cache.picture("用户登录.png")
  51.     # 生成登录按钮
  52.     @sprite_login = Sprite.new
  53.     @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
  54.     @sprite_login.x = 320
  55.     @sprite_login.y = 300
  56.     # 生成注册按钮
  57.     @sprite_register = Sprite.new
  58.     @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
  59.     @sprite_register.x = 400
  60.     @sprite_register.y = 300
  61.     # 生成文本光标
  62.     @sprite_textcursor = Sprite.new
  63.     @sprite_textcursor.bitmap = RPG::Cache.picture("文本光标.png")
  64.     @sprite_textcursor.x = 247
  65.     @sprite_textcursor.y = 200
  66.     @sprite_textcursor.opacity = 0
  67.     @login_window = Window_Login.new
  68.     # 执行过渡
  69.     Graphics.transition
  70.     # 主循环
  71.     loop do
  72.       # 刷新游戏画面
  73.       Graphics.update
  74.       # 刷新输入情报
  75.       Mouse.update
  76.       # 刷新画面
  77.       update
  78.       # 如果画面切换的话就中断循环
  79.       if $scene != self
  80.         break
  81.       end
  82.     end
  83.     # 准备过渡
  84.     Graphics.freeze
  85.     # 释放窗口
  86.     @sprite_back.dispose
  87.     @sprite_back.bitmap.dispose
  88.     @sprite_login.dispose
  89.     @sprite_login.bitmap.dispose
  90.     @sprite_register.dispose
  91.     @sprite_register.bitmap.dispose
  92.     @sprite_textcursor.dispose
  93.     @sprite_textcursor.bitmap.dispose
  94.     @login_window.dispose
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 刷新画面
  98.   #--------------------------------------------------------------------------
  99.   def update
  100.     # 在获得焦点的情况下监听键盘输入
  101.     if @get_focus == true
  102.       listen_keyboard_input
  103.       # 按TAB键切换光标位置
  104.       if Kboard.keyboard($R_Key_TAB)
  105.         case @focus_index
  106.         when 1
  107.           @focus_index = 2
  108.           @textcursor_index = $password.length
  109.           @text_index = $password.length
  110.         when 2
  111.           @focus_index = 1
  112.           @textcursor_index = $username.length
  113.           @text_index = $username.length
  114.         end
  115.       end
  116.     end
  117.     if @get_focus == true # 在获得焦点的情况下刷新文本光标
  118.       if @textcursor_count%40 < 20 # 每秒钟刷新一次
  119.         @sprite_textcursor.opacity = 0
  120.       else
  121.         @sprite_textcursor.opacity = 255
  122.       end
  123.       # 刷新光标位置,因为背景图片的文本框没有对齐,所以设置比较麻烦
  124.       @sprite_textcursor.x = 247 + @textcursor_index * 10 # 8为每个字符的间距
  125.       case @focus_index
  126.       when 1
  127.         @sprite_textcursor.y = 200
  128.       when 2
  129.         @sprite_textcursor.y = 200 + 53
  130.       end
  131.       @textcursor_count += 1
  132.     else
  133.       @sprite_textcursor.opacity = 0
  134.     end
  135.     mouse_x,mouse_y = Mouse.get_mouse_pos
  136.     Mouse.click_lock
  137.     # 用户登录
  138.     if (mouse_x > @sprite_login.x) and (mouse_y > @sprite_login.y) and
  139.         (mouse_x < @sprite_login.x + @sprite_login.bitmap.width) and
  140.         (mouse_y < @sprite_login.y + @sprite_login.bitmap.height)
  141.       Mouse.click_unlock
  142.       @sprite_login.bitmap = RPG::Cache.picture("登录2.png")
  143.       if Mouse.press?(Mouse::LEFT)
  144.         @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
  145.         @mouse_press_login = true
  146.         return
  147.       end
  148.       if Input.trigger?(Input::C)
  149.         @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
  150.         @mouse_press_login = true
  151.         return
  152.         end
  153.       if @mouse_press_login
  154.         # 演奏确定 SE
  155.         $game_system.se_play($data_system.decision_se)
  156.         # 读取数据库
  157.         filename = "Data/Message.log"
  158.         file = File.open(filename, "r")
  159.         user_info = Marshal.load(file)
  160.         file.close
  161.         if $username.length <= 0 #如果用户名为空
  162.           p "请输入用户名"
  163.           @mouse_press_login = false
  164.           return
  165.         end
  166.         if $password.length <= 0 #如果密码为空
  167.           p "请输入密码"
  168.           @mouse_press_login = false
  169.           return
  170.         end
  171.         if user_info.include?($username.to_s)
  172.           if $password.to_s == user_info[$username.to_s][0]
  173.             $scene = Scene_Title.new
  174.           else
  175.             p "密码错误"
  176.           end
  177.         else
  178.           p "用户名不存在"
  179.         end
  180.         # 移动场景
  181.  
  182. $game_temp.player_transferring = true
  183. $game_temp.player_new_map_id = (23)
  184. $game_temp.player_new_x = (10)
  185. $game_temp.player_new_y = (7)
  186. $game_temp.player_new_direction = 0
  187.  
  188.         @mouse_press_login = false
  189.       end
  190.  
  191.     else
  192.       Mouse.click_lock
  193.       @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
  194.       @mouse_press_login = false
  195.     end
  196.        # 用户名注册
  197.     if (mouse_x > @sprite_register.x) and (mouse_y > @sprite_register.y) and
  198.         (mouse_x < @sprite_register.x + @sprite_register.bitmap.width) and
  199.         (mouse_y < @sprite_register.y + @sprite_register.bitmap.height)
  200.       Mouse.click_unlock
  201.       @sprite_register.bitmap = RPG::Cache.picture("注册2.png")
  202.       if Mouse.press?(Mouse::LEFT)
  203.         @sprite_register.bitmap = RPG::Cache.picture("注册3.png")
  204.         @mouse_press_register = true
  205.         return
  206.       end
  207.       if @mouse_press_register
  208.         # 演奏确定 SE
  209.         $game_system.se_play($data_system.decision_se)
  210.         $scene = Scene_Register.new
  211.         @mouse_press_register = false
  212.       end
  213.     else
  214.       Mouse.click_lock
  215.       @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
  216.       @mouse_press_register = false
  217.     end
  218.     # 用户名文本框区域
  219.     if (mouse_x > 248 - 5) and (mouse_y > 202 - 10) and
  220.        (mouse_x < 475 + 5) and (mouse_y < 220)
  221.       Mouse.click_unlock
  222.       $mouse_tag = "text"
  223.       if Mouse.trigger?(Mouse::LEFT)
  224.         @get_focus = true
  225.         @focus_index = 1
  226.         @textcursor_index = $username.length
  227.         @text_index = $username.length
  228.       end
  229.       return
  230.     else
  231.       Mouse.click_lock
  232.       $mouse_tag = nil
  233.     end
  234.     # 密码文本框区域
  235.     if (mouse_x > 248 - 5) and (mouse_y > 255 - 10) and
  236.        (mouse_x < 475 + 5) and (mouse_y < 272)
  237.       Mouse.click_unlock
  238.       $mouse_tag = "text"
  239.       if Mouse.trigger?(Mouse::LEFT)
  240.         @get_focus = true
  241.         @focus_index = 2
  242.         @textcursor_index = $password.length
  243.         @text_index = $password.length
  244.       end
  245.       return
  246.     else
  247.       Mouse.click_lock
  248.       $mouse_tag = nil
  249.     end
  250.   end
  251.   ############################################################################
  252.   # 监听键盘输入
  253.   def listen_keyboard_input
  254.     case @focus_index
  255.     when 1
  256.       # 字母A
  257.       if Kboard.keyboard($R_Key_A)
  258.         if $username.length >= 15
  259.           return
  260.         end
  261.         $username[@text_index] = "a"
  262.         @textcursor_index += 1
  263.         @text_index += 1
  264.         @login_window.refresh
  265.       end
  266.       # 字母B
  267.       if Kboard.keyboard($R_Key_B)
  268.         if $username.length >= 15
  269.           return
  270.         end
  271.         $username[@text_index] = "b"
  272.         @textcursor_index += 1
  273.         @text_index += 1
  274.         @login_window.refresh
  275.       end
  276.       # 字母C
  277.       if Kboard.keyboard($R_Key_C)
  278.         if $username.length >= 15
  279.           return
  280.         end
  281.         $username[@text_index] = "c"
  282.         @textcursor_index += 1
  283.         @text_index += 1
  284.         @login_window.refresh
  285.       end
  286.       # 字母D
  287.       if Kboard.keyboard($R_Key_D)
  288.         if $username.length >= 15
  289.           return
  290.         end
  291.         $username[@text_index] = "d"
  292.         @textcursor_index += 1
  293.         @text_index += 1
  294.         @login_window.refresh
  295.       end
  296.       # 字母E
  297.       if Kboard.keyboard($R_Key_E)
  298.         if $username.length >= 15
  299.           return
  300.         end
  301.         $username[@text_index] = "e"
  302.         @textcursor_index += 1
  303.         @text_index += 1
  304.         @login_window.refresh
  305.       end
  306.       # 字母F
  307.       if Kboard.keyboard($R_Key_F)
  308.         if $username.length >= 15
  309.           return
  310.         end
  311.         $username[@text_index] = "f"
  312.         @textcursor_index += 1
  313.         @text_index += 1
  314.         @login_window.refresh
  315.       end
  316.       # 字母G
  317.       if Kboard.keyboard($R_Key_G)
  318.         if $username.length >= 15
  319.           return
  320.         end
  321.         $username[@text_index] = "g"
  322.         @textcursor_index += 1
  323.         @text_index += 1
  324.         @login_window.refresh
  325.       end
  326.       # 字母H
  327.       if Kboard.keyboard($R_Key_H)
  328.         if $username.length >= 15
  329.           return
  330.         end
  331.         $username[@text_index] = "h"
  332.         @textcursor_index += 1
  333.         @text_index += 1
  334.         @login_window.refresh
  335.       end
  336.       # 字母I
  337.       if Kboard.keyboard($R_Key_I)
  338.         if $username.length >= 15
  339.           return
  340.         end
  341.         $username[@text_index] = "i"
  342.         @textcursor_index += 1
  343.         @text_index += 1
  344.         @login_window.refresh
  345.       end
  346.       # 字母J
  347.       if Kboard.keyboard($R_Key_J)
  348.         if $username.length >= 15
  349.           return
  350.         end
  351.         $username[@text_index] = "j"
  352.         @textcursor_index += 1
  353.         @text_index += 1
  354.         @login_window.refresh
  355.       end
  356.       # 字母K
  357.       if Kboard.keyboard($R_Key_K)
  358.         if $username.length >= 15
  359.           return
  360.         end
  361.         $username[@text_index] = "k"
  362.         @textcursor_index += 1
  363.         @text_index += 1
  364.         @login_window.refresh
  365.       end
  366.       # 字母L
  367.       if Kboard.keyboard($R_Key_L)
  368.         if $username.length >= 15
  369.           return
  370.         end
  371.         $username[@text_index] = "l"
  372.         @textcursor_index += 1
  373.         @text_index += 1
  374.         @login_window.refresh
  375.       end
  376.       # 字母M
  377.       if Kboard.keyboard($R_Key_M)
  378.         if $username.length >= 15
  379.           return
  380.         end
  381.         $username[@text_index] = "m"
  382.         @textcursor_index += 1
  383.         @text_index += 1
  384.         @login_window.refresh
  385.       end
  386.       # 字母N
  387.       if Kboard.keyboard($R_Key_N)
  388.         if $username.length >= 15
  389.           return
  390.         end
  391.         $username[@text_index] = "n"
  392.         @textcursor_index += 1
  393.         @text_index += 1
  394.         @login_window.refresh
  395.       end
  396.       # 字母O
  397.       if Kboard.keyboard($R_Key_O)
  398.         if $username.length >= 15
  399.           return
  400.         end
  401.         $username[@text_index] = "o"
  402.         @textcursor_index += 1
  403.         @text_index += 1
  404.         @login_window.refresh
  405.       end
  406.       # 字母P
  407.       if Kboard.keyboard($R_Key_P)
  408.         if $username.length >= 15
  409.           return
  410.         end
  411.         $username[@text_index] = "p"
  412.         @textcursor_index += 1
  413.         @text_index += 1
  414.         @login_window.refresh
  415.       end
  416.       # 字母Q
  417.       if Kboard.keyboard($R_Key_Q)
  418.         if $username.length >= 15
  419.           return
  420.         end
  421.         $username[@text_index] = "q"
  422.         @textcursor_index += 1
  423.         @text_index += 1
  424.         @login_window.refresh
  425.       end
  426.       # 字母R
  427.       if Kboard.keyboard($R_Key_R)
  428.         if $username.length >= 15
  429.           return
  430.         end
  431.         $username[@text_index] = "r"
  432.         @textcursor_index += 1
  433.         @text_index += 1
  434.         @login_window.refresh
  435.       end
  436.       # 字母S
  437.       if Kboard.keyboard($R_Key_S)
  438.         if $username.length >= 15
  439.           return
  440.         end
  441.         $username[@text_index] = "s"
  442.         @textcursor_index += 1
  443.         @text_index += 1
  444.         @login_window.refresh
  445.       end
  446.       # 字母T
  447.       if Kboard.keyboard($R_Key_T)
  448.         if $username.length >= 15
  449.           return
  450.         end
  451.         $username[@text_index] = "t"
  452.         @textcursor_index += 1
  453.         @text_index += 1
  454.         @login_window.refresh
  455.       end
  456.       # 字母U
  457.       if Kboard.keyboard($R_Key_U)
  458.         if $username.length >= 15
  459.           return
  460.         end
  461.         $username[@text_index] = "u"
  462.         @textcursor_index += 1
  463.         @text_index += 1
  464.         @login_window.refresh
  465.       end
  466.       # 字母V
  467.       if Kboard.keyboard($R_Key_V)
  468.         if $username.length >= 15
  469.           return
  470.         end
  471.         $username[@text_index] = "v"
  472.         @textcursor_index += 1
  473.         @text_index += 1
  474.         @login_window.refresh
  475.       end
  476.       # 字母W
  477.       if Kboard.keyboard($R_Key_W)
  478.         if $username.length >= 15
  479.           return
  480.         end
  481.         $username[@text_index] = "w"
  482.         @textcursor_index += 1
  483.         @text_index += 1
  484.         @login_window.refresh
  485.       end
  486.       # 字母X
  487.       if Kboard.keyboard($R_Key_X)
  488.         if $username.length >= 15
  489.           return
  490.         end
  491.         $username[@text_index] = "x"
  492.         @textcursor_index += 1
  493.         @text_index += 1
  494.         @login_window.refresh
  495.       end
  496.       # 字母Y
  497.       if Kboard.keyboard($R_Key_Y)
  498.         if $username.length >= 15
  499.           return
  500.         end
  501.         $username[@text_index] = "y"
  502.         @textcursor_index += 1
  503.         @text_index += 1
  504.         @login_window.refresh
  505.       end
  506.       # 字母Z
  507.       if Kboard.keyboard($R_Key_Z)
  508.         if $username.length >= 15
  509.           return
  510.         end
  511.         $username[@text_index] = "z"
  512.         @textcursor_index += 1
  513.         @text_index += 1
  514.         @login_window.refresh
  515.       end
  516.       # 数字0
  517.       if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
  518.         if $username.length >= 15
  519.           return
  520.         end
  521.         $username[@text_index] = "0"
  522.         @textcursor_index += 1
  523.         @text_index += 1
  524.         @login_window.refresh
  525.       end
  526.       # 数字1
  527.       if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
  528.         if $username.length >= 15
  529.           return
  530.         end
  531.         $username[@text_index] = "1"
  532.         @textcursor_index += 1
  533.         @text_index += 1
  534.         @login_window.refresh
  535.       end
  536.       # 数字2
  537.       if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
  538.         if $username.length >= 15
  539.           return
  540.         end
  541.         $username[@text_index] = "2"
  542.         @textcursor_index += 1
  543.         @text_index += 1
  544.         @login_window.refresh
  545.       end
  546.       # 数字3
  547.       if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
  548.         if $username.length >= 15
  549.           return
  550.         end
  551.         $username[@text_index] = "3"
  552.         @textcursor_index += 1
  553.         @text_index += 1
  554.         @login_window.refresh
  555.       end
  556.       # 数字4
  557.       if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
  558.         if $username.length >= 15
  559.           return
  560.         end
  561.         $username[@text_index] = "4"
  562.         @textcursor_index += 1
  563.         @text_index += 1
  564.         @login_window.refresh
  565.       end
  566.       # 数字5
  567.       if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
  568.         if $username.length >= 15
  569.           return
  570.         end
  571.         $username[@text_index] = "5"
  572.         @textcursor_index += 1
  573.         @text_index += 1
  574.         @login_window.refresh
  575.       end
  576.       # 数字6
  577.       if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
  578.         if $username.length >= 15
  579.           return
  580.         end
  581.         $username[@text_index] = "6"
  582.         @textcursor_index += 1
  583.         @text_index += 1
  584.         @login_window.refresh
  585.       end
  586.       # 数字7
  587.       if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
  588.         if $username.length >= 15
  589.           return
  590.         end
  591.         $username[@text_index] = "7"
  592.         @textcursor_index += 1
  593.         @text_index += 1
  594.         @login_window.refresh
  595.       end
  596.       # 数字8
  597.       if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
  598.         if $username.length >= 15
  599.           return
  600.         end
  601.         $username[@text_index] = "8"
  602.         @textcursor_index += 1
  603.         @text_index += 1
  604.         @login_window.refresh
  605.       end
  606.       # 数字9
  607.       if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
  608.         if $username.length >= 15
  609.           return
  610.         end
  611.         $username[@text_index] = "9"
  612.         @textcursor_index += 1
  613.         @text_index += 1
  614.         @login_window.refresh
  615.       end
  616.       # 删除键
  617.       if Kboard.keyboard($R_Key_BACK)
  618.         if $username.length > 0
  619.           $username.pop
  620.           @textcursor_index -= 1
  621.           @text_index -= 1
  622.           @login_window.refresh
  623.         end
  624.       end
  625.     when 2
  626.       # 字母A
  627.       if Kboard.keyboard($R_Key_A)
  628.         if $password.length >= 15
  629.           return
  630.         end
  631.         $password[@text_index] = "a"
  632.         @textcursor_index += 1
  633.         @text_index += 1
  634.         @login_window.refresh
  635.       end
  636.       # 字母B
  637.       if Kboard.keyboard($R_Key_B)
  638.         if $password.length >= 15
  639.           return
  640.         end
  641.         $password[@text_index] = "b"
  642.         @textcursor_index += 1
  643.         @text_index += 1
  644.         @login_window.refresh
  645.       end
  646.       # 字母C
  647.       if Kboard.keyboard($R_Key_C)
  648.         if $password.length >= 15
  649.           return
  650.         end
  651.         $password[@text_index] = "c"
  652.         @textcursor_index += 1
  653.         @text_index += 1
  654.         @login_window.refresh
  655.       end
  656.       # 字母D
  657.       if Kboard.keyboard($R_Key_D)
  658.         if $password.length >= 15
  659.           return
  660.         end
  661.         $password[@text_index] = "d"
  662.         @textcursor_index += 1
  663.         @text_index += 1
  664.         @login_window.refresh
  665.       end
  666.       # 字母E
  667.       if Kboard.keyboard($R_Key_E)
  668.         if $password.length >= 15
  669.           return
  670.         end
  671.         $password[@text_index] = "e"
  672.         @textcursor_index += 1
  673.         @text_index += 1
  674.         @login_window.refresh
  675.       end
  676.       # 字母F
  677.       if Kboard.keyboard($R_Key_F)
  678.         if $password.length >= 15
  679.           return
  680.         end
  681.         $password[@text_index] = "f"
  682.         @textcursor_index += 1
  683.         @text_index += 1
  684.         @login_window.refresh
  685.       end
  686.       # 字母G
  687.       if Kboard.keyboard($R_Key_G)
  688.         if $password.length >= 15
  689.           return
  690.         end
  691.         $password[@text_index] = "g"
  692.         @textcursor_index += 1
  693.         @text_index += 1
  694.         @login_window.refresh
  695.       end
  696.       # 字母H
  697.       if Kboard.keyboard($R_Key_H)
  698.         if $password.length >= 15
  699.           return
  700.         end
  701.         $password[@text_index] = "h"
  702.         @textcursor_index += 1
  703.         @text_index += 1
  704.         @login_window.refresh
  705.       end
  706.       # 字母I
  707.       if Kboard.keyboard($R_Key_I)
  708.         if $password.length >= 15
  709.           return
  710.         end
  711.         $password[@text_index] = "i"
  712.         @textcursor_index += 1
  713.         @text_index += 1
  714.         @login_window.refresh
  715.       end
  716.       # 字母J
  717.       if Kboard.keyboard($R_Key_J)
  718.         if $password.length >= 15
  719.           return
  720.         end
  721.         $password[@text_index] = "j"
  722.         @textcursor_index += 1
  723.         @text_index += 1
  724.         @login_window.refresh
  725.       end
  726.       # 字母K
  727.       if Kboard.keyboard($R_Key_K)
  728.         if $password.length >= 15
  729.           return
  730.         end
  731.         $password[@text_index] = "k"
  732.         @textcursor_index += 1
  733.         @text_index += 1
  734.         @login_window.refresh
  735.       end
  736.       # 字母L
  737.       if Kboard.keyboard($R_Key_L)
  738.         if $password.length >= 15
  739.           return
  740.         end
  741.         $password[@text_index] = "l"
  742.         @textcursor_index += 1
  743.         @text_index += 1
  744.         @login_window.refresh
  745.       end
  746.       # 字母M
  747.       if Kboard.keyboard($R_Key_M)
  748.         if $password.length >= 15
  749.           return
  750.         end
  751.         $password[@text_index] = "m"
  752.         @textcursor_index += 1
  753.         @text_index += 1
  754.         @login_window.refresh
  755.       end
  756.       # 字母N
  757.       if Kboard.keyboard($R_Key_N)
  758.         if $password.length >= 15
  759.           return
  760.         end
  761.         $password[@text_index] = "n"
  762.         @textcursor_index += 1
  763.         @text_index += 1
  764.         @login_window.refresh
  765.       end
  766.       # 字母O
  767.       if Kboard.keyboard($R_Key_O)
  768.         if $password.length >= 15
  769.           return
  770.         end
  771.         $password[@text_index] = "o"
  772.         @textcursor_index += 1
  773.         @text_index += 1
  774.         @login_window.refresh
  775.       end
  776.       # 字母P
  777.       if Kboard.keyboard($R_Key_P)
  778.         if $password.length >= 15
  779.           return
  780.         end
  781.         $password[@text_index] = "p"
  782.         @textcursor_index += 1
  783.         @text_index += 1
  784.         @login_window.refresh
  785.       end
  786.       # 字母Q
  787.       if Kboard.keyboard($R_Key_Q)
  788.         if $password.length >= 15
  789.           return
  790.         end
  791.         $password[@text_index] = "q"
  792.         @textcursor_index += 1
  793.         @text_index += 1
  794.         @login_window.refresh
  795.       end
  796.       # 字母R
  797.       if Kboard.keyboard($R_Key_R)
  798.         if $password.length >= 15
  799.           return
  800.         end
  801.         $password[@text_index] = "r"
  802.         @textcursor_index += 1
  803.         @text_index += 1
  804.         @login_window.refresh
  805.       end
  806.       # 字母S
  807.       if Kboard.keyboard($R_Key_S)
  808.         if $password.length >= 15
  809.           return
  810.         end
  811.         $password[@text_index] = "s"
  812.         @textcursor_index += 1
  813.         @text_index += 1
  814.         @login_window.refresh
  815.       end
  816.       # 字母T
  817.       if Kboard.keyboard($R_Key_T)
  818.         if $password.length >= 15
  819.           return
  820.         end
  821.         $password[@text_index] = "t"
  822.         @textcursor_index += 1
  823.         @text_index += 1
  824.         @login_window.refresh
  825.       end
  826.       # 字母U
  827.       if Kboard.keyboard($R_Key_U)
  828.         if $password.length >= 15
  829.           return
  830.         end
  831.         $password[@text_index] = "u"
  832.         @textcursor_index += 1
  833.         @text_index += 1
  834.         @login_window.refresh
  835.       end
  836.       # 字母V
  837.       if Kboard.keyboard($R_Key_V)
  838.         if $password.length >= 15
  839.           return
  840.         end
  841.         $password[@text_index] = "v"
  842.         @textcursor_index += 1
  843.         @text_index += 1
  844.         @login_window.refresh
  845.       end
  846.       # 字母W
  847.       if Kboard.keyboard($R_Key_W)
  848.         if $password.length >= 15
  849.           return
  850.         end
  851.         $password[@text_index] = "w"
  852.         @textcursor_index += 1
  853.         @text_index += 1
  854.         @login_window.refresh
  855.       end
  856.       # 字母X
  857.       if Kboard.keyboard($R_Key_X)
  858.         if $password.length >= 15
  859.           return
  860.         end
  861.         $password[@text_index] = "x"
  862.         @textcursor_index += 1
  863.         @text_index += 1
  864.         @login_window.refresh
  865.       end
  866.       # 字母Y
  867.       if Kboard.keyboard($R_Key_Y)
  868.         if $password.length >= 15
  869.           return
  870.         end
  871.         $password[@text_index] = "y"
  872.         @textcursor_index += 1
  873.         @text_index += 1
  874.         @login_window.refresh
  875.       end
  876.       # 字母Z
  877.       if Kboard.keyboard($R_Key_Z)
  878.         if $password.length >= 15
  879.           return
  880.         end
  881.         $password[@text_index] = "z"
  882.         @textcursor_index += 1
  883.         @text_index += 1
  884.         @login_window.refresh
  885.       end
  886.       # 数字0
  887.       if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
  888.         if $password.length >= 15
  889.           return
  890.         end
  891.         $password[@text_index] = "0"
  892.         @textcursor_index += 1
  893.         @text_index += 1
  894.         @login_window.refresh
  895.       end
  896.       # 数字1
  897.       if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
  898.         if $password.length >= 15
  899.           return
  900.         end
  901.         $password[@text_index] = "1"
  902.         @textcursor_index += 1
  903.         @text_index += 1
  904.         @login_window.refresh
  905.       end
  906.       # 数字2
  907.       if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
  908.         if $password.length >= 15
  909.           return
  910.         end
  911.         $password[@text_index] = "2"
  912.         @textcursor_index += 1
  913.         @text_index += 1
  914.         @login_window.refresh
  915.       end
  916.       # 数字3
  917.       if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
  918.         if $password.length >= 15
  919.           return
  920.         end
  921.         $password[@text_index] = "3"
  922.         @textcursor_index += 1
  923.         @text_index += 1
  924.         @login_window.refresh
  925.       end
  926.       # 数字4
  927.       if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
  928.         if $password.length >= 15
  929.           return
  930.         end
  931.         $password[@text_index] = "4"
  932.         @textcursor_index += 1
  933.         @text_index += 1
  934.         @login_window.refresh
  935.       end
  936.       # 数字5
  937.       if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
  938.         if $password.length >= 15
  939.           return
  940.         end
  941.         $password[@text_index] = "5"
  942.         @textcursor_index += 1
  943.         @text_index += 1
  944.         @login_window.refresh
  945.       end
  946.       # 数字6
  947.       if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
  948.         if $password.length >= 15
  949.           return
  950.         end
  951.         $password[@text_index] = "6"
  952.         @textcursor_index += 1
  953.         @text_index += 1
  954.         @login_window.refresh
  955.       end
  956.       # 数字7
  957.       if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
  958.         if $password.length >= 15
  959.           return
  960.         end
  961.         $password[@text_index] = "7"
  962.         @textcursor_index += 1
  963.         @text_index += 1
  964.         @login_window.refresh
  965.       end
  966.       # 数字8
  967.       if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
  968.         if $password.length >= 15
  969.           return
  970.         end
  971.         $password[@text_index] = "8"
  972.         @textcursor_index += 1
  973.         @text_index += 1
  974.         @login_window.refresh
  975.       end
  976.       # 数字9
  977.       if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
  978.         if $password.length >= 15
  979.           return
  980.         end
  981.         $password[@text_index] = "9"
  982.         @textcursor_index += 1
  983.         @text_index += 1
  984.         @login_window.refresh
  985.       end
  986.       # 删除键
  987.       if Kboard.keyboard($R_Key_BACK)
  988.         if $password.length > 0
  989.           $password.pop
  990.           @textcursor_index -= 1
  991.           @text_index -= 1
  992.           @login_window.refresh
  993.         end
  994.       end
  995.     end
  996.   end
  997. end


咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!

Lv3.寻梦者

梦石
3
星屑
73
在线时间
1597 小时
注册时间
2013-2-23
帖子
1789
发表于 2013-7-3 09:39:58 | 显示全部楼层
不需要脚本:设置个事件,事件执行条件改为自动执行,再在事件第2页场所转移,然后再设置暂时消除事件。即可。
(听明白了吗?没明白看截图!↓)
QQ图片20130703093828.jpg

点评

!!这个能解决的话不用发贴求助了!0,0 不过还是谢谢了。  发表于 2013-7-4 04:20

评分

参与人数 1星屑 +5 收起 理由
黄濑凉太 + 5 算是……认可?

查看全部评分

像我这么帅的在自己的游戏里一定是主角!
最近申请了b站直播间:http://live.bilibili.com/31494
鄙人的视频合集:点我
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
帖子
213
 楼主| 发表于 2013-7-4 04:17:25 | 显示全部楼层
q374435503 发表于 2013-7-3 02:39
不需要脚本:设置个事件,事件执行条件改为自动执行,再在事件第2页场所转移,然后再设置暂时消除事件。即 ...

拜托。。。这个脚本运行结束后自动跳到第一次设定的地图中,(就是我设定了个开头动画,动画结束 开启这个脚本,  登陆成功 又回到开头动画,设置事件移动没用,,)所以说能不能在 这脚本后面加上登陆成功后 场景移动到某张地图中,,,,,
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
帖子
213
 楼主| 发表于 2013-7-5 04:22:16 | 显示全部楼层
咋就没人回复呢?大大 帮忙下呗
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
帖子
213
 楼主| 发表于 2013-7-6 05:12:45 | 显示全部楼层
好吧,没人会?{:2_263:}

评分

参与人数 1星屑 -20 收起 理由
怪蜀黍 -20 连帖

查看全部评分

咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-16 13:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表