Jump to content

Carve

Members
  • Posts

    33
  • Joined

  • Last visited

Posts posted by Carve

  1. I have some hosting ideas for distribution;

     

    1) Torrents

    2) FTP type connection (similar to how Leadwerks SDK installs, with a key system)

    3) Buy a cheap but reliable seeder box - coincides with #1.

    4) I have some webhosting through the company I work for, can provide at-least 1 mirror, possibly 2.

  2. I have quite a few Vegetation models (trees, grass, bushes, rocks, etc) first question is:

     

    How do I add the basic lua script that will allow the basic dialog for snapping to terrain, material, etc?

     

    Second question is:

     

    How do I add things to the Vegetation Painting? Like how there is a Tree and Grass, how would I do so for my models?

  3. Yes the tutorial reads the player from the map as far as I remember (don't rely on me for this :)) but I found that you should use the info_playerstart model (or better .lua) which is inside the archive attached to the tutorial, before I had some issues with the one downloaded from the download section of this site (don't remember exactly what).

     

    Thanks ZioRed!

     

    I totally overlooked the custom playerstart! That was my problem all along heh :P

  4. It really sounds like you don't have a model for the player in Editor, or it doesn't have a mass.

    But since your description is so vague, I think you need to post a minimized demo to show the problem.

     

    What portion of the "Power Tutorial" adds a model for the player? Afaik it's using the info_playerstart?

  5. Yes, but what exactly does not work? Is it not moving, is it not compiling, or what? Make sure you have a body mass for your player also.

    Why are you creating the player, if it's already in the sbx file?

    You should need only one SetCurrentPlayer().

    The Power Tutorial should work.

     

     

    It is not moving, like at all.. I can move the mouse and zoom in/out just fine. When trying to set the "pistol" to the player it crashes, so for now that is disabled.

     

    I've removed the player creation, and removed the secondary SetCurrentPlayer portion. Still behaving the same way, no movement, except for the camera/mouse.

  6. It should work, I haven't noticed any problems with it. What exactly does not work?

     

    pre-main loop:

    	mPlayer.Create();
    mGame.scene.SetCurrentPlayer("info_playerstart");
    mGame.scene.SetCurrentPlayer("player1");

    main loop:

    		mGame.MouseLook(mGame.scene.cam);
    	mGame.KeyboardMove("player1");
    	mGame.PositionPlayerModel("player1");
    	mGame.PositionCamera();

     

    all this works , except the KeyboardMove("player1");

  7. Somehow you managed to upload all the files which you don't need to upload and forgot the files which you should upload, like the exe, sln, suo, vcproj, cpp. The exe alone would be enough, since then I can see if it works for me.

     

    DOH! Forgot the exe indeed, sorry about that!

     

    Attached now.

    FPS-Debug.exe

  8. Editor doesn't use engine.dll, although it uses the same engine code. Maybe you should post a demo of your problem.

     

    Here ya go, I didn't use anything but what came with LW SDK (2.4.0).

     

    - Put the FPS.zip contents in your Leadwerks SDK root folder (you have the .dll's i'm sure, so dont write over!)

     

    I attached the testMap as well - it needs to go in /Maps

     

    Thanks again Lumooja

    testMap.zip

  9. The Scripts folder needs only to be in the current working dir, the dlls need to be in the exe dir or in the path, shaders.pak and other asset folders needs to be in the abstract path.

     

    That's how it is setup, and I still get none of the Terrain loading, this is quite strange..

     

    I'm using 2.4, would that matter?

  10. Does any folder besides the Scripts folder (and the dll's / paks (shaders) obviously) need to be in the application.exe's ROOT folder as well?

     

    Like Models / Materials, should they be copied over as well, or shouldn't the abstract path to c:/leadwerks take care of that?

  11. You don't need mScene, as it's already part of mGame. And you don't need mBuffer either.

     

    I dropped those already, and cleaned the code up more. I removed mBuffer and mScene.

     

    also I removed the DrawText for FPS, and it removes the overlay for FPS (You referred to it as another render) - So now it shows the FPS and Tris correctly.

     

    Still the same issue though.. the terrain and everything is black, this is never ending!

  12. Your picture of the "in editor" view shows your player start ... the blue icon? if thats it then why is your in app picture showing what it does? are you sure your controller is being placed at the player start position? it does not look like it and given the view of the in app shot are you sure your controlloer is not below the terrain? are you still using the same code as posted or have you changed it?

     

    I have the code for the PlayerStart portion, but I am using hardcoded variables for the time being

     

     

    The FPS display in the screenshot says that you are using Framework also. So you are rendering the scene twice, and your own rendering fails because Framework has already rendered it.

     

    Could you explain further?

     

    New Code (now using Gamelib)

    #include <Main.h>
    
    int main()
    {
       if (!Initialize())
           return 1;
    
       mGame.Initialize(1024, 768, 0, 0, 0);
       mScene.Initialize();
    
       SetAppTitle("FPS v0.0.1 - using gamelib v" gamelibver);
       RegisterAbstractPath("C:/Leadwerks");
    
       mBuffer = CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
       // Setup Cameras
       if (mCamera != NULL)
       {
           mCamera = mGame.scene.cam;
       }
       else
       {
           mCamera = CreateCamera();
       }
    
       PositionEntity(mCamera, Vec3(-3, 2, -18));
    
    //    mMiniMapCam = CreateCamera();
    
       // Load Sandbox Scene
       mScene.LoadMap("abstract::testMap.sbx");
       AppLog("Loaded scene..");
    
       // Setup the mouse
       HideMouse();
       MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2);
    
       //mMiniMap.CreateMinimap(128); // Create the Minimap
    
       // ** Game loop ***********************************************
       while( !KeyHit() && !AppTerminate() )
       {
           if( !AppSuspended() ) // We are not in focus!
           {
               mGame.scene.Update(); // Update
    
               mGame.scene.Render(); // Render
    
               // Rendering of the 2D stuff
               mGame.DrawCrosshair(GraphicsWidth() / 2, GraphicsHeight() / 2);
               DrawText(0, 0, "FPS : %.3f", UPS());
               DrawText(0,15, "Tris: %d", TrisRendered());
    
               // Render Minimap
               //mMiniMap.Update(mMiniMapCam); // Update the Minimap
    
               // Send to screen
               Flip(0);
           }
       }
    
       // Done
       return Terminate();
    }
    

  13. Do you have all the terrain textures in your project?

     

    Yes in the Abstract Path they are located, same paths as the Editor uses are used by the Application.

     

    Do I need to copy more then the Scripts folder to the Application.exe Root?

  14. Instead of hardcoding the player position in your code, you should find a player entity from the map and position your player there.

    Basically FindChild(scene,"playerstart"); is enough.

     

    I've tried what you suggested, added a playerstart to the scene, and then use the position of it.

     

    The test scene I made now loads, but I can only see the Firepit, no textures for the ground and if i attempt to move I fall.

    Why would the ground be black?

  15. I can load the demo scene "tunnels" just fine, but when trying to load any of the other scenes it seems to just stay black?

     

    I have tried using different camera + player positions, and everything, the only one that I can get working is the tunnels.sbx

     

    I renamed this to testScene.sbx and it still works fine, creating a new scene, then adding a 128x128 or w/e size terrain, painting the terrain, adding a camera, and light.. then saving the scene as testSceneTwo.sbx ..

     

    There is nothing in the logs to suggest anything went wrong, and it acts as if it's loaded everything correctly.

     

    Code below:

    #include <Main.h>
    
    int WINAPI WinMain( HINSTANCE hInstance,
    			   HINSTANCE hPrevInstance,
    			   LPSTR lpCmdLine,
    			   int nShowCmd ) 
    {
    Initialize() ;
    RegisterAbstractPath("C:/Leadwerks");
    SetAppTitle( "Test FPS" );
    Graphics( 1024, 768 );
    AFilter();
    TFilter();
    
    mWorld = CreateWorld();
    if (!mWorld) {
    	MessageBoxA(0,"Error","Failed to create mWorld.",0);
    	return Terminate();
    }
    
    mBuffer = CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
    // Setup Cameras
    mCamera = CreateCamera();
    PositionEntity(mCamera, Vec3(-3, 2, -18));
    
    Collisions(1,2,true);
    
    //	mMiniMapCam = CreateCamera();
    
    // Load Sandbox Scene
    mScene = LoadScene("abstract::testScene.sbx");
    MessageBoxA(0,"Loaded scene..","",0);
    ProcessScene(mScene);
    
    // Setup the spectator (player)
    mPlayer = CreateController(1.8,0.4,0.5,45.01);
    EntityType(mPlayer, 1);
    SetBodyMass(mPlayer, 1);
    PositionEntity(mPlayer, Vec3(-3, 2, -18));
    
    float move=0.0;
    float strafe=0.0;
    TVec3 camrotation=Vec3(0);
    float mx=0;
    float my=0;
    
    // Setup the mouse
    HideMouse();
    MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2);
    
    //	mMiniMap.CreateMinimap(128); // Create the Minimap
    
    // ** Game loop ***********************************************
    while( !KeyHit() && !AppTerminate() )
    {
    	if( !AppSuspended() ) // We are not in focus!
    	{
    		// camera looking
    		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(mCamera, camrotation);
    
    		// player movement
    		move=(KeyDown(KEY_W)-KeyDown(KEY_S))*2.0;
    		strafe=(KeyDown(KEY_D)-KeyDown(KEY_A))*2.0;
    
    		// player jump
    		float jump=0.0;
    		if (KeyHit(KEY_SPACE)) {
    			if (!ControllerAirborne(mPlayer)) {
    				jump=4.0;
    			}
    		}
    
    		// player run
    		if (KeyDown(KEY_LSHIFT)||KeyDown(KEY_RSHIFT)) {
    			if (!ControllerAirborne(mPlayer)) {
    				move*=2.0;
    				strafe*=2.0;
    			}
    		}
    
    		// Set controller input
    		UpdateController(mPlayer, camrotation.Y, move, strafe, jump);
    
    		// Update timing and mWorld
    		UpdateAppTime();
    		UpdateWorld(AppSpeed()) ;
    
    		// Position the camera
    		TVec3 playerpos = EntityPosition(mPlayer);
    		TVec3 camerapos = EntityPosition(mCamera);
    		camerapos.Y = Curve(playerpos.Y+1.75*0.5, camerapos.Y,2.0);
    		camerapos = Vec3(playerpos.X, camerapos.Y, playerpos.Z);
    		PositionEntity(mCamera, camerapos);
    
    		// Render Main
    		SetBuffer(mBuffer);
    		RenderWorld();
    
    		// Render lightning
    		SetBuffer(BackBuffer());
    		RenderLights(mBuffer);
    
    		// Render Minimap
    		//mMiniMap.Update(mMiniMapCam); // Update the Minimap
    
    		// Send to screen
    		Flip(0) ;
    	}
    }
    
    // Done
    return Terminate() ;
    }
    

     

    Thanks ahead of time!

×
×
  • Create New...