Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否提供一个V3结构体的例子 #97

Open
nieyanbing opened this issue Mar 4, 2022 · 7 comments
Open

能否提供一个V3结构体的例子 #97

nieyanbing opened this issue Mar 4, 2022 · 7 comments

Comments

@nieyanbing
Copy link

能否提供一个V3结构体的例子

ID 名称 结构体
1 坦克 血量:10 攻击: 10
2 法师 血量:20 攻击: 20

期望导出lua如下

return {
    init = function(g)

        g.MyData = {{
            id = 1,
            name = "坦克",
            attr = {
				hp = 10,
				attack = 10
			}
        }, {
            id = 1,
            name = "法师",
            attr = {
				hp = 20,
				attack = 20
			}
        }}

        return g
    end
}
@davyxu
Copy link
Owner

davyxu commented Mar 4, 2022 via email

@nieyanbing
Copy link
Author

v2貌似有支持?感觉这个功能应该还是蛮有用的。
而且如果有这种需求比如:装备合成的时候需要另外几个装备才能合成

{
    itemid = 1
    name = "合成装备",
    "合成装备" = {
        {
            itemid = 2, --物品ID
            count = 1,  --需要的数量
        },
        {
            itemid = 3,
            count = 2
        }
    }
}

像这种需求用V3应该怎么写? 或者其他的替代方案?

@davyxu
Copy link
Owner

davyxu commented Mar 4, 2022 via email

@nieyanbing
Copy link
Author

nieyanbing commented Mar 4, 2022 via email

@davyxu
Copy link
Owner

davyxu commented Mar 5, 2022 via email

@nieyanbing
Copy link
Author

nieyanbing commented Mar 5, 2022

先谢谢了 我知道这样确实是可以 只是感觉不太直观

@514366607
Copy link

你是用lua的?可以先用我的分支先。然后将格式设置为 表头 就行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants