【转载】自动区分win和rc版本的方法
ps:这是外网作者takex发布的方法
WinMugen读取文件时,一行255个字符以上,第255个字符会插入0x00。
因此,作为255个字符的适当的字符串[Files], [Files]被认为在最前面
在新MUGEN中字符数被扩展,所以从第256个字符开始的[Files]不会被识别
优点是在开头以外也能使用
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4[Files] cmd=Win.st cns=Win.st st=Win.st sprite=Win.sff anim=Win.air [Files] cmd=New.st cns=New.st st=New.st sprite=New.sff anim=New.air
超过255个字符RC会连在一起读 所以就算无意义字符不加载
Win读完255个会结串 然后从file开始重读
超过255个字符的时候WinMugen能成功读取代码而RC不行
这样就能在Def中自动区分Win版本和RC版本选择不同的文件,不用分出几个Def
这是作者的推特(点进去就行要翻墙)
并且这个方法可以做到版本向上兼容和向下兼容(实测)
使用示范
例如:
(在[state ]前面加上255个字符 这样的话在win版本正常读取 而rc则不生效 用来兼容win版本的隔离)
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3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ent = 0
anim = 0
pos = 60,0
id = 2333
postype = p1
bindtime = -1
ontop = 1
ownpal = 1
图例
我来给他补充两句吧:
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4[Files]
这一大段填充的字,会导致RC忽略掉,从而读取在下方的[Files]而不是这一列的,而WIN仍然会读取,并且很神秘地不会读取下面写给RC的[Files]造成覆盖。