Project1

标题: 超级横版战斗的角色位置如何修改 [打印本页]

作者: ie486hu    时间: 2007-8-11 17:43
标题: 超级横版战斗的角色位置如何修改
我知道大家都对超级横版战斗这脚本几乎都放弃
原因是需要大量的美工
但是我觉得非常适合我
现在碰到一个问题
我想请教大家
因为我的战斗是采用直立式
跟原本的横版是不同
造成我的人物在攻击时会偏一边
有人可以帮我解决这各问题




截图

http://rpg.blue/upload_program/files/1.0001.jpg

角色要修改到红色圈中

http://rpg.blue/upload_program/files/1.0002.jpg

http://rpg.blue/upload_program/files/1.0003.jpg
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: ie486hu    时间: 2007-8-11 17:43
标题: 超级横版战斗的角色位置如何修改
我知道大家都对超级横版战斗这脚本几乎都放弃
原因是需要大量的美工
但是我觉得非常适合我
现在碰到一个问题
我想请教大家
因为我的战斗是采用直立式
跟原本的横版是不同
造成我的人物在攻击时会偏一边
有人可以帮我解决这各问题




截图

http://rpg.blue/upload_program/files/1.0001.jpg

角色要修改到红色圈中

http://rpg.blue/upload_program/files/1.0002.jpg

http://rpg.blue/upload_program/files/1.0003.jpg
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 镜无颜    时间: 2007-8-11 21:43
横版超级战斗,是以战斗图的宽来确定移动位置的,纵版的时候只要改为高就可以了...

在超级横版战斗大约800行的位置找到如下脚本(或者直接搜索吧....)
     if @active_battler.is_a?(Game_Enemy)
       if @active_battler.restriction == 3
         target = $game_troop.random_target_enemy
       elsif @active_battler.restriction == 2
         target = $game_party.random_target_actor
       else
         index = @active_battler.current_action.target_index
         target = $game_party.smooth_target_actor(index)
       end
#======== here is the setting for the movement & animation...
         x = target.screen_x - RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/6
         @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
         @spriteset.enemy_sprites[@active_battler.index].move(x, target.screen_y, 10)
#========= here if you look at the RPG's movement settings you'll see
#========= that he takes the number 40 for the speed of the animation...
#========= i thing thats too fast so i settet it down to 10 so looks smoother...
     end
     if @active_battler.is_a?(Game_Actor)
       if @active_battler.restriction == 3
         target = $game_party.random_target_actor
       elsif @active_battler.restriction == 2
         target = $game_troop.random_target_enemy
       else
         index = @active_battler.current_action.target_index
         target = $game_troop.smooth_target_enemy(index)
       end
#======= the same thing for the player... ^-^
       x = target.screen_x + RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).width/8
       @spriteset.actor_sprites[@active_battler.index].pose(0)
       @spriteset.actor_sprites[@active_battler.index].move(x, target.screen_y, 10)
     end

更改如下(直接在默认脚本上改的,如果LZ对此脚本改动不大可直接替换)
     if @active_battler.is_a?(Game_Enemy)
       if @active_battler.restriction == 3
         target = $game_troop.random_target_enemy
       elsif @active_battler.restriction == 2
         target = $game_party.random_target_actor
       else
         index = @active_battler.current_action.target_index
         target = $game_party.smooth_target_actor(index)
       end
         y = target.screen_y - RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).height/10#这是除以敌人战斗图的行数+2(这样就会显示在上方),我是在默认脚本里改的,LZ就以自己的实际情况而定
         @spriteset.enemy_sprites[@active_battler.index].enemy_pose(0)
         @spriteset.enemy_sprites[@active_battler.index].move(target.screen_x, y, 10) #如果需要调整位置的话就在这里的x,y上加减

     end
     if @active_battler.is_a?(Game_Actor)
       if @active_battler.restriction == 3
         target = $game_party.random_target_actor
       elsif @active_battler.restriction == 2
         target = $game_troop.random_target_enemy
       else
         index = @active_battler.current_action.target_index
         target = $game_troop.smooth_target_enemy(index)
       end
       y = target.screen_y + RPG::Cache.battler(@active_battler.battler_name, @active_battler.battler_hue).height/12 #这是除以角色战斗图的行数-2(这样就会显示在下方
       @spriteset.actor_sprites[@active_battler.index].pose(0)
       @spriteset.actor_sprites[@active_battler.index].move(target.screen_x, y, 10)#同上
     end
[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: ie486hu    时间: 2007-8-12 00:58
感谢
你帮我解决了问题





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