Jump to content

cassius

Members
  • Posts

    2,834
  • Joined

  • Last visited

Everything posted by cassius

  1. When I use left shift to make my player move faster a dialog pops up asking me if I want sticky keys. I always click on no, but it stops my game. I am now using right mouse button in place of left shift which solves the problem, but is there a way to stop this dialog appearing? ( win 7)
  2. I just come back to c++ after a long time away and I am making all sort of stupid syntax errors. The error messages are not very helpfull, I keep getting " if has not been declared in this scope" error.It turned out to be my typing vec3 instead of Vec3.
  3. Thanks. That didn't work at first, but now it does. Must have been some other cause.
  4. Hi How do I get full sreen display in c? InBmax its graphics( 800,600,32)
  5. A lot of the stuff I have seen elsewhere is described as medieval when in fact it is English elizibethan style, which is more recent than true medieval times. Your stuff looks more like the real thing.
  6. I don't think the welsh would be too pleased to hear that it is in England
  7. Thanks all. I got it working. I neededed to rotate the character itself with camrotation.I'm having fun with this c++ language. I have the program running in both codeblocks and vc+= express.In terms of framerate there is not much difference but codeblocks is a bit more user friendly. EDIT: I didnt use EntityParent as a lot of people say it can cause probs. I had already seen ballgame its good but does not use framework.
  8. A problem I found is that the character ( now visible in front of the camera) is rotang as Irotate the mouse.
  9. Hi After some time using Bmax I have moved to c++ and codeblocks. I have a first person loader up and running and now want to convert it to third person. So whats the best approach? Should I try to move the player forward and parent the character to it or should I create a new body in front of the player?
  10. I agree with gamecreator. We have had more than a fair deal in the past. Looking forward to first release beta or not.
  11. cassius

    This code

    Is this code still required when using framework? UpdateAppTime() UpdateWorld(AppSpeed())
  12. Its ok I got it figured.
  13. Thanks mac. I get an error on the line PositionEntity (player,vec3(0,1.8,0)); The error reads Tvec3 not declared in this scope. Can someone show me how it should be done.
  14. There is a problem here with player height. It is too low. I tried using a cylinder but then the player would not move at all.Also it slows down too slowly acting more like a vehicle than a human.Any help????? #include "engine.h" int main(int argc, char** argv) { Initialize(); RegisterAbstractPath("C:/mygame"); Graphics(1100,800); AFilter() ; TFilter() ; TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); TCamera cam=GetLayerCamera(layer); PositionEntity(cam,Vec3(0,0,0)); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); // Setup Initial Post Processing FX //SetGodRays(1); SetHDR(0); SetSSAO(0); SetBloom(1); SetAntialias(0); SetStats(1); LoadScene("abstract::game03map.sbx"); SetSkybox(LoadMaterial("abstract::NiceSky.mat")); SetBackgroundColor(Vec4(1 ,1, 1, 1)); DebugPhysics(true); // Setup player TBody player=CreateBodySphere(); SetBodyMass(player,60); SetBodyGravityMode(player,1); SetBodyDamping(player,0); EntityType(player,1); SetBodyBuoyancyMode(player,1); PositionEntity(player,Vec3(-3.18,1.07,-40.67)); Collisions(1,1,1); TVec3 camrotation=Vec3(0); float mx=0; float my=0; float move=0; float strafe=0; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); // MAIN LOOP while (!KeyHit(KEY_ESCAPE)) { //UpdateAppTime() ; UpdateWorld(AppSpeed()) ; mx=Curve(MouseX()-GraphicsWidth()/2,mx,6); my=Curve(MouseY()-GraphicsHeight()/2,my,6); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation.X=camrotation.X+my/10.0; camrotation.Y=camrotation.Y-mx/10.0; RotateEntity(cam,camrotation); move=KeyDown(KEY_W)-KeyDown(KEY_S); strafe=KeyDown(KEY_D)-KeyDown(KEY_A); TVec3 force = Vec3(strafe*10.0,0,move*30.0); force=TFormVector(force,cam,0); AddBodyForce(player,force); PositionEntity(cam,EntityPosition(player)); // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } return Terminate(); }
  15. Thanks Roland. Thanks for all answers.
  16. Thanks. Do you know where I can find Rolands scene loader example.? I have searched the forum but can only find old stuff some of which was posted cos it contains errors.
  17. How is "StringToVec3" expressed in c++?
  18. Thanks Roland I will try that code tonight. I am trying c++ so I can use any examples that come with leadwerks 3d.I havn't used the language since I used c++builder 3 some years ago. I am having the usual noob problems with curly brackets and sem colons etc but its slowly coming back to me.
  19. I tried to translate this code from Bmax into codeblocks. It loads the scene but nothing moves can anyone see why? It complains about setstats which I commented out. // ==================================================================== // This file was generated by LEBuilder // http://leadwerks.com/werkspace // ==================================================================== #include "engine.h" #include <iostream> #include <string> const int ScreenWidth = 1200; const int ScreenHeight = 900; const char* MediaDir = "C:/mygame"; const char* AppTitle = "game"; TEntity scene; TController player; //Setup the player movement variables. float move = 0.0 ; float strafe = 0.0 ; TVec3 camrotation = Vec3(0); float mx = 0.0 ; float my = 0.0; float jump = 0.0; float camy = 0.0; float camz = 0.0; void ErrOut( const std::string& message ) { std::cerr << message << std::endl; } // ------------------------------- int main( int argn, char* argv[] ) { if( !Initialize() ) return 1; // Set graphics mode SetAppTitle( AppTitle ) ; if( !Graphics(ScreenWidth,ScreenHeight) ) { ErrOut( "Failed to set graphics mode." ); return 1; } RegisterAbstractPath( MediaDir ); // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if( fw == NULL ) { ErrOut( "Failed to initialize engine." ); return 1; } AFilter(4); TFilter(1); // Set Lua framework object SetGlobalObject( "fw", fw ); // Set Lua framework variable BP lua = GetLuaState(); lua_pushobject( lua, fw ); lua_setglobal( lua, "fw" ); lua_pop( lua, 1 ); // Get framework main camera TCamera camera = GetLayerCamera( GetFrameworkLayer(0) ); PositionEntity( camera, Vec3(3.18,0.2,41.86) ); scene = LoadScene("abstract::game03map.sbx"); //fw.SetStats(1) ; //Create the controller player=CreateController(2.0); PositionEntity(player,EntityPosition(camera)); EntityType(player, 1); SetBodyMass(player, 60.0); Collisions(1, 1, 1); // Skybox SetSkybox(LoadMaterial("abstract::NiceSky.mat")); SetBackgroundColor(Vec4(1 ,1, 1, 1)); HideMouse(); while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) { UpdateAppTime(); UpdateWorld(AppSpeed()); PositionEntity(player,EntityPosition(camera)); mx = Curve(MouseX() - GraphicsWidth() / 2, mx, 6) ; my = Curve(MouseY() - GraphicsHeight() / 2, my, 6); MoveMouse(GraphicsWidth() / 2, GraphicsHeight() / 2) ; camrotation.X = camrotation.X + my / 10.0; camrotation.Y = camrotation.Y - mx / 10.0 ; RotateEntity(fw.Main.camera, camrotation); move = KeyDown(KEY_W) - KeyDown(KEY_S) ; strafe = KeyDown(KEY_D) - KeyDown(KEY_A) ; jump = 0.0; // If (KeyHit(KEY_SPACE) & ! ControllerAirborne(player) ) //jump = 4.0; If (KeyDown(KEY_LSHIFT) ) { move = move * 3.0 ; strafe = strafe * 3.0 ; } PositionEntity(fw.Main.camera, Vec3(player.position.x, player.position.y + 0.8, player.position.z)) ; camy = 0.5 ; If (MouseZ()>0) FlushMouse(); } If (MouseZ()=0) { camy = 0.0 ; camz = Curve(MouseZ(), camz, 10) ; } MoveEntity(fw.Main.camera, Vec3(0,camy,camz)) ; UpdateController(player, camrotation.Y, move * 3, strafe * 3, jump, 500) ; UpdateFramework(); RenderFramework(); Flip( 0 ); } } return Terminate();
  20. I don't think it will support any terain initialy.Hope I am wrong.
  21. Just having a go at c++. I need to know how to refer to a model placed in the editor by its name in its properties. I intend to use a switch statement to get at them all. I can do it in Bmax but not c++. Any help much apreciated. .
  22. When running the ball game in codeblocks I get 2 errors but the program still runs ok. They appear to be variable outside scope errors.Strange?
  23. I already used le builder. I have got the spinning cube and the ball game running fine. just needed to find the class wizard plugin.
×
×
  • Create New...