把下面的补丁放进安卓版,进入游戏一对话就会完美闪退,不过放进电脑版就能完美运行!补丁下面是排错信息,哪位大大帮我弄一下,让它能够兼容安卓版,本人感激不尽!
:
--半身像对话,把两个函数都复制黏贴到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;
|