xls2lua
---------------------------
Convert xls to lua script for game resource
(将xls数据文件转化为lua脚本,作为游戏资源使用)
use [python xlrd](https://pypi.python.org/pypi/xlrd)
(使用python xlrd模块)
Blog: http://www.luzexi.com
Email: jesse_luzexi@163.com
# What's this.(是什么)
This is a script to convert xls to lua.
If you use lua language , the data write in lua is the best thing for you to code.
So this script will help you convert xls to lua , so you can do your job more easily.
(如果你在使用Lua语言,将数据写进Lua文件是最方便的做法。这个脚本将帮助你将数据xls文件转化为lua文件,这样你就可以更好的工作了。)
### Declare (声明)
This script is inherit from https://github.com/zfengzhen/xls2lua .
I improve it to fit my data rule like add array type in script and remove the different talbe name in xls and so on.
Any way , you can choose one that more fit your project.
(这个脚本是从 https://github.com/zfengzhen/xls2lua 继承过来的,我改进了很多东西,也去除了很多东西,我改成了适合我自己的脚本。不管怎样,你可以选择一个适合你的脚本去运行。)
### Example(例子xls表格)
example_building.xls
<table>
<tr>
<td>id</td>
<td>name</td>
<td>use_money</td>
<td>use_food</td>
<td>is_init</td>
<td>defense</td>
<td>args1</td>
<td>args2</td>
<td>args3</td>
<td>args4</td>
</tr>
<tr>
<td>i</td>
<td>s</td>
<td>i</td>
<td>f</td>
<td>b</td>
<td>i</td>
<td>ai</td>
<td>af</td>
<td>as</td>
<td>ab</td>
</tr>
<tr>
<td>1</td>
<td>house</td>
<td>1000</td>
<td>2.33</td>
<td>TRUE</td>
<td>100</td>
<td>1;2;3</td>
<td>1.23;2;3.23</td>
<td>sdf;23e;s</td>
<td>true;false;true</td>
</tr>
<tr>
<td>2</td>
<td>house2</td>
<td>123</td>
<td>336.2</td>
<td>TRUE</td>
<td></td>
<td>1;2;3</td>
<td>1;2.3445;3</td>
<td>你好;你在哪</td>
<td>true;false</td>
</tr>
<tr>
<td>3</td>
<td></td>
<td>456</td>
<td>222.33665</td>
<td>FALSE</td>
<td>130</td>
<td>3;2;5;;</td>
<td>3;2;2.5;;</td>
<td>我在这里啊;你在那;呢</td>
<td>false;true</td>
</tr>
<tr>
<td>4</td>
<td>farm</td>
<td>100</td>
<td>220</td>
<td>FALSE</td>
<td>200</td>
<td>2;3;</td>
<td>200.3;3;234.23;</td>
<td>df;ssd;dd;dd</td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>house5</td>
<td></td>
<td>22.1</td>
<td></td>
<td>2343;6;6;;;7</td>
<td>3;6.3;6;;;7</td>
<td>ss;d;d;d</td>
<td>true;true</td>
</tr>
<tr>
<td>6</td>
<td>horse3</td>
<td>200</td>
<td></td>
<td>FALSE</td>
<td>333</td>
<td></td>
<td></td>
<td>2e;w;e;we</td>
<td>false;false;false;false</td>
</tr>
</table>
### Excute Example (举例执行命令)
python ./xls2lua.py example_building.xls ./data/
### NOTICE:(注意点)
> The sheet name must start with "output_" , the lua file name will be the name behind "output_". <br />
> The **first row** must be **title**. <br />
> The **second row** must be **type** <br />
> The **type must be i , f , s , b , ai , af , as , ab. <br />
> i mean int , f mean float , s mean string , b mean bool , ai mean array int , af mean array float , as mean array string , ab mean array bool. <br />
> The **first column** must be int , so the type in first column must be i. <br />
> The string type with char **"** or **'** will be replace by \" or \' <br />
> The empty col will be a default value like 0 or "" or false or {} <br />
> (sheet名以"output_"开头的才会被识别转换,否则将被忽略) <br />
> (第1行必须是关键字名) <br />
> (第2行必须为类型) <br />
> (类型有:i,f,s,b,ai,af,as,ab这几种) <br />
> (i表示int,f表示float,s表示string,b表示bool,ai表示int数组,af表示float数组,as表示string数组,ab表示bool数组) <br />
> (第1列必须为int类型的唯一关键字) <br />
> (string类型中"和'会自动用\"和\'替代)
> (空列将会被默认值代替,例如:0,"",false,{})
### Lua script (生成后的Lua文件示例)
```lua
-- this file is generated by program!
-- don't change it manaully.
-- source file: example_building.xls
-- created at: Thu Mar 26 02:53:52 2015
local data = {}
data[1] = { id = 1, name = "house", use_money = 1000, use_food = 2.33, is_init = true, defense = 100, aadd = {1,2,3}, aadddss = {1.23,2,3.23}, ddff = {"sdf","23e","s"}, ffdd = {true,false,true}}
data[2] = { id = 2, name = "house2", use_money = 123, use_food = 336.2, is_init = true, defense = 0, aadd = {1,2,3}, aadddss = {1,2.3445,3}, ddff = {"你好","你在哪"}, ffdd = {true,false}}
data[3] = { id = 3, name = "", use_money = 456, use_food = 222.33665, is_init = false, defense = 130, aadd = {3,2,5}, aadddss = {3,2,2.5}, ddff = {"我在这里啊","你在那","呢"}, ffdd = {false,true}}
data[4] = { id = 4, name = "farm", use_money = 100, use_food = 220.0, is_init = false, defense = 200, aadd = {2,3}, aadddss = {200.3,3,234.23}, ddff = {"df","ssd","dd","dd"}, ffdd = {}}
data[5] = { id = 5, name = "house5", use_money = 0, use_food = 22.1, is_init = false, defense = 234, aadd = {3,6,6,7}, aadddss = {3,6.3,6,7}, ddff = {"ss","d","d","d"}, ffdd = {true,true}}
data[6] = { id = 6, name = "horse3", use_money = 200, use_food = 0, is_init = false, defense = 333, aadd = {}, aadddss = {}, ddff = {"2e","w","e","we"}, ffdd = {false,false,false,false}}
return data
```
### How to use lua with data. (如何使用生成的lua数据)
```lua
local building = require "building"
print(building[1].name)
```
The console will print "house"
没有合适的资源?快使用搜索试试~ 我知道了~
基于unity3d的回合制RPG游戏源码+项目说明.zip
共2000个文件
meta:1069个
cs:228个
lua:169个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 6 浏览量
2024-04-12
00:34:18
上传
评论
收藏 27.93MB ZIP 举报
温馨提示
基于unity3d的回合制RPG游戏源码+项目说明.zip基于unity3d的回合制RPG游戏源码+项目说明.zip基于unity3d的回合制RPG游戏源码+项目说明.zip基于unity3d的回合制RPG游戏源码+项目说明.zip基于unity3d的回合制RPG游戏源码+项目说明.zip基于unity3d的回合制RPG游戏源码+项目说明.zip 【资源说明】 1、该资源内项目代码都是经过测试运行成功,功能正常的情况下才上传的,请放心下载使用。 2、适用人群:主要针对计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、数学、电子信息等)的同学或企业员工下载使用,具有较高的学习借鉴价值。 3、不仅适合小白学习实战练习,也可作为大作业、课程设计、毕设项目、初期项目立项演示等,欢迎下载,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于unity3d的回合制RPG游戏源码+项目说明.zip (2000个子文件)
skill.anim 212KB
attack.anim 194KB
die.anim 186KB
hit.anim 182KB
skill.anim 156KB
idle.anim 146KB
move.anim 123KB
die.anim 114KB
attack.anim 106KB
skill.anim 88KB
hit.anim 87KB
idle.anim 84KB
skill.anim 81KB
attack.anim 80KB
move.anim 77KB
skill.anim 68KB
attack.anim 67KB
die.anim 67KB
die.anim 67KB
attack.anim 66KB
die.anim 66KB
move.anim 66KB
skill.anim 61KB
die.anim 61KB
hit.anim 60KB
skill.anim 59KB
move.anim 58KB
attack.anim 58KB
idle.anim 57KB
attack.anim 57KB
hit.anim 56KB
move.anim 55KB
move.anim 55KB
idle.anim 52KB
idle.anim 52KB
die.anim 50KB
hit.anim 49KB
hit.anim 49KB
hit.anim 48KB
move.anim 48KB
idle.anim 48KB
hit.anim 41KB
attack.anim 38KB
idle.anim 35KB
skill.anim 33KB
die.anim 32KB
idle.anim 30KB
move.anim 30KB
battle_scene_01.asset 610KB
ProjectSettings.asset 44KB
LightingData.asset 12KB
LightingData.asset 12KB
NavMeshAreas.asset 9KB
NavMeshLayers.asset 9KB
InputManager.asset 5KB
NavMesh.asset 5KB
battle_ui.asset 5KB
QualitySettings.asset 5KB
hero_icon.asset 4KB
equip_icon.asset 4KB
GraphicsSettings.asset 4KB
TagManager.asset 4KB
Physics2DSettings.asset 4KB
DynamicsManager.asset 4KB
EditorBuildSettings.asset 4KB
EditorSettings.asset 4KB
UnityConnectSettings.asset 4KB
AudioManager.asset 4KB
UnityAdsSettings.asset 4KB
TimeManager.asset 4KB
NetworkManager.asset 4KB
ClusterInputManager.asset 4KB
Build.bat 525B
run.bat 18B
person_pb.lua.bytes 3KB
TestPerf.lua.bytes 2KB
TestErrorStack.lua.bytes 2KB
TestLuaCoroutine.lua.bytes 881B
TestLoader.lua.bytes 170B
TestLoader.lua.bytes 170B
LeanTween.cs 251KB
DelegateFactory.cs 91KB
UnityEngine_PhysicsWrap.cs 90KB
LTDescrImplWrap.cs 88KB
UnityEngine_AnimatorWrap.cs 78KB
UnityEngine_CameraWrap.cs 73KB
ToLua.cs 72KB
UnityEngine_KeyCodeWrap.cs 70KB
LeanTweenWrap.cs 65KB
UnityEngine_TransformWrap.cs 64KB
LuaBinder.cs 60KB
DG_Tweening_DOTweenWrap.cs 60KB
LuaState.cs 57KB
System_ArrayWrap.cs 52KB
System_StringWrap.cs 52KB
System_TypeWrap.cs 50KB
UnityEngine_RigidbodyWrap.cs 50KB
UnityEngine_MaterialWrap.cs 50KB
LuaDLL.cs 48KB
DG_Tweening_DOTweenAnimationWrap.cs 44KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
龙年行大运
- 粉丝: 1001
- 资源: 3854
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (2005-2014期间)中国环境统计年鉴
- 2015高中信息技术excel操作题及素材(精品文档).xls
- SW3518S全协议快充USB Type-c接口电源模块硬件参考设计评估版硬件(原理图 +pcb)+封装库文件.zip
- 基于深度强化学习算法实现多星对区域目标观测的规划python源码+数据集+模型+超详细注释.zip
- RT1052+SDRAM(IS42S16160) +SIM7600CE(PCIE接口封装)控制板硬件(原理图+PCB)+封装库
- 2017大学英语四级词汇-excel-列表版(精品文档).xls
- 2017版国家医保药品目录(excel版)完整版.xls
- 基于STM32F103单片机设计的无刷电机控制板硬件(原理图+PCB+BOM)+MCU软件控制源码+文档资料.zip
- 肺结节检测数据集VOC+YOLO格式1186张1类别.zip
- Faster-RCNN基于知识蒸馏的目标检测模型增量深度学习方法python源码+项目运行说明.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功