Project1

标题: 【已解决】p i 以后是0 1 2 3 4 是5个分组的编号 如何+fighte... [打印本页]

作者: 金芒芒    时间: 2023-8-16 09:54
标题: 【已解决】p i 以后是0 1 2 3 4 是5个分组的编号 如何+fighte...
本帖最后由 金芒芒 于 2023-8-17 10:25 编辑

RUBY 代码复制
  1. team_selected_troops = @selected_units
  2.     for i in 0...@selected_units.size
  3.     #team_selected_troops[i] = Figter_data::data_id.index(team_selected_troops[i])
  4.     team_selected_troops[i] = Figter_data::THE_NAME.index(team_selected_troops[i])
  5.     p i #0 1 2 3 4
  6.     end
  7.     a=team_selected_troops.flatten
  8.     x=544
  9.     for i in 0...a.size
  10.     $game_screen.pictures[i+1].show("头像#{a[i]}", 0,x, 550, 100, 100, 255, 0)
  11.     x-=87
  12.     end

作者: soulsaga    时间: 2023-8-16 16:05
不要乱改脚本..照抄就行
作者: 金芒芒    时间: 2023-8-16 17:20
本帖最后由 金芒芒 于 2023-8-16 17:25 编辑
soulsaga 发表于 2023-8-16 16:05
不要乱改脚本..照抄就行


就提取了头像, i = nil 了
RUBY 代码复制
  1. def command_custom_battle#定义命令_自定义战斗
  2.     # 演奏确定 SE
  3.     $game_system.se_play($data_system.decision_se)
  4.      #$游戏系统。se播放($数据系统。未指定文件或目录
  5.  
  6.     choose_map_main#选择主地图
  7. # map_info = $custom_battle_next_map_id#@map_info#地图信息=@地图信息
  8.   #如果选择随机地图随机士兵
  9. # if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
  10. #   make_random_efs_game#生成随机efs_game
  11. #   return
  12. # end
  13. #---------------------------------------------------- ↑↓   
  14.     #如果@强制后退或@强制后退==无
  15.     if ! @force_back or @force_back == nil
  16.     #自定义主战场(0,@地图信息[1],@地图信息[2])data_id
  17.     custom_battle_main(0,@map_info[1],@map_info[2])
  18.     #团队选定部队=@选定部队
  19.     team_selected_troops = @selected_units
  20.  
  21.  
  22.     #如果@强制后退或@强制后退==无
  23.     if ! @force_back or @force_back == nil
  24.       #自定义主战场(1,@地图信息[1],@地图信息[2])
  25.       custom_battle_main(1,@map_info[1],@map_info[2])
  26.       #敌人选定部队=@选定部队
  27.       if $game_switches[18] == true
  28.       #true是打开,false是关闭
  29.       #敌军enermy精选部队
  30.  
  31.       enermy_selected_troops =[[5],[18],[19],[21],[16]] #@selected_units
  32.  
  33.  
  34.       # @group_one.x = 928
  35.  
  36.     #  @group_one.y = 544
  37.     #  @group_two.x = 1248
  38.     #  @group_two.y = 640
  39.  
  40.       end
  41.       if $game_switches[19] == true
  42.       enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
  43.     end
  44.  
  45.  
  46.       #如果@强制后退或@强制后退==无
  47.       if ! @force_back or @force_back == nil
  48.         choose_hero_main#选择英雄主
  49.         selected_hero = nil
  50.         #selected_hero = @selected_hero#选定的英雄=@选定的英雄
  51.         #如果@强制后退或@强制后退==无
  52.         if ! @force_back or @force_back == nil
  53.  
  54.         team_army = Game_Army_Slg.new(0)
  55.         #enermy军队
  56.         enermy_army = Game_Army_Slg.new(1)
  57.         team_army.create_empty_army
  58.         enermy_army.create_empty_army
  59.         #team_army.load_twoD_Array(team_selected_troops,selected_hero)
  60.         team_army.load_twoD_Array(team_selected_troops,selected_hero)
  61.         enermy_army.load_twoD_Array(enermy_selected_troops)
  62.        # 切换地图画面
  63.       for i in 0...@selected_units.size
  64.     #team_selected_troops[i] = Figter_data::data_id.index(team_selected_troops[i])
  65.       team_selected_troops[i] = Figter_data::THE_NAME.index(team_selected_troops[i])
  66.  
  67.       end
  68.       a=team_selected_troops.flatten
  69.       x=544
  70.       for i in 0...a.size
  71.       $game_screen.pictures[i+1].show("头像#{a[i]}", 0,x, 550, 100, 100, 255, 0)
  72.       x-=87
  73.       end

头像.png (131.42 KB, 下载次数: 4)

头像.png

文件夹.png (298.2 KB, 下载次数: 2)

文件夹.png

作者: soulsaga    时间: 2023-8-16 18:02
金芒芒 发表于 2023-8-16 17:20
就提取了头像, i = nil 了
  def command_custom_battle#定义命令_自定义战斗
    # 演奏确定 SE

RUBY 代码复制
  1. team_selected_troops = @selected_units.dup
  2.     t=[]
  3.     for i in 0...@selected_units.size
  4.     t[i] = Figter_data::THE_NAME.index(team_selected_troops[i])
  5.     p i #0 1 2 3 4
  6.     end
  7.     a=t.flatten
  8.     x=544
  9.     for i in 0...a.size
  10.     $game_screen.pictures[i+1].show("头像#{a[i]}", 0,x, 550, 100, 100, 255, 0)
  11.     x-=87
  12.     end

作者: 金芒芒    时间: 2023-8-17 09:33
本帖最后由 金芒芒 于 2023-8-17 11:14 编辑
soulsaga 发表于 2023-8-16 18:02
team_selected_troops = @selected_units.dup
    t=[]
    for i in 0...@selected_units.size

  1.     t= Marshal::load(Marshal.dump(team_selected_troops))

  2.     a=t.flatten
  3.     x=544
  4.     for i in 0...a.size
  5.     $game_screen.pictures[i+1].show("头像#{a[i]}", 0,x, 550, 100, 100, 255, 0)
  6.     x-=87
  7.     end
复制代码

1头像.png (223.36 KB, 下载次数: 3)

1头像.png





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1