Jump to content

ZioRed

Members
  • Posts

    1,133
  • Joined

  • Last visited

Posts posted by ZioRed

  1. For the model of FN SPR A4 that you are trying to export in this post, these were the steps I followed to create a fully animated GMF model:

     

    - converted hand JPG to DDS

    - opened the "gun_D" and "hand_tex" DDS with Microsoft DirectX Texture Tool (it is the default DDS viewer tool installed with Microsoft DirectX SDK) to change the surface format to DXT5 and create Mip maps, then I ran the GenMat to create the MAT files and edited them (shader="abstract::mesh_diffuse_bumpmap_skin.vert","abstract::mesh_diffuse.frag" and shadowshader="abstract::mesh_shadow_skin.vert")

    - finally changed the texture maps of the materials in UU3D and saved as GMF

     

    The result was a fully animated GMF model.

  2. Your player model collides with the controller:

    body.SetPosition(playerpos);

    Set the player model to type 0, so it doesn't collide with anything.

    mmh.. didn't work, I tried SetType(0) and SetType(3) (that is no collisions w/ other entities) but the model still seems to collide w/ something (if I comment the SetMass on player controller than the model seems to follow cylindrical collisions). :)

     

    I generally just use LoadMesh() instead of LoadModel() since the character controller is acting as your physics body.

    That works perfectly, I think to use Mesh instead of Model too, thanks. :lol:

  3. The game I'm working on (an RPG) is based on 3rd person camera view, but it seems I'm doing something wrong (in this example I'm using LEO):

     

    // ...
    Controller player;
    player.Create();
    player.SetType(1);
    player.SetMass(1);
    player.SetPosition(Vec3(4.04601192,2.42112565,-16.9856968), GLOBAL);
    player.SetRotation(Vec3(7.50344181,163.239944,-2.95039424), GLOBAL);
    
    Model body("abstract::soldier.gmf");
    body.SetType(1);
    body.SetMass(1);
    body.SetPosition(Vec3(4.04601192,2.42112565,-16.9856968), GLOBAL);
    body.SetRotation(Vec3(7.50344181,163.239944,-2.95039424), GLOBAL);
    
    // ...
    while( !Keyboard::I****(KEY_ESCAPE) && !engine.IsTerminated() ) {
    
    move = KeyDown(KEY_W)-KeyDown(KEY_S);
    strafe = KeyDown(KEY_D)-KeyDown(KEY_A);
    // ...
    player.Update(0.0, move * 2.5, strafe, jump, 500.0f, 1, crouch);
    TVec3 playerpos = player.GetPosition();
    body.SetPosition(playerpos);	
    // ...
    engine.Flip();
    }
    return engine.Free();
    

     

    The problem is that the character model (the soldier) does not move when I press the WASD keys but it's ever moving all around (even if I don't press any key):

     

    I have tried in a fresh project the CreateController example on wiki but it didn't work for me (I'm using LE 2.31), the cylinder didn't move at all.

     

    PS: I don't know if I need a Controller or it's enough simply a Model to position when key pressed (this game will not have a 1st person camera view), I am really newbie both in LE and in game development (I've been a senior "management software" developer till now).

  4. Thank you for reply, I solved just while you were writing the last post only copying shaders.pak and Scripts folder in the compiled directory (I believed that since was declared RegisterAbstractPath thingoid than it was not necessary to copy those files). Now I'm receiving an error "Null framewerk" when hitting ESCAPE to shut down the program, I'll investigate about it (may use the Framework API instead of C [i love OOP and coming from C# :rolleyes: ]), may be it's used inside some lua script of that scene/models.

  5. I am trying to load the tunnels.sbx scene within the sample maps in LE SDK 2.31 and add a TController to navigate throught it, but it happens that the Controller falls down as if the collision between the scene and the controller didn't work. The same happens trying to load every map, both the samples (deserthighway.sbx, terrain_arctic.sbx) and my custom.

     

    As you can see I have set both Collisions and Body Mass on the Controller, the code is the folling:

    Initialize();
    
    RegisterAbstractPath("C:/Leadwerks Engine SDK");
    SetAppTitle( "SceneTest" ) ;
    Graphics( 800, 600 ) ;
    AFilter();
    TFilter();
    
    TWorld	world;
    world = CreateWorld() ;
    if (!world) {
    MessageBoxA(0,"Error","Failed to create world.",0);
    return Terminate();
    }
    
    TBuffer gbuffer = CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
    
    TCamera cam = CreateCamera();
    CameraClearColor(cam,Vec4(0,0,1,1));
    
    TModel scene = LoadScene("abstract::tunnels.sbx");
    EntityType(scene, 2);
    Collisions(1, 2, true);
    
    TController player=CreateController();
    EntityType(player, 1);
    SetBodyMass(player, 1);
    SetBodyDamping(player,0.0);
    SetWorldGravity(Vec3(0,-20,0));
    PositionEntity(player, Vec3(-3.41, 1.78, -4.86));
    
    float move=0.0, strafe=0.0;
    TVec3 camrotation=Vec3(0);
    float mx=0, my=0;
    
    HideMouse();
    MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
    
    // Game loop
    while( !KeyHit() && !AppTerminate() )
    {
    if( !AppSuspended() ) // We are not in focus!
    {
    	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 = 3 * (KeyDown(KEY_W) - KeyDown(KEY_S));
    	strafe = 3 * (KeyDown(KEY_D) - KeyDown(KEY_A));
    
    	//Jumping
    	float jump=0.0;
    	if (KeyHit(KEY_SPACE)) {
    		if (!ControllerAirborne(player)) {
    			jump=4.0;
    		}
    	}
    	//Run
    	if (KeyDown(KEY_LSHIFT)||KeyDown(KEY_RSHIFT)) {
    		if (!ControllerAirborne(player)) {
    			move*=2.0;
    			strafe*=2.0;
    		}
    	}
    
    	UpdateController(player, camrotation.Y, move, strafe, jump, 500.0f);
    
    	// Update timing and world
    	UpdateAppTime();
    	UpdateWorld(AppSpeed()) ;
    
    	//Position the camera
    	TVec3 playerpos=EntityPosition(player);
    	TVec3 camerapos=EntityPosition(cam);
    	camerapos.Y=Curve(playerpos.Y+1.75,camerapos.Y,2.0);
    	camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z);
    	camerapos=Vec3(playerpos.X,camerapos.Y,playerpos.Z);
    	PositionEntity(cam,camerapos);
    
    	// Render
    	SetBuffer(gbuffer);
    	RenderWorld();
    	SetBuffer(BackBuffer());
    	RenderLights(gbuffer);
    
    	// Send to screen
    	Flip(0) ;
    }
    }
    

    Am I forgetting something in the code?

  6. This might be feasible if it is limited to movement/creation/deletion and terrain, and not stuff like undoing the last script change or crazy stuff like that.

    Well, the script editor already has the undo function, so I think there is no reason to undo script changes from the world editor. But undoing world changes that you mentioned (movement/creation/deletion/terrain) should be present.

  7. Hi Masterxilo, thank you for looking at it.. I see your export is correct (excepting the smooth, but it's not important now), my designer is looking for what have you done to correct it (more than removing the turbo smooth)... can you write something to say to it in a "graphicer/designer language"? (lol)

    The correct .MAX file modified should be very helpful too, aside from a description of steps to reproduce the fix (since now we need to export every piece of cloth by our own to understand the process and do some tests on parenting body and clothes in the C++ code).

     

    Thank you yet! ;)

  8. I am experiencing (or better my designers, since I really don't understand graphics and animations at all) hard problems exporting with 3D Max 2009 a character made of a body with clothing pieces skinned and animated. Since I don't understand graphics and animation at this moment (even if I'm trying to study about these arguments, but I am a developer not a designer), my designer has no really experience in game designing so I think he's skipping or doing bad something in the procedure.

     

    The workflow we are following is this:

    1. Open the .MAX file on 3D Studio Max 2009
    2. Click on LEADWERKS TOOLS > EXPORT OBJECTS
    3. Activate the following options: export smoothing groups; export binormals, tangents; write UD properties to meshes; export animation; export skins; exports materials IDs (max ID: 50); export materials (copy textures: replace)
    4. Click export

     

    The result is a file GMF and some files .MAT, but opening the GMF with LE ModelViewer it shows only bones animated and some incorrect spheres, which my designer says to be bones conjunctures which should not be exported.

     

    You may see the bad preview on ModelViewer here and can download the source character here.

     

    I will thank everyone who may download the source and export it (possibly only the body with its bones and animation, without clothes) in the correct format (GMF/MAT) with correct animation and say to me a detailed explanation about how he did it (a video on youtube/vimeo should be very useful), so I can pass the information to my designer who will try to repeat the steps by his own.... I may even pay for this work, since we are working on a game project and absolutely need to understand how we must proceed using 3D Max 2009 and Leadwerks Engine to walk by our feets ;)

     

    Thank you in advance.

×
×
  • Create New...