Original Post — Direct link

Developing an editor plugin in maniascript I attempted to use the class CGameItemModel which inherits from CCollector and that has a "Name" member. However, the compiler kept erroring out telling me that Name was not a member of CGameItemModel. I then attempted to downcast to CCollector and I was able to access the "Name" no problem. This is an acceptable work around for me but it's slightly irritating because it creates a compiler warning about my downcast.

Here is a minimal example you can use to reproduce the compile error. Simply switch which line is commented out to see one of them compiles and one does not.

#RequireContext CMapEditorPlugin

main() {
log(Items[0].ItemModel.Name);
//log((Items[0].ItemModel as CCollector).Name);
}
over 1 year ago - Ubi-TheBerry - Direct link

Hey there @skybaxrider

Apologies for the delayed response.

We're limited in the assistance we can offer when it comes to coding / scripting queries such as this, however I have noted this on to the team so they can review it.

When we have more information back from them, we'll share it here.

Thank you!

over 1 year ago - Ubi-TheBerry - Direct link

No problem @skybaxrider !

We haven't had anything back from the team just yet as they're looking into this, but when there's any news, we'll let you know!