# array factory error with angelscript class

This topic is 849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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;
};
Edited by Zervoxe

##### Share on other sites

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.

##### Share on other sites

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

Edited by Zervoxe

##### Share on other sites

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.

##### Share on other sites

Ah, that's good to know.

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.

##### Share on other sites

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)

Edited by Zervoxe

1. 1
Rutin
19
2. 2
3. 3
JoeJ
14
4. 4
5. 5

• 18
• 19
• 10
• 13
• 17
• ### Forum Statistics

• Total Topics
631694
• Total Posts
3001751
×