确实不科学,但是好像要删除building的某些属性才行
可以参看一下我很以前写的批处理代码,由于reader有bug,某些函数要崩溃后来就没写了
而且只是维持了一个基本prop需要的属性
但是至少能成功使用的。。- --require("iuplua")
- --require( "iupluacontrols" )
- function reader.main (this)
- pos = reader:entries_GetHeadPosition()
- while pos~=0 do
- entry,pos = reader:entries_GetNext(pos)
- flag = reader:entry_GetFlag(entry)
- myT,myG,myI = reader:entry_GetTGI(entry)
- if (flag == 7) then
- breakflag=0
- exemplar = reader:ex_Decode(entry)
- reader:ex_SetParentCohort(exemplar,dw1,dw2,dw3)
- proppos = reader:exprop_GetHeadPosition(exemplar)
- while proppos~=0 do
- exprop, proppos = reader:exprop_GetNext(exemplar,proppos)
- desc,descname = reader:exprop_GetDesc(exprop)
- --print (desc..":"..descname)
- if (desc == 0x00000010) then
- --type
- if (reader:exprop_GetValueStr(exprop)~='Buildings') then
- --print ("I have to break")
- breakflag = 1
- --reader:ex_Release(exemplar)
- break
- end
- reader:exprop_SetValue(exprop,0x0000001e)
- elseif (desc == 0x00000020) then
- --name
- ptid = "0x"..string.format("%x",tostring(myT,"o"))
- pgid = "0x"..string.format("%x",tostring(myG+1,"o"))
- piid = "0x"..string.format("%x",tostring(myI,"o"))
- pname = "b2p_"..reader:exprop_GetValueStr(exprop)
- --res, pgid2,piid2,pname2 = iup.GetParam("B2P (Cancel to Next One)", nil,"GID:%s\nIID:%s\nProp Name:%s\n",pgid,piid ,pname)
- --if(not res) then
- --break
- --end
- reader:entry_SetTGI(entry,piid,pgid,ptid)
- reader:exprop_SetValue(exprop,pname)
- --reader:entry_SetTGI(entry,piid2,pgid2,ptid)
- --reader:exprop_SetValue(exprop,pname2)
- elseif (desc == 0x27812810) then
- --size
- elseif (desc >= 0x27812820 and desc <= 0x27812825) then
- --box
- elseif (desc == 0x29244DB5) then
- --Flammability
- reader:exprop_SetValue(exprop,0x00)
- elseif (desc == 0x49BEDA31) then
- --MaxFireStage
- elseif (desc == 0xAA1DD397) then
- --zoom
- reader:exprop_SetDesc(exprop,0x0ABFC024)
- reader:exprop_SetValue(exprop, 0x0000001F)
- elseif (desc == 0x0ABFC024) then
- --zoom
- else
- reader:exprop_SetDesc(exprop,0xffffffff)
- --reader:exprop_Del(exemplar ,proppos)
- end
- end
- if not (breakflag == 1) then
- --add light
- exprop = reader:exprop_Add(exemplar)
- reader:exprop_SetDesc(exprop,0x4A9F188B)
- reader:exprop_SetType(exprop,0xB00)
- reader:exprop_SetRep(exprop,1)
- reader:exprop_SetValue(exprop, 0x01)
- end
- reader:ex_Encode(entry,exemplar)
- end
- end
- end
复制代码 在这里新建粘贴进去运行就可以了
[ 本帖最后由 富江 于 2013-2-6 11:34 编辑 ] |