🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

array factory error with angelscript class

Started by
4 comments, last by Zervoxe 8 years, 3 months ago

Getting an issue with latest revision this has worked since forever until now.


array (0, 0)
ERROR:  : 
The subtype has no default factory
Has Compile Errors: True
/*******************************************************/


/*******************************************************/
Data/Script/Node.as (108, 8)
ERROR:  : 
Attempting to instantiate invalid template type 'array<Status>'
Has Compile Errors: True

shared enum BH_STATUS {BT_SUCCESS,BT_FAILURE,BT_RUNNING};
class Status
{
   Status(){}
   Status(BTNode @no,BH_STATUS b){@node=@no; BH=b;}
   BTNode@ node;
   BH_STATUS BH;
};

class Node
{
   array<Status> childrenStatus;
};
Advertisement

Hi Zervoxe,

which version of AngelScript are you using? I remember there being a bug like this in an older version of the library, but it should have been fixed a long time ago.

I'll double-check that this works as it should in the latest version.

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

I am using 2.31.0, the same code has been used since 2.29.1.
Last version it worked on was 2.30.2

I should note all of the code above is under a namespace declared in angelscript

Heh, I am truly sorry but it seems I've wasted your time making you look for something, seems I forgot to replace one of all the headers in angelscript and that of course did compile it just doesn't work because the compiled code didn't agree anymore.

Ah, that's good to know. smile.png

Can you tell me what header file that you had missed replacing? I'd like to understand a bit more on how this could have happened so I can think of some way of preventing it, or at least inform other users better about the cause and symptoms if anyone else should face the same problem.

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

Not sure exactly which file, I just copied over all the headers again as I compile angelscript to library and only keep the headers, so to be sure I just did a full replacement, most likely one of the last headers for the library if sorted alphabetically this is usually something which can happen when you include libraries that the headers can still be old versions as long as the variable is there but it was changed to another data type while still compatible works differently to make the results scewed.

but really this is a very simple and rare case as in most cases people will manage to copy over all headers and not miss a few files because they went copy pasting the files too quickly.

You also got a rare case where you replace a .lib and headers while your project that uses the library have visual studio still open it won't always notice the change and will compile the old code, not always a clean build will help either in which case you can restart visual studio.

I should note when I say one of the last headers I mean the ones for the actual library and not the addons.

another note is that my Windows 10 alot of times messes up opening folders and instantly trying to select all files will result in not actually selecting all files.(slow folder browsing)

This topic is closed to new replies.

Advertisement