Jump to content

ZeroByte

Members
  • Posts

    99
  • Joined

  • Last visited

Posts posted by ZeroByte

  1. I think ground units need to have good abilities for taking out vehicles to balance things out. Rocket Launchers etc.

     

    I agree with Rick on this, oh, and this is a great idea Josh.

     

    Also, don't forget about Grenades.. :)

  2. Hi, i created C++ VS2008 Console, with Framewerk project type, but these lines are confusing me.

     

     

    
    // Create framewerk object and set it to a global object so other scripts can access it        
    Framewerk fw;
    if( !fw.Create() )        
    {
    ErrOut( "Failed to initialize engine." );
    return 1;        
    }        
    
    // Note! Lua is not supported when using Framewerk      
    
    

     

    It says to "Create framewerk object and set it to a global object so other scripts can access it"

     

    but then it says, "Note! Lua is not supported when using Framewerk".

     

    So, Lua is not supported when using Framewerk ?

  3. Hi, here is a LEO vehicle example, if anyone is interested:

     

    
    #include "leo.h"
    
    using namespace LEO ;
    
    float steerangle=0.0;
    
    int main( int argn, char* argv[] )
    {
    Engine engine( "leocar", 1280, 800 ) ;
    Engine::SetAbstractPath( "C:/Leadwerks Engine SDK" ) ;
    Engine::SetFilters() ;
    
    World world( CREATENOW ) ;
    if( !world.IsValid() ) 
    {
    	MessageBoxA(0,"Error","Failed to create world.",MB_OK);
    	return engine.Free() ;
    }
    
    Buffer gbuffer( Engine::GetWidth(), Engine::GetHeight() );
    
    Camera camera( CREATENOW );
    camera.SetPosition( 0, 0, -10 );
    
    Material material("abstract::cement_asphaltscales-01_df_.mat") ;
    
    //DebugPhysics();
    
    DirectionalLight light( CREATENOW ) ;
    light.SetRotation( 45 , 45, 45 );
    
    SetWorldGravity(Vec3(0, -20, 0));
    LEO::Collisions::Set(1,1,SLIDINGCOLLISION);
    
    // Vehicle
    Model chassis;
    chassis.Load("abstract::impreza.gmf", 0); 
    chassis.SetType(1);
    chassis.SetMass(10);
    
    Mesh tire[4];
    tire[0].Load("abstract::vehicle_monstertruck_tire_left.gmf", 0);
    tire[1].Load("abstract::vehicle_monstertruck_tire_right.gmf", 0);
    tire[2].Load("abstract::vehicle_monstertruck_tire_left.gmf", 0);
    tire[3].Load("abstract::vehicle_monstertruck_tire_right.gmf", 0);
    
    RotateMesh(tire[0],Vec3(0,0,90));
       RotateMesh(tire[1],Vec3(0,0,90));
       RotateMesh(tire[2],Vec3(0,0,90));
       RotateMesh(tire[3],Vec3(0,0,90));
    
    Vehicle veh;
    veh.Create(chassis);
    
    veh.AddTire(Vec3(-1.4,0,1.4),0.5,1.0,80,200);
    veh.AddTire(Vec3(1.4,0,1.4),0.5,1.0,80,200);
    veh.AddTire(Vec3(-1.4,0,-1.4),0.5,1.0,80,200);
    veh.AddTire(Vec3(1.4,0,-1.4),0.5,1.0,80,200);
    
    BodyBox groundbody( 100, 1, 100 ) ;
    Cube ground( CREATENOW ) ;
    ground.SetScale( 100, 1, 100 );
    groundbody.SetParent( ground ) ;
    ground.SetPosition( 0, -3, 0 );
    ground.Paint( material ) ;
    groundbody.SetType(1);
    
    // Game loop
    while( !Keyboard::I****() && !Engine::IsTerminated() )
    {
    	if( !Engine::IsSuspended() ) 
    	{
    
    		// Steering
    		if (KeyDown(KEY_LEFT) && (steerangle<=40.0f)) {
    			steerangle+=1.0f;
    			SetSteerAngle(veh, steerangle, 0);
    			SetSteerAngle(veh, steerangle, 1); }
    
    		if (KeyDown(KEY_RIGHT) && (steerangle>=-40.0f)) {
    			steerangle-=1.0f;
    			SetSteerAngle(veh, steerangle, 0);
    			SetSteerAngle(veh, steerangle, 1); }
    
    		// Torque
    		AddTireTorque(veh, 0, -1);
    		if (KeyDown(KEY_UP)) AddTireTorque(veh, 10, -1); 
    		if (KeyDown(KEY_DOWN)) AddTireTorque(veh, -10, -1); 
    
    		if (KeyDown(KEY_SPACE)) AddBodyForce(chassis, Vec3(0,200,0), 1); // Lift car
    
    		SetEntityMatrix(tire[0],veh.GetTireMatrix(0));
               SetEntityMatrix(tire[1],veh.GetTireMatrix(1));
               SetEntityMatrix(tire[2],veh.GetTireMatrix(2));
               SetEntityMatrix(tire[3],veh.GetTireMatrix(3));
    
    		Engine::UpdateTime();
    		World::Update( Engine::GetSpeed()) ;
    
    		gbuffer.Set();
    		World::Render() ;
    		Engine::GetBackBuffer().Set() ;
    		World::RenderLights(gbuffer);
    
    		Engine::Flip() ;
    	}
    }
    
    return engine.Free() ;
    }
    
    

     

    I used the monstertruck tires from LE 2.3 SDK, because i can't get the

     

    wheel textures to show up on the car wheels. :)

     

    I removed the engine.dll, newton.dll, and shaders.pak from release dir.

     

    And i removed the engine.cpp, and leo.cpp from the project.

     

    Link to leocar.zip project: http://66.244.240.14/

     

    Link isn't always up.

  4. Do you guy's know if this will work with LEO in c++.

     

    I just started using LEO, and i'm not sure if LEO needs

     

    to be updated also, or if it can be ported to LEO ?

     

    It's working great with C though, just not sure how to set it up in LEO.

     

    Thank's for any info.

  5. Hey Rick, haven't had time for LE lately, here is my c++ source: http://66.244.240.14/ link should be working.

     

    i removed engine.cpp, layer.cpp, leo.cpp, mathlib.cpp, renderer.cpp.

     

    Also deleted, engine.dll, jointlibrary.dll, newton.dll, shaders.pak.

     

    Just ignore the xbox 360 gamepad input code, it's set to mouse input anyway.

     

    I noticed if i attach a Pi-ThirdPersonCamera to the monster truck, it doesn't fall through the terrain.

     

    Just the character, so it must be something stupid i'm doing wrong, or i'm not using c++ properly with Lua.

     

    I didn't include my map, it's just a flat surface, with Pi-ThirdPersonCamera, Pi-CharacterKeyboardControls, and character, or monster truck.

     

    Anyway thank's for your help, sorry took so long to post back.

  6. I was assigning an entity type to the terrain, now that you mentioned the editor does it, i removed this line

     

    EntityType(scene,2);

     

    and my character controller in my c++ app still work's fine just using this line of code

     

    LEO::Collisions::Set(1,1,SLIDINGCOLLISION);

     

    Yes, other models collide with my terrain in my c++ app.

     

    I'll keep testing different settings, i'm new to Lua scripting, but i can see it's a great addition to LWE.

  7. Hi Rick, thank's for trying to help, i tried your suggestions, still falls through terrain, it work's fine in the editor though.

     

    So, i guess it's cause i'm trying to get it to run from my c++ app.

     

    There must be a way to run game scripts from c++, but Josh commented these functions out in c++ headers.

     

    //inline TScript LoadScript(str filename)
    //{
    //	return leLoadScript(filename);
    //}
    
    //inline void RunScript(TScript script, BP funcname, BP object)
    //{
    //	leRunScript(script, funcname, object);
    //}
    
    //inline void FreeScript(TScript script)
    //{
    //	leFreeScript(script);
    //}
    

     

    Are the thingoids just meant to run with Lua only ?

     

    Well thank's again for your help.

  8. Ok, i attatched the Pi-ThirdPersonCamera to my Pi-Character with Pi-CharacterKeyboardControls in the editor, and when i run this code from my c++ app,

     

    if (LEO::Keyboard::I****(KEY_G)) {

    SetGlobalString("mode", "GAME_MODE");

    SetGlobalString("quit", "false");

    }

     

    it switches to the third person cam on my character.

     

    So, i think i'm on the right track, just have to find why my character controller is falling through the terrain.

  9. Thank's Niosop, i think your right, i tried adding these lines

     

    SetGlobalString("mode", "DESIGN_MODE");

    SetGlobalString("quit", "false");

     

    to my c++ app, it compiled ok but didn't make it work when it was executed.

     

    I'll keep trying stuff, thank's again.

  10. Hi Rick, great job on these Thingoids, but i have a question.

     

    I can get this to work in the Editor, but how do i get it to work in my c++ app?

     

    Example, if i drag the Windmill into my map, then run my c++ app, i can see it spinning and squeaking, but the character i setup in the Editor doesn't move, just in the Editor..

     

    Thank's for any tips, sorry if this is a dumb question.

×
×
  • Create New...