Advertisement

Getting metadata using scriptbuilder doesn't work

Started by February 27, 2021 08:45 PM
3 comments, last by LeonMrBonnie 3 years, 8 months ago

Hello,

I am trying to use the metadata features of the scriptbuilder add-on to add some OOP functionality.

But it seems that the scriptbuilder does not recognize the metadata on script class methods.

My code for getting the metadata looks like this: https://pastebin.com/giHMP1te

And my script class in my AngelScript code looks like this: https://pastebin.com/VNw02A5y

The only log I get is a 0 indicating that the returned vector from GetMetadataForTypeMethod is empty.

None

That is odd. It should work.

I'll try to reproduce this problem, and let you know what I find.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I reproduced the problem.

The reason that you don't find the metadata is that you're using the non-virtual method to lookup the metadata but the builder is storing the virtual method as the key,

Change the following line

                auto method = type->GetMethodByIndex(n, false);

to

                auto method = type->GetMethodByIndex(n, true);

and it works.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

WitchLord said:
The reason that you don't find the metadata is that you're using the non-virtual method to lookup the metadata but the builder is storing the virtual method as the key,

Ah, thank you very much!

None

This topic is closed to new replies.

Advertisement