Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

207 Neutral

About DJLink

  • Rank

Personal Information


  • Twitter
  1. DJLink

    How to instantiate classes in script?

    Thanks for the help. I think I got most of the basis cover now. I've now able to allocate objects and used them via script :)
  2. DJLink

    How to instantiate classes in script?

    Ahh cool, it actually worked, I can now allocated and delete objects via script.   From what I'm getting I cannot have the same class registered as asOBJ_VALUE and asOBJ_REF, correct me if I'm wrong.   I was trying to add some flexibility. Right now I can allocate object using that example you gave like this Sprite@ spr = Sprite(); // Do something But I would also like to be able to do Sprite spr; // local var // do something But when I try to register as  engine->RegisterObjectType("Sprite", 0, asOBJ_VALUE | asOBJ_REF| asOBJ_NOCOUNT); I get the following error    Failed in call to function 'RegisterObjectType' with 'Sprite' (Code: -5) 
  3. Hi guys, I'm sorry if this is a dumb question but I'm kind of new using AS.   So I have a class in C++ called Sprite with a method set_image(string, string)   I've registered them this way //register class engine->RegisterObjectType("Sprite", sizeof(Sprite), asOBJ_VALUE | asOBJ_POD); // Register method engine->RegisterObjectMethod("Sprite", "void set_image(const string sheet, const string image)", asMETHODPR(Sprite,set_image,(const string&, const string&),void), asCALL_THISCALL); But now I can I use that in the script side?   I would assume something like  Sprite@ sp = new Sprite(); // Not sure if @ or *, confusion here sp->set_image("backgrounds","space"); // is it a -> or . for handles? After reading some docs on Angescript I found out the @ for object handles, but still, how do I allocate a new Sprite to use in script? Do I need to create a static function that returns a handle in C++?   Once again thanks for reading this.
  4. DJLink

    RegisterObjectMethod help

    I'm not an expert on AngelScript but looking at your code it looks like this like might be the problem RegisterObjectMethod("TransformObject", "Vector4 GetPostion() const", asMETHOD(TransformObject, GetPosition), asCALL_THISCALL); ASSERT(r>=0, "Error"); Look at the name of the function "GetPostion", it's a typo, should be "GetPosition"
  5. I'm actually using SDL for window construction. I just thought that by adding the icon to Visual Studio it would be set for both the taskbar and the window title
  6. Hi there. So I added an icon to my C++ application on Visual Studio by adding an Icon to the Resources. And it worked, but only for the taskbar, not on the window itself. Not really sure why. [attachment=11316:icon.png]
  7. Hi there, So the title pretty much says it all. I've been using Visual Studio 2010 to make this game in C++/Opengl. If the game crashes while I'm debugging well I can see the problem, but what I would like is to know if there is a way to output the stacktrace to a file when the game crashes. I've seen some game that I play doing that so it's probably possible. I just don't know how. Also something that could be somewhat portable would be nice if possible. Cheers.
  8. Thank you rip-off and Brother Bob for the explanation. It really helped
  9. Hi everyone. So I never noticed this until today. I usually declare something like: typedef enum { Action_IDLE = 0, Action_BORED = 1, Action_WALK = 2 }Object_Action; And I can do this Object_Action action = Action_IDLE; Looking at "Class View" in Visual Studio I noticed that instead of the list having the name "Object_Action" it's named as "__unnamed_enum_012b_1" . But if I declare it like typedef enum Object_Action <- notice the diference { Action_IDLE = 0, Action_BORED = 1, Action_WALK = 2 }Object_Action; The name is displayed properly and they both compile. So what's the difference then? From a logical point of view. Thanks
  10. DJLink

    Dary's Legend

    Thanks! =)
  11. DJLink

    Dary's Legend

    Hi everyone. Just wanted to give a glimpse of this new game that we at Different Pixel have been working for the past 4 months, Dary's Legend. It's a roguelike dungeon crawler type of game. The official website is Thanks for reading. [attachment=7965:dary_screenshots1.png] [attachment=7966:dary_screenshots2.png] [attachment=7967:dary_screenshots3.png] [attachment=7968:dary_screenshots4.png]
  12. Hum...I'm creating the context using SDL so I'm kind of lost on how to assure that, maybe I'll check on an SDL specific forum. Thanks
  13. Hi there. I'm having this weird problem. I've been working on some 2d soft shadows. It works ok on several ATI cards, tested on 4 different models so far. But on NVIDIA (3 different models) it behaves differently So first here's the problem [attachment=7917:problem_ati_nvidia.png] Here's how I'm doing it //BeginDraw // // accumulate lighting in a texture // glClearColor(0.1f,0.1f,0.1f,0.0f); // Set viewport to texture size glViewport(0,0,512,512); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //loop all lights glColorMask(false, false, false, true); glClear(GL_COLOR_BUFFER_BIT); // write shadow volumes to alpha glBlendFunc(GL_ONE, GL_ONE); glDisable(GL_TEXTURE_2D); // Here I draw all the shadows projections for (bsSize b = 0; b<_lightBlockers.size(); ++b) { renderShadow(light, _lightBlockers); } //// draw light glColorMask(true, true, true, false); glEnable(GL_BLEND); glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE); // <--- I think this might be the problem // Switching to glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); results in the image below this code // I draw a quad with the light texture //end loop lights // // copy lighting into a texture // glBindTexture(GL_TEXTURE_2D, texID); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 0, 0, 512, 512, 0); // apply lighting by rending light texture on top // glBlendFunc(GL_DST_COLOR, GL_ZERO); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,texID); // Simple quad drawing with the texture However, switching to glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE); to glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_ONE); gives me the same result on both cards, but obviously I don't want that effect, it's ugly [attachment=7918:problem_ati_nvidia2.png] Can anyone help me out? Thanks
  14. DJLink

    Uniform variable arrays

    Well, if you want to access it like center.x, center.y, you should sent it using glUniform3i(locUniform, testUniform[0], testUniform[1], testUniform[2]);
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!