CreateScriptObject problem

Started by
16 comments, last by Dentoid 17 years, 12 months ago
Hi I've got a problem where CreateScriptObject returns a pointer to an uninitialized piece of memory (0xcdcdcdcd in debug VC8 build). The object I'm trying to create is a script declared class with a bunch of members and methods. If I add an empty or simple constructor to the class it will instead return a null pointer. (I did a quick trace of the constructor execution inside CreateScriptObject, and on the second system call it does, the first being to some GC_AddRef or something, it gets a null pointer exception. That is, a script null ptr exception, not a system "real memory" exception.) I've got no idea what's going on... I've tried comparing to the test_scriptclassmethod test, but can't find any obvious differences, except that my class exists in a module. Don't know what more info to give, but I'll keep investigating. Just wondering if anyone (i.e. WitchLord :) has got any idea. Thanks in advance /Anders EDIT: Just FYI, I'm using the 2.6.0 release.
Advertisement
Just noticed that if I change the test_scriptclassmethod example to put the script2 script in another module (and update everything that accesses it to specify that module), CreateScriptObject returns 0 too. This time, however, because the constructor context can't be prepared.

I don't understand much what's going on here. Any help is welcome. :)

/Anders
I'll try to reproduce this problem in order to determine what's going on.

It sounds like a bug in AngelScript though.

Thanks for letting me know.

Regards,
Andreas

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 managed to reproduce the problem the way you mentioned, and I know where the problem is: The ids for the script class methods don't reflect which module they were declared in. Unfortunately this was a situation that I overlooked and the solution is not so simple.

I'll have to think about this a little and decide upon a solution.

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

Ah, okay. Thanks.

You might want to think about a way then to get the module a type id resides in too, since I found no way to do that as it is now (which I guess might be related). I mean... Currently, I can't for example get the method of a class by declaration if I haven't previously stored which module the type id was found in.

Hope that made sense. :)
Good point. :)

I seem to have overlooked quite a big part with this design. Fortunately getting the module id from the type id is easy, though it requires a new method to the engine interface.

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

Sounds good :)

Don't want to push it, but is there any ETA for these fixes? They're kind of a showstopper for me. :)
You can be assured that this is a high priority for me, as I consider it to be a bug, not a new feature. Maybe I can have a fix ready for the weekend, but I can't guarantee anything.

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

Okay, that sounds fine. Just wanted a rough estimate. :)
Btw, do you know if there's any fairly quick hack to make it work temporarily? Like passing the module manually into CreateScriptObject or something like that? (I'm not totally sure what's going wrong. :)

This topic is closed to new replies.

Advertisement