铁血丹心

 找回密码
 我要成为铁血侠客
搜索
查看: 1268|回复: 0

关于半身像对话补丁问题

[复制链接]
发表于 2014-3-15 19:30 | 显示全部楼层 |阅读模式

马上注册,结交更多侠友!

您需要 登录 才可以下载或查看,没有账号?我要成为铁血侠客

x
把下面的补丁放进安卓版,进入游戏一对话就会完美闪退,不过放进电脑版就能完美运行!补丁下面是排错信息,哪位大大帮我弄一下,让它能够兼容安卓版,本人感激不尽!
:
--半身像对话,把两个函数都复制黏贴到LDCR.lua的底部 by小二
--压缩包内的head.grp和head.idx解压缩到data文件夹
function TalkEx(s,headid,flag,name)        
lib.PicLoadFile(CONFIG.DataPath .. "head.idx", CONFIG.DataPath .. "head.grp", 55, 125)
  local pich = 130
  local h0, w0 = 375, 375
  local talkynum = 3
  local dx = 2
  local dy = 55
  local talkBorder = 13
        local star = string.find(s, "*")
        while star ~= nil do
                s = string.sub(s, 1, star - 1)..string.sub(s, star + 1, -1)
                star = string.find(s, "*")
        end   
  local xy = {       
        {headx = dx, heady = dy, talkx = 136, talky = dy, showhead = 0}, --2无头像左上       
        }
  flag = 1
  if CONFIG.KeyRepeat == 0 then
    lib.EnableKeyRepeat(0, CONFIG.KeyRepeatInterval)
  end
  lib.GetKey()
  
  local endp = nil
  local stop = 38
  local dy = 0
  local pid = headid
  if headid >= 0 then
        if headid > 243 and headid < 249 then
          headid = 0
        end
        pid = headid
        headid = gethead(headid)
  end
  while 1 do
    if dy == 0 then
      Cls()
          lib.PicLoadCache(55, 0, -1, -1, 1)
          if name ~= nil then
                DrawString(30, 10, name, C_GOLD, 25)
          else
                if duiyou(pid) or (headid >= 0 and headid <= 190) then
                        DrawString(30, 10, JY.Person[pid]["姓名"], C_GOLD, 25)
                end                    
          end
          lib.PicLoadCache(55, headid * 2, CC.ScreenW - w0 - 110, CC.ScreenH - h0, 1)
    end
    endp = string.len(s)
    if endp <= stop then
      DrawString(xy[flag].talkx + 5, xy[flag].talky + 5 + talkBorder + dy * (CC.DefaultFont + talkBorder), s, C_WHITE, CC.DefaultFont)
      ShowScreen()
      WaitKey()
      break;
    else
      DrawString(xy[flag].talkx + 5, xy[flag].talky + 5 + talkBorder + dy * (CC.DefaultFont + talkBorder), string.sub(s, 1, stop), C_WHITE, CC.DefaultFont)
    end
    dy = dy + 1
    s = string.sub(s, stop + 1, -1)
    if talkynum <= dy then
      ShowScreen()
      WaitKey()
      dy = 0
    end
  end
  if CONFIG.KeyRepeat == 0 then
    lib.EnableKeyRepeat(CONFIG.KeyRepeatDelay, CONFIG.KeyRepeatInterval)
  end
  Cls()
end

function say(s,pid,flag,name)  --改为简单版对话了...有时间再整复杂的
        TalkEx(s,pid,flag,name)
end
安卓版错误信息:
19:12:21 JY_Main start.
19:12:25 Loadrecord time=573
19:12:35 Start game cycle
19:12:38 4100
19:12:38 /sdcard/JYLDCR/script/jymain.lua:6486: attempt read read to undeclared variable gethead
19:12:38 stack traceback:
        /sdcard/JYLDCR/script/jymain.lua:128: in function </sdcard/JYLDCR/script/jymain.lua:126>
        [C]: in function 'error'
        /sdcard/JYLDCR/script/jymain.lua:146: in function '__index'
        /sdcard/JYLDCR/script/jymain.lua:6486: in function 'TalkEx'
        /sdcard/JYLDCR/script/jymain.lua:6525: in function 'say'
        /sdcard/JYLDCR/script/CEvent/4100.lua:9: in main chunk
        [C]: in function 'dofile'
        /sdcard/JYLDCR/script/jymain.lua:3957: in function 'CallCEvent'
        /sdcard/JYLDCR/script/jymain.lua:3937: in function 'oldEventExecute'
        /sdcard/JYLDCR/script/jymain.lua:3915: in function 'EventExecute'
        /sdcard/JYLDCR/script/jymain.lua:2310: in function 'Game_SMap'
        /sdcard/JYLDCR/script/jymain.lua:615: in function 'Game_Cycle'
        /sdcard/JYLDCR/script/jymain.lua:180: in function </sdcard/JYLDCR/script/jymain.lua:131>
        [C]: in function 'xpcall'
        /sdcard/JYLDCR/script/jymain.lua:123: in function </sdcard/JYLDCR/script/jymain.lua:121>
19:12:38 ExitGame();
19:12:38 ExitSDL();
19:12:38 main() end;
【武侠.中国】铁血丹心论坛(大武侠):致力于推广和发展武侠文化,让我们一起努力,做全球最大的武侠社区。
可能是目前为止最好的金庸群侠传MOD游戏交流论坛,各种经典武侠游戏等你来玩,各种开源制作工具等你来实现你的游戏开发之梦。

本版积分规则

小黑屋|手机版|铁血丹心

GMT+8, 2024-4-30 15:55

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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