Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

4694 Excellent


About WitchLord

  • Rank
    Moderator - AngelCode

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I've fixed this problem in revision 2525. Observe, within namespace X the symbol A represents the class X::A, not the global variable A, so it is correct the script fails to compile. It was just not correct that it gave an assert failure. (in previous version of AngelScript it managed to identify the global variable A, but that was unintentional and due to the inconsistent symbol lookups used in different scenarios in the compiler.)
  2. WitchLord

    Will there be more frequent updates?

    It's a fair question, and one that I've thinking about for quite some time already. Before 2017 I decided to make less frequent releases as each release were becoming too small, and the act of releasing a version was taking up proportionally more time. However, I think a year between each release has proven a bit too long. Release 2.33.0 is still a few months away as I have more features planned for it. But maybe I'll take some time to backport some of the bug fixes available in the WIP to 2.32.0 and do an intermediate release. As for GitHub. I haven't really investigated it much. I have nothing against GitHub, I just personally don't see any gain with moving to GitHub. Though I might set up an official GitHub mirror at one time, if I can automate it. As for merging patches from contributers as-is is probably not going to happen too often. I accept contributions but I always make adjustments to the code, either to make further fixes, or to adjust the coding style to my own. If you have any contributions, feel free to send me the modified files by e-mail or post them here on the forum. Patch diff files are acceptable but I actually prefer the full file, which makes it easier for me to use winmerge to review the changes. Btw, are there any specific bugfixes you'd like to see back-ported to 2.32.0?
  3. Thanks for the continuous bug reports. This really helps a lot. I'll investigate this latest problem too.
  4. I've fixed this in revision 2524. Regards, Andreas
  5. WitchLord

    Returning arrays of ""pointers""?

    I believe the problem is that you're not passing the correct value to SetValue. The array is an array of handles (a.k.a. pointers), so SetValue expects the address to the pointer to the Character object. CScriptArray *GetTestCharArray() { static Character character; character.name = "CharName"; asIScriptContext *context = asGetActiveContext(); Assert(context, "Error! Can only call this function from within scripts"); asIScriptEngine *engine = context->GetEngine(); asITypeInfo *typeInfo = engine->GetTypeInfoByDecl("array<Character@>"); CScriptArray *arr = CScriptArray::Create(typeInfo, 1); Character *pointer = &character; arr->SetValue(0, &pointer); // Give the address of the pointer to the object return arr; } I'm not sure why in your case it looks like it is becomes a null pointer, but I presume it is because the first bytes of your Character object is holding zeroes, which would then be copied as if they were a null pointer.
  6. Ok. I'll investigate it.
  7. WitchLord

    Returning arrays of ""pointers""?

    Yes. this is suitable with your assumption that the objects out-live the scripts. There is no built-in array type, just as there is no default string type. I've opted for having these implemented externally so each application developer can decide how to do their own types. The add-ons are provided as a default implementation, but can be replaced by custom implementation if so desired.
  8. WitchLord

    Multiple scripts with the same function names?

    There are multiple solutions. Which works best for you will depend on your preferences and overall design of your engine. If each "area" is supposed to be independent, and loaded dynamically as the player enters the areas, then ideally each would be loaded into separate modules, in which case there is no problem with them having the same symbol names. If the "areas" are not independent and all loaded together at start up, then you can put them all into the same module, in which case you need to have a way to separate the symbol names. One way is using the prefix like you already thought of. Another is to use script classes to represent each "area", and finally you can also use namespaces.
  9. Which revision of AngelScript did you try? I cannot reproduce the problem in revision 2523, which was checked in on Aug 1st.
  10. I've fixed this in revision 2522.
  11. WitchLord

    Add a callback for the GarbageCollect API

    Yes it is already available in the WIP version. I haven't updated the manual yet though. Here's a small snippet on how I tested it: std::string typeFound; void CircularRefDetected(asITypeInfo *type, const void *obj, void * /* user param */) { if (typeFound != "") typeFound += ","; typeFound += type->GetName(); } bool Test() { bool fail = false; COutStream out; int r; // Test GC callback on detecting circular reference { asIScriptEngine *engine = asCreateScriptEngine(); engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL); engine->SetCircularRefDetectedCallback(CircularRefDetected); asIScriptModule *mod = engine->GetModule("test", asGM_ALWAYS_CREATE); mod->AddScriptSection("test", "class testclass \n" "{ \n" " testclass @next; \n" "} \n" "void main() \n" "{ \n" " testclass a; \n" " @a.next = testclass(); \n" " @a.next.next = @a; \n" "}\n"); r = mod->Build(); if (r < 0) TEST_FAILED; r = ExecuteString(engine, "main()", mod); if (r != asEXECUTION_FINISHED) TEST_FAILED; engine->GarbageCollect(); asUINT currentSize; asUINT totalDestroyed; asUINT totalDetected; engine->GetGCStatistics(&currentSize, &totalDestroyed, &totalDetected); if (currentSize != 0 || totalDestroyed != 2 || totalDetected != 2) TEST_FAILED; if (typeFound != "testclass,testclass") TEST_FAILED; engine->ShutDownAndRelease(); } return fail; }
  12. WitchLord

    Virtual Inheritance

    Registering methods for classes with virtual inheritance isn't supported. This is because the address for calling these cannot be represented on some compilers and is too tricky on others. You'll need wrappers in order to register these. Perhaps the autowrapper add-on works here. I haven't tried it though.
  13. WitchLord

    AngelScript - No Copy Construction for Script Classes

    I've implemented this now so the compiler will properly recognize and use the script class' copy constructor. CreateScriptObjectCopy will also do the same. You can find the changes in revision 2521. Regards, Andreas
  14. Good point. I'll have it updated in the repository too.
  15. WitchLord

    AngelScript - No Copy Construction for Script Classes

    Now it is a known issue. I'll have this fixed. Do you have specific need for this to work? Or are you just worried about the optimization?
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!