Jump to content

xtreampb

Members
  • Posts

    321
  • Joined

  • Last visited

Everything posted by xtreampb

  1. xtreampb

    the stack

    I'm trying to do some debugging. When my code goes to the "un-handled exception, press break to debug" message box, it takes me to the utility and vector source code. I know that the bug is in my code, not these classes. So i'm asking how do i use the stack to debug my code. I know i can see what function threw the error, but does it give me any more information like args passed to it? I've never had to use the stack before now so i'm in-experienced in using it to debug software. Thanks ~Xtreampb~
  2. xtreampb

    Timers

    can i get a little more background. I want to try to incorporate this into a class that already has models and such. Is CurrentTime() an LE built-in function? How is update being called
  3. xtreampb

    Timers

    I'm trying to figure out how to create and use a timer. Basically when five seconds pass i want to fire a function. Does anyone have any ideas on how i can do this?
  4. xtreampb

    Happy New Year

    is this going to be done through C++, lua, or both.
  5. xtreampb

    Happy New Year

    LE3 on disk would make leadwerks OFFICIAL One quick question. is there (G)UI building support ((g)ui classes) in LE3
  6. can you provide a link with more details about "tolua++"
  7. i have discovered that programming is a theory and the language we use is just the tool used to apply the theory. I like to create multiple programs, each testing individual components that go into my main application. This helps me cut out all the extra code that can clutter my logic. then go back and clean it up, then finally, copy and paste.
  8. does this mean LE3 will be available to makes games for linux
  9. try this to lessen the code Bool Debug=false; if(KeyHit(KEY_Z)) Debug!=Debug; DebugPhysics(Debug); This should set Debug to what it is not
  10. I want to create a lua script but expose the functions of this script to my C++ game. I am making the UI in lua and want to do something like this KeyHit(KEY_P) { //do lua function calls //int result=luaUIBtnPress(); } I would also like to send what button was pressed in my lua UI back to my C++ function, as shown above. Can anyone guide me on how i can do this or a better way to do this. Or should I just use wxWidgets or another UI library? Thanks ~Xtreampb~
  11. xtreampb

    Progress

    oh oh oh oh super secret special surprise. my guess is LINUX support.
  12. I fixed the issue. I needed to set my block object as a pointer and pass the pointer to the list that stored all my block objects.
  13. my OnColl function is only calling the collision of the last instance of the class that was created. so if one entity collides with another, if another instance of the entity was created after this one, then only the last entity collision function will be called. so another example, object_1 object_2 object_3 was created using class A. rock_1 rock_2 rock_3 was created using class b. when rock_ rock_2 rock_3 collide with object_2, the collisions for object_3 is called and executed. this is done using ricks method. is this happening b/c of polymorphism? i don't see how. anyone got any ideas?
  14. oohhhhh 'super secret special surprise' wonder what makes it 'special'
  15. I posted that b/c i changed it back. I removed the pointers at 'entity0' and 'entity1' and the above line is still throwing the error.
  16. this line throws the error Obj1->OnCall(position, normal, force, speed);
  17. ok so now i can compile, but when a collision occurs i get a read/write errors. I moved the collision into my main C++ file and when i create the objects in my game, i 'link' it to the collision function at the top of the code void _stdcall Coll(TEntity *entity0, TEntity *entity1, byte *position, byte *normal, byte *force, flt speed) { coll *Obj1 = (coll*)GetEntityUserData(*entity0); //coll *Obj2 = (coll*)GetEntityUserData(*entity1); Obj1->OnColl(/*Obj1,*/ position, normal, force, speed); //return 0; } //inside my game function Stone mStone;//derived from coll as you saw earlier.\ SetEntityCallback(mStone.GetFullModel(), (byte*)Coll, ENTITYCALLBACK_COLLISION); thank you all for your help ~Xtreampb~
  18. i'm not quite sure what your asking for so i'll post everything regarding the collisions //collisions class //header file #ifndef _M_COLL_H__ #define _M_COLL_H__ #include "engine.h" class coll { public: virtual void OnColl(coll *obj, byte* position, byte* normal, byte* force, flt speed) ; }; #endif //cpp file #include "Collisions.h" void coll::OnColl(coll *obj, byte* position, byte* normal, byte* force, flt speed) { } //Stone class //header file #ifndef _M_STONE__H_ #define _M_STONE__H_ #include "engine.h" #include "Collisions.h" class Stone : public coll { private: TModel Full; public: Stone();//constructor ~Stone();//destructor virtual void OnColl(coll* ColObj, byte* position, byte* normal, byte* force, flt speed); }; #endif //#ifndef _M_STONE__H_ //CPP file Stone::Stone() { this->Full=LoadModel("stone//stone_1.gmf"); EntityType(this->Full, 1); SetBodyMass(this->Full, 1); //so that we can pass the model to the collision function. we pass the model to cast it to coll type SetEntityUserData(this->Full, (byte*)this); SetEntityCallback(this->Full, (byte*)this->OnColl, ENTITYCALLBACK_COLLISION); } void Stone::OnColl(coll* ColObj, byte* position, byte* normal, byte* force, flt speed) { this->Destroy();//function call to run my collision information already set aside so that this collision testing can be easily tested } I've had this issue for the longest time, just didn't know where to turn to get help. Thanks ~xtreampb~
  19. so what is the difference between the virtual polymorphism and just having each model in a class, each with it's own collision function. I don't see the need to use polymorphism here. I also get this error Error 1 error C2440: 'type cast' : cannot convert from 'void (__thiscall Stone::* )(coll *,byte *,byte *,byte *,LE::flt)' to 'byte *' c:\Documents and Settings\Chris\My Documents\Visual Studio 2008\Projects\Castle Defense\Castle Defense\Stone.cpp 40 //the line the error occurs in is here SetEntityCallback(this->Full, (byte*)OnColl, ENTITYCALLBACK_COLLISION); //this->Full is a TModel, OnColl is my collision function name
  20. i know this is rather old, but rick can i see a quick example snippet. I think it would help everyone here to see this as an example.
  21. this link has a lot of tutorials for LE2. The one you are looking for is the tutorial "Camera Controls". I would recommend reading the PDF instead of watching the video, but that is my preference. http://www.leadwerks.com/wiki/index.php?title=Main_Page I would also recommend bookmarking this link. Good luck to you ~Xtreampb~
  22. glad you know that. something similar to OSX and iOS how the .app is actually an organized folder with a os recognized extension with everything in a particular place.
  23. ok so i'm using the "ForEachEntityDo((byte*)mFunc);" however, this doesn't execute if(KeyHit(KEY_SPACE)) { DropBox(box); if(EntityExists(ground)) FreeEntity(ground);//this doesnt execute here else goto CreateGround; } if i comment out the ForEachEntityDo call it works no problem. i've tried commenting out what the called function does to where it is an empty function and still the same result. Any help would be appriciated. This is just me messing with the engine so no real importance to where this has to work. just learning atm. Thanks ~Xtreampb~
  24. Hey all, I'll tell you what i'm trying to do. When a body gets below a certin y value i want to remove it. However, i have multiple bodies falling at once. How would i determine if a random body has fallen past lets say -5. I don't know the object in the code, it is a random object so i can use a specific 'box3.getpos().gety'. I need to use a more generic form of code. so that if any body falls, i can catch it. I could use another 'ground' that has collisions type of 2. But i don't know how do use the collisions callback functions. Do anyone else have an idea, and/or can some one show me how to set up the collisions callback? Thanks ~Xtreampb~
×
×
  • Create New...