找回密码
 点一下
查看: 1761|回复: 7

如何将AbilityId转换为"A00X"形式呢?

[复制链接]
发表于 2008-3-12 22:36:37 | 显示全部楼层 |阅读模式
直接取出来是很多位的一个整数,怎么把这个整数弄成编辑器里面那种形式?
我需要把它转成字符串,用来判断是否是一个物品技能
发表于 2008-3-12 22:37:56 | 显示全部楼层
回复

使用道具 举报

发表于 2008-3-12 22:59:32 | 显示全部楼层
ctrl+D不是就显示了?
未命名.jpg
回复

使用道具 举报

发表于 2008-3-12 23:32:19 | 显示全部楼层
啊呀呀,ls啊,怎么说呢………………
lz要的是怎么转换的方法,而不是直接看结果吧………………
回复

使用道具 举报

发表于 2008-3-13 04:10:54 | 显示全部楼层
大哥们。。你们到底看没看懂

-。- 懒得查了,我编个试试看

function Dec2Ascii takes integer i returns string
local string array ascii //存放ascii码的表,由于实际应用不需要特殊符号所以只要大写小写字母和数字

set ascii[48] = "0"  // 从这里开始才有意义
set ascii[49] = "1"
set ascii[50] = "2"
set ascii[51] = "3"
set ascii[52] = "4"
set ascii[53] = "5"
set ascii[54] = "6"
set ascii[55] = "7"
set ascii[56] = "8"
set ascii[57] = "9"

//大写字母
set ascii[65] = "A"
set ascii[66] = "B"
set ascii[67] = "C"
set ascii[68] = "D"
set ascii[69] = "E"
set ascii[70] = "F"
set ascii[71] = "G"
set ascii[72] = "H"
set ascii[73] = "I"
set ascii[74] = "J"
set ascii[75] = "K"
set ascii[76] = "L"
set ascii[77] = "M"
set ascii[78] = "N"
set ascii[79] = "O"
set ascii[80] = "P"
set ascii[81] = "Q"
set ascii[82] = "R"
set ascii[83] = "S"
set ascii[84] = "T"
set ascii[85] = "U"
set ascii[86] = "V"
set ascii[87] = "W"
set ascii[88] = "X"
set ascii[89] = "Y"
set ascii[90] = "Z"

//小写字母
set ascii[97] = "a"
set ascii[98] = "b"
set ascii[99] = "c"
set ascii[100] = "d"
set ascii[101] = "e"
set ascii[102] = "f"
set ascii[103] = "g"
set ascii[104] = "h"
set ascii[105] = "i"
set ascii[106] = "j"
set ascii[107] = "k"
set ascii[108] = "l"
set ascii[109] = "m"
set ascii[110] = "n"
set ascii[111] = "o"
set ascii[112] = "p"
set ascii[113] = "q"
set ascii[114] = "r"
set ascii[115] = "s"
set ascii[116] = "t"
set ascii[117] = "u"
set ascii[118] = "v"
set ascii[119] = "w"
set ascii[120] = "x"
set ascii[121] = "y"
set ascii[122] = "z"

if (i < 48) or (i > 57 and i < 65) or (i > 90 and i < 97) or (i > 122) then
    return "_"
else
    return ascii
endif
return "_"
endfunction

///////////////////////////////////////
///////////////////////////////////////

function I2Ascii takes integer i returns string
if i < 256 then
    return Dec2Ascii(i)
else
    return I2Ascii(i / 256) + Dec2Ascii(ModuloInteger(i,256)) //余数
endif
return "_"
endfunction
回复

使用道具 举报

发表于 2008-3-13 04:21:23 | 显示全部楼层
来个演示地图

选择单位的时候屏幕就显示他的单位类型

123.w3x

15 KB, 下载次数: 17

回复

使用道具 举报

发表于 2008-3-13 09:38:33 | 显示全部楼层
我的理解和ls差不多,恩~~
还是等lz来看了再说吧~~
回复

使用道具 举报

 楼主| 发表于 2008-3-13 17:59:16 | 显示全部楼层
原来没有现成的办法……
谢谢小精灵的手写函数
Jass里似乎也没有直接获取ASCII码的函数
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-11-23 20:26 , Processed in 0.205385 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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