Jump to content
  • Advertisement
Sign in to follow this  
Zervoxe

array factory error with angelscript class

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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. 

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!