查看: 1455|回复: 4

[有事请教] 【已解决】p i 以后是0 1 2 3 4 是5个分组的编号 如何+fighte...

[复制链接]
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2023-8-16 09:54:42 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 金芒芒 于 2023-8-17 10:25 编辑

[pre lang="ruby"]    team_selected_troops = @selected_units
    for i in 0...@selected_units.size
    #team_selected_troops = Figter_data::data_id.index(team_selected_troops)
    team_selected_troops = Figter_data::THE_NAME.index(team_selected_troops)
    p i #0 1 2 3 4
    end
    a=team_selected_troops.flatten
    x=544
    for i in 0...a.size
    $game_screen.pictures[i+1].show("头像#{a}", 0,x, 550, 100, 100, 255, 0)
    x-=87
    end[/pre]
梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2023-8-16 16:05:23 | 显示全部楼层
不要乱改脚本..照抄就行
回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2023-8-16 17:20:49 | 显示全部楼层
本帖最后由 金芒芒 于 2023-8-16 17:25 编辑
soulsaga 发表于 2023-8-16 16:05
不要乱改脚本..照抄就行


就提取了头像, i = nil 了
[pre lang="ruby"]  def command_custom_battle#定义命令_自定义战斗
    # 演奏确定 SE
    $game_system.se_play($data_system.decision_se)
     #$游戏系统。se播放($数据系统。未指定文件或目录
   
    choose_map_main#选择主地图
# map_info = $custom_battle_next_map_id#@map_info#地图信息=@地图信息
  #如果选择随机地图随机士兵
# if ! @force_back and map_info[0] == -1#如果!@强制返回并地图信息[0]==-1
#   make_random_efs_game#生成随机efs_game
#   return
# end
#---------------------------------------------------- ↑↓   
    #如果@强制后退或@强制后退==无
    if ! @force_back or @force_back == nil
    #自定义主战场(0,@地图信息[1],@地图信息[2])data_id
    custom_battle_main(0,@map_info[1],@map_info[2])
    #团队选定部队=@选定部队
    team_selected_troops = @selected_units


    #如果@强制后退或@强制后退==无
    if ! @force_back or @force_back == nil
      #自定义主战场(1,@地图信息[1],@地图信息[2])
      custom_battle_main(1,@map_info[1],@map_info[2])
      #敌人选定部队=@选定部队
      if $game_switches[18] == true
      #true是打开,false是关闭
      #敌军enermy精选部队
      
      enermy_selected_troops =[[5],[18],[19],[21],[16]] #@selected_units

      
      # @group_one.x = 928
     
    #  @group_one.y = 544
    #  @group_two.x = 1248
    #  @group_two.y = 640
     
      end
      if $game_switches[19] == true
      enermy_selected_troops =[ [5,5],[5,5,5],[5,5],[5,5,5],[5,5,5,5,5] ]
    end

   
      #如果@强制后退或@强制后退==无
      if ! @force_back or @force_back == nil
        choose_hero_main#选择英雄主
        selected_hero = nil
        #selected_hero = @selected_hero#选定的英雄=@选定的英雄
        #如果@强制后退或@强制后退==无
        if ! @force_back or @force_back == nil
         
        team_army = Game_Army_Slg.new(0)
        #enermy军队
        enermy_army = Game_Army_Slg.new(1)
        team_army.create_empty_army
        enermy_army.create_empty_army
        #team_army.load_twoD_Array(team_selected_troops,selected_hero)
        team_army.load_twoD_Array(team_selected_troops,selected_hero)
        enermy_army.load_twoD_Array(enermy_selected_troops)
       # 切换地图画面
      for i in 0...@selected_units.size
    #team_selected_troops = Figter_data::data_id.index(team_selected_troops)
      team_selected_troops = Figter_data::THE_NAME.index(team_selected_troops)
   
      end
      a=team_selected_troops.flatten
      x=544
      for i in 0...a.size
      $game_screen.pictures[i+1].show("头像#{a}", 0,x, 550, 100, 100, 255, 0)
      x-=87
      end[/pre]
头像.png
文件夹.png
回复

使用道具 举报

梦石
0
星屑
39236
在线时间
11155 小时
注册时间
2009-3-15
回帖
4768
发表于 2023-8-16 18:02:28 | 显示全部楼层
金芒芒 发表于 2023-8-16 17:20
就提取了头像, i = nil 了
  def command_custom_battle#定义命令_自定义战斗
    # 演奏确定 SE

[pre lang="ruby"]team_selected_troops = @selected_units.dup
    t=[]
    for i in 0...@selected_units.size
    t = Figter_data::THE_NAME.index(team_selected_troops)
    p i #0 1 2 3 4
    end
    a=t.flatten
    x=544
    for i in 0...a.size
    $game_screen.pictures[i+1].show("头像#{a}", 0,x, 550, 100, 100, 255, 0)
    x-=87
    end[/pre]
回复

使用道具 举报

梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2023-8-17 09:33:55 | 显示全部楼层
本帖最后由 金芒芒 于 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
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部