Luaplus subtable Traversal

Source: Internet
Author: User

The simple configuration will be used first. luaplus will waste a lot of time because other people's teaching materials are not clearly written in the table loop. It will only be known after reading SRC.

Bytes ------------------------------------------------------------------------------------------------------

Tabobjectdata = {
[0x00001000] = {
Meshname = "00040_lian.mesh ",
Meshdir = "/models/player/female /",
Showname = "actress 1 ",
Scaling = 0.01,
Image = "ptgw. TGA ",
Imageindex = 0,
Required tlist = {
[0x00000001] = {
Bindbone = "",
Offestpos = {x = 0.0, y = 0.0, Z = 0.0 },
Direction = {x = 0.0, y = 0.0, Z = 0.0}
}
}
},
[0x00002000] = {
Meshname = "male clothes 30. mesh ",
Meshdir = "/models/player/Male /",
Showname = "actress 1 ",
Scaling = 0.01,
Image = "ptgw. TGA ",
Imageindex = 0,
Required tlist = {
[0x00000001] = {
Bindbone = "",
Offestpos = {x = 0.0, y = 0.0, Z = 0.0 },
Direction = {x = 0.0, y = 0.0, Z = 0.0}
}
}
},
[0x00000007] = {
Meshname = "ninja. mesh ",
Meshdir = "/models/player/ninja/s ",
Showname = "actress 1 ",
Scaling = 0.01,
Image = "ptgw. TGA ",
Imageindex = 0,
Required tlist = {
[0x00000001] = {
Bindbone = "",
Offestpos = {x = 0.0, y = 0.0, Z = 0.0 },
Direction = {x = 0.0, y = 0.0, Z = 0.0}
}
}
}
}

Bytes --------------------------------------------------------------------------------------

Luaplus: luaobject objectdata = gameglobalmanager: getsingletonptr ()-> getluastate (). Get ()-> getglobal ("tabobjectdata ");
For (luatableiterator it (objectdata); it ++)
{
Luaplus: luaobject gameobj = it. getvalue ();
If (gameobj. istable ())
{
// The table of each object
Printf ("Object: % 08x \ n", it. getkey (). tointeger ());

Luaplus: luaobject upload tobj = gameobj. getbyname ("effectlist ");
If (optional tobj. istable ())
{
For (luatableiterator itr (effectobj); itr ++)
{
If (itr. getvalue (). istable ())
{
Printf ("special effect of object: % 08x: % 08x \ n", it. getkey (). tointeger (), itr. getkey (). tointeger ());
}
}
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.