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"
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
1.项目代码功能经验证ok,确保稳定可靠运行。欢迎下载使用!在使用过程中,如有问题或建议,请及时私信沟通。 2.主要针对各个计算机相关专业,包括计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网等领域的在校学生、专业教师或企业员工使用。 3.项目具有丰富的拓展空间,不仅可作为入门进阶,也可直接作为毕设、课程设计、大作业、初期项目立项演示等用途。 4.当然也鼓励大家基于此进行二次开发。 5.期待你能在项目中找到乐趣和灵感,也欢迎你的分享和反馈! 【资源说明】 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip 基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).zip
资源推荐
资源详情
资源评论
收起资源包目录
基于Unity3d和C#语言开发的回合制RPG游戏项目源码+sln解决方案(课程作业).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
NavMeshLayers.asset 9KB
NavMeshAreas.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
资源评论
北航程序员小C
- 粉丝: 2244
- 资源: 1825
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功