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

Getting length of an array? #108

Open
lucasb-eyer opened this issue Sep 13, 2019 · 1 comment
Open

Getting length of an array? #108

lucasb-eyer opened this issue Sep 13, 2019 · 1 comment

Comments

@lucasb-eyer
Copy link

lucasb-eyer commented Sep 13, 2019

Hi, I wonder how to get the length of an entity's field that is an array.

An example of such a field is in CDOTA_PlayerResource the field m_vecPlayerData, where we access individual entries through, for example, m_vecPlayerData.0003.m_iPlayerSteamID etc.

In an old version of this code (before the gigantic update in commit 805b5d), I used to get the length of an entity's field as follows nplayers, found := entity.FetchUint32("m_vecPlayerData"). Translating this to the new API, I would try nplayers, found := e.GetUint32("m_vecPlayerData"), but this does not work anymore. Actually, e.Get("m_vecPlayerData") does work and returns something of type *manta.fieldState which I cannot further work with, since it's an internal type.

@jacobxy
Copy link

jacobxy commented Jun 1, 2021

I will print out all the values with dump in advance, and then check the length of the array!

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

2 participants