• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

174 Neutral

About Miss

  • Rank

Personal Information


  • Twitter
  • Github
  1. Remote visual debugger: asdbg

    Little update on this, I've decided to continue working on this a bit. A few new features, as you can now see breakpoints at the bottom as well as the callstack. It's not super stable yet, but I did get it running on our game. (We were setting the asEP_BUILD_WITHOUT_LINE_CUES property for performance, which messed up a few things. asdbg will now warn you when this property is set.)
  2. Perhaps in that case it would be better to set a callback function on the context for other caught exceptions not of this hypothetical asIException type. Additionally, if your AS bindings are wrapper functions, you can always catch any exceptions in there and pass them along to the context, eg: static void ScriptDoSomething() { try { SomeLibrary::DoSomething(); } catch (const std::exception &ex) { asGetActiveContext()->SetException(ex.what()); } }
  3. Angelscript doesn't really use STL that extensively, so it doesn't make much sense to me to catch a std::exception. Why not catch/handle some kind of asIException type or so? (Which could then potentially also be implemented into the scripting itself!)
  4. It depends on whether there's much overhead I guess, I'm fine with an option to disable this optimization manually if it's that much of an overhead.
  5. This is more of a question than a bug, I think, but perhaps there could be some flag to work around this. If I registered a declaration like this: MwArray<T> &Remove(int index) It will be able to resolve the "T" type here if I do something like this: asIScriptEngine* engine = gen->GetEngine(); int typeId = gen->GetObjectTypeId(); asITypeInfo* type = engine->GetTypeInfoById(typeId); int subTypeId = type->GetSubTypeId(); asITypeInfo* subType = engine->GetTypeInfoById(subTypeId); But if my declaration doesn't include my template type "T", it will not be resolvable (the subType's name will simply be "T"): void Remove(int index) Is there a way to force it to resolve the subtype correctly in the latter case without needlessly returning itself? (It's a viable workaround for me for now, but would be nice to not have to do this.)
  6. Hi, I just found this piece of code in the scriptstdstring addon: // WinCE doesn't have setlocale. Some quick testing on my current platform // still manages to parse the numbers such as "3.14" even if the decimal for the // locale is ",". #if !defined(_WIN32_WCE) && !defined(ANDROID) && !defined(__psp2__) // Set the locale to C so that we are guaranteed to parse the float value correctly char *orig = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, "C"); #endif double res = strtod(val.c_str(), &end); #if !defined(_WIN32_WCE) && !defined(ANDROID) && !defined(__psp2__) // Restore the locale setlocale(LC_NUMERIC, orig); #endif But, this seems to be invalid code, since the second setlocale call will invalidate the first "orig" pointer, as described on MSDN: https://msdn.microsoft.com/en-us/library/x99tb11d.aspx
  7. implementing partial templates

    Not entirely sure what you mean, but generic types are already possible (they're called sub-types in Angelscript). Good example is the scriptarray addon, which registers an array<T>.
  8. AngelScript 2.32.0 is out

    This is perfect! Thanks for the big update!
  9. Take the follwing example: class Foo { } class Bar : Foo { void Test() { print("Test was called"); } } void BugTest() { ref@ x = Foo(); Bar@ y = cast<Bar>(x); if (y is null) print("y is null, as expected"); else { print("y is not null, calling Test() now:"); y.Test(); } } Here, the explicit cast to Bar should return null as expected, but it doesn't, because it only checks whether the types are derived from each other. Calling y.Test() can even cause a crash here. If you explicitly cast the ref to Foo first before casting that to Bar, it will return null properly.
  10. Yes! I managed to resolve my problems. It was mostly just due to a lack of documentation on asIStringFactory, I suppose.. Thanks for the explanation of GetRawStringData, too!
  11. So, a couple things I'm having issues with: https://pastebin.com/PTbBrZqg It is reporting some weird new unexpected constant strings: [ ScriptEngine] New string constant: "€¼¦" @ 1EA6BE80 ... [ ScriptEngine] New string constant: "Tooltip: "" @ 1EA6C120 [ ScriptEngine] New string constant: ": "" @ 1EA6C0A0 [ ScriptEngine] New string constant: " (" @ 1EA6C040 [ ScriptEngine] New string constant: " ¾¦" @ 1EA6C100 [ ScriptEngine] New string constant: " ¿" @ 1EA6BF30 [ ScriptEngine] New string constant: " ¿¦" @ 1EA6C2D0 [ ScriptEngine] New string constant: "P¿¦" @ 1EA6C310 [ ScriptEngine] New string constant: "ÀÀ¦" @ 1EA6C230 ... [ ScriptEngine] New string constant: "Game Scene" @ 1EA6C280 [ ScriptEngine] New string constant: "˜ï" @ 1EA6C130 [ ScriptEngine] New string constant: "п" @ 1EA6C290 No string is now being destroyed, but when my scripts start executing code related to strings, it does a string copy constructor and passes an invalid reference to copy from. The (invalid) pointer is not a constant string located in my log, so I'm not sure where it's coming from or why it's invalid. I'm going to try to track this down where in the scripts it's coming from. Edit: The weird issues were caused by me being tired. Of course. I was returning a pointer to my string cache pair instead of the actual string object itself. Fixing this also made those weird string constants disappear.
  12. So I'm a bit confused at how to use this. I've looked at the existing ScriptStdString to find how to properly use this for my own string class, but I'm not certain I'm doing it right. I assume I have to allocate a new string and cache it in GetStringConstant, and then free the memory in ReleaseStringConstant, but only if it's cached? (And then uncache it) However, with the way I currently have this implemented, the script engine ends up trying to construct a string with a freed pointer (which according to my logfile was released in ReleaseStringConstant already). So I shouldn't free the memory in ReleaseStringConstant? If not, then where is the appropriate place to free the memory? I can't really figure this part out by lookng at ScriptStdString. Also, I'm still unsure of the purpose of GetRawStringData. Here is my string factory class: https://pastebin.com/YpyQP3P8 Edit: I'm an idiot and I only just realized this is a refcount, not an immediate allocate/free thing. I'm still having some troubles though, and I still am not sure what GetRawStringData is used for.
  13. This is great news! Going to experiment with this a bit this weekend, will report back if there's any problems.
  14. Remote visual debugger: asdbg

    Unfortunately not, I haven't gotten much time to work on it lately. I was also facing some strange issues when trying to use this in our game so it's definitely still not perfect either. Lots of work to be done on this, but it's a start!
  15. Angelscript on Github!

    Good news everyone! AngelScript support has been merged into Linguist: https://github.com/github/linguist/pull/3844 That means that Github will finally be able to recognize Angelscript files as Angelscript instead of Actionscript!
  • Advertisement