• Content count

  • Joined

  • Last visited

Community Reputation

174 Neutral

About Miss

  • Rank

Personal Information


  • Twitter
  • Github
  1. AngelScript 2.32.0 is out

    This is perfect! Thanks for the big update!
  2. 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.
  3. 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!
  4. 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.
  5. 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.
  6. This is great news! Going to experiment with this a bit this weekend, will report back if there's any problems.
  7. 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!
  8. 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!
  9. ARM questions

    Thanks for the help. I've switched to using 32 bit for now, especially since the platform I'm building for doesn't necessarily need a 64 bit build. The assembly file does compile and link on clang 32 bit, but I have yet to run it to see if it actually works.
  10. ARM questions

    So, I have a few questions about the ARM support in Angelscript. 1. Can I use as_callfunc_arm_gcc.S with clang, or is this specifically for gcc? 2. My compiler is complaining about casting a 64 bit void* to asDWORD in as_callfunc_arm.cpp, on lines like these, where secondObject is a void*. Can I ignore this as just a warning instead, or is that unsafe? paramBuffer[dpos++] = (asDWORD)secondObject; Thanks!
  11. Global Operator

    Wait, how does your first snippet work as a global Angelscript function? You're not specifying the type for the right hand side. Did you actually mean the use RegisterObjectMethod for that? I'm a bit confused at what your exact problem is now, but it looks like you have both set up while your scripts are actually only using 1 of those definitions (the RegisterObjectMethod one).
  12. Global Operator

    You might be able to point to the global function directly using asCALL_CDECL_OBJFIRST or asCALL_CDECL_OBJLAST actually, if you don't want to use a wrapper function.
  13. Global Operator

    I'm not sure why the operator needs to be a global? You use opMul as a method function and opMul_r as the reverse (a * b and b * a). For example: Obj opMul(const Obj &in rightHandSide) Obj opMul_r(const Obj &in leftHandSide) In the first, the object itself is the left hand side, and on the second it's the right hand side.
  14. Hey all! Thought I'd make a thread here about the tool I've been working on for the last few days: asdbg. It's a remote debugger (as in it uses for IPC for the moment) with a visual code view. It's not much and probably not really usable for any serious project right now, but I'm hoping to some day get it there and use this for debugging our game (and future ones :)). It consists out of 2 parts, the host implementation code and the UI, so in theory it should be possible to implement the UI in something other than Windows (this is currently in C# WinForms, so it's Windows only for the time being). Feedback is always welcome!
  15. Edit: Nevermind this post, this was already solved in the WIP version that we haven't applied yet. See this code: class Banana { Banana() { print("Banana ctor.."); } } class Foo { Foo() { Banana(); } void Banana() { print("Banana!"); } } class Bar : Foo { Bar() { super(); } void Banana() override { /* INFO : Compiling void Bar::Banana() ERR : Identifier 'Banana' is not a data type in namespace 'Foo' or parent ERR : A cast operator has one argument ERR : Identifier 'Banana' is not a data type in namespace 'Foo' or parent */ Foo::Banana(); } } The errors are on Foo::Banana(). Changing the name of Foo::Banana and Bar::Banana do something else is the workaround for this. I feel like I've reported a similar issue in the past which was fixed, but not sure where that thread is now. This is on the latest 2.31.2 version. (I haven't tried the latest WIP yet.) Also, isn't the call to Banana() in the Foo ctor abiguous between Foo::Banana and Banana's ctor? Edit: Actually, it seems like this exact issue was the one I reported earlier, and was fixed: Perhaps this wasn't in 2.31.2 yet, and I'm just pointlessly double-reporting this.. I'm going to try the WIP verison, apologies!