Maega

Members
  • Content count

    2944
  • Joined

  • Last visited

Community Reputation

707 Good

About Maega

  • Rank
    Contributor
  1. Should I give up?

    [quote name='azonicrider' timestamp='1349195588' post='4986091'] So in other words, there would be less steps for getting a C game to work, than getting a Java game to work. [/quote] Not always. There are tradeoffs. Java, for example, will support any system that has a JVM. So your software will be cross platform pretty easily. Native apps don't have that same luxury. If you're trying to do cross platform development, you're going to have different steps on each platform.
  2. Should I give up?

    [quote name='azonicrider' timestamp='1349143049' post='4985926'] How come I can run C and C++ programs without installing anything, yet when I run a program written in Java or Ruby, I need to install the compilers for those languages? http://en.wikipedia....mming_language) [/quote] C and C++ are natively compiled. Generally, the shared runtime libraries are already installed by default. Ruby and Java are interpreted languages. They require an interpreter to run programs. (Yes, Java is interpreted by the JVM)
  3. Web Browser Assistance

    I converted to be Mac centric last year, so I tend to use the Mac version of Chrome for my general browsing. When I'm at work, I'll use Firefox because Firebug is awesome and the dev tools in Chrome/Safari suck in my opinion. I'm doing more with HTML5/CSS3, so Webkit is important there.
  4. I didn't see anyone post this blog post, but it does give a nice overview of the browser problem. Zero or Five?
  5. The Snow is Piling Up

    Yep.. this is the most snow I've had since moving to an area where it snows normally.
  6. Keep script running

    Just one
  7. Keep script running

    Hello, Final question for quite a while I hope. Is there a way to keep the objects created in a script persistent until the application closes? I can see that as soon as the script ends, the objects are destroyed. What I want to do is have Angelscript handle my GUI. As you've seen with my other posts, the script handles the creation of the objects. My intention is to have the GUI actions described in the same script. So as of now, the script runs, ends, and everything is cleaned up. Which is great if that is what you want, but I don't :). Any suggestions? Is it nothing more than changing the way the C++ object is registered?
  8. Few more problems

    Weird. I did a recompile a few times without changing anything and now it doesn't crash. That's really strange.
  9. Few more problems

    Quote:Original post by WitchLord I still don't see anything wrong. I wrote a small test based on your information and it works without crashing. *** Source Snippet Removed *** Are you sure the problem is with this method, and not something else? Well, I'm not sure. If I remove the call to that function in the script, it doesn't fail.
  10. Few more problems

    Quote:Original post by WitchLord I don't see anything wrong with this. I need more information to discover the cause for the crash. How is this function called from the script? blah.BuildButton("Test", 0, 0, 100, 100, "test"); Quote:And how is the CEngine type registered with the engine? HWND g_Window; static void Constructor(void *memory) { new(memory) CEngine(g_Window); } static void Destructor(CEngine *p) { p->~CEngine(); } CLoad::CLoad(HWND win) { ostringstream errorMessage; engine = asCreateScriptEngine(ANGELSCRIPT_VERSION); int r = engine->SetMessageCallback(asMETHOD(CLoad, GetScriptError), this, asCALL_THISCALL); assert( r >= 0 ); RegisterScriptString(engine); r = engine->RegisterObjectType("CEngine", sizeof(CEngine), asOBJ_VALUE | asOBJ_APP_CLASS_CDA); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("CEngine", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(Constructor), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectBehaviour("CEngine", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(Destructor), asCALL_CDECL_OBJLAST); assert(r >= 0); r = engine->RegisterObjectMethod("CEngine", "void ShowMessage(string &in)", asMETHOD(CEngine, ShowMessage), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectMethod("CEngine", "void FindText(string &in)", asMETHOD(CEngine, FindText), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectMethod("CEngine", "void BuildButton(string &in, int, int, int, int, string &in)", asMETHOD(CEngine, BuildButton), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectMethod("CEngine", "void LoadExtension(string &in)", asMETHOD(CEngine, Extension), asCALL_THISCALL); assert( r >= 0 ); g_Window = win;
  11. Few more problems

    r = engine->RegisterObjectMethod("CEngine", "void BuildButton(string &in, int, int, int, int, string &in)", asMETHOD(CEngine, BuildButton), asCALL_THISCALL); assert( r >= 0 ); void CEngine::BuildButton(string& caption, int x, int y, int width, int height, string& function) { CButton *button = new CButton(); button->id = rand(); button->function = function; button->window = CreateWindowExA(0, "BUTTON", caption.c_str(), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD, x, y, width, height, window, (HMENU)button->id, NULL, NULL); bList.push_back(button); } I also put a MessageBox call in there to easily trace whether or not it even got called. The box never showed, so I assume it doesn't actually get into the function.
  12. Few more problems

    Is there a chart that states what corresponds to what C++ types are in Angelscript? I'm trying to register a function with ints this time and it's crashing again. I see the chart in the manual, but I tried what was there and I still crash.
  13. Few more problems

    Ok. That makes sense. Thanks. I'll try that :).
  14. Few more problems

    Quote:Original post by WitchLord Usually these kind of crashes happen when you're not registering the types or functions correctly. When you're registering the functions you're telling AngelScript how the application works with these functions. If you get something wrong in the registration then AngelScript will call the function incorrectly, which can lead to memory violations and stack corruptions, eventually crashing the application. Can you show us how you're registering this class method and it's implementation? Also how are you registering the string type? Are you using the CScriptString add-on or are you registering your own string type? I am using the addon. How I am registering them is the same way you saw in my registration problem post. I might have left one out, but the one crashing right off the bat is "FindText" r = engine->RegisterObjectMethod("CEngine", "void FindText(string &in)", asMETHOD(CEngine, FindText), asCALL_THISCALL); assert( r >= 0 ); Both are the same signature. ShowMessage(std::string) FindText(std::string)
  15. Few more problems

    Hello. It's me again :). Now that I've cleared up the earlier problems thanks to WitchLord's wonderful help, I have a few more problems. Two of them may be linked, but I'm not sure. One of the class methods I registered causes things to crash right away. I'm not sure why. It's a function that works when used by the class itself external to scripting. It is passed a std::string. Another function will execute, but the string that is supposed to be passed to it from the script doesn't come through. It gets displayed as a square block. After this function is called, I get an immediate crash. If I take this call out and the script is basically empty, no crash occurs. It just calls MessageBoxA This may be something I'm doing. I'm not sure.