ZeroByte
-
Posts
99 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by ZeroByte
-
-
Thank's for explaining that Lumooja, i was having problems, but it's ok after i did clean 2.3.1 install.
Oh, and great job on Project Wizard Roland.
-
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 ?
-
You will need the recompiled engine.dll Josh posted on this thread.
-
I forgot the cement_asphaltscales-01_df_.mat file,
but you can just add your own texture.
-
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.
-
Ok, thank's Josh, i'll try setting it up in LEO then.
-
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.
-
Ok, thank's Lumooja, good to know.
-
Yes, thank's for that sample Josh.
-
Lumooja your code work's, just change:
AddVehicleTire(veh,Vec3(-1,-1,0));
to
AddVehicleTire(veh,Vec3(-1,-1,0), 0.5, 0.3, 45.0, 100.0);
-
Wow, thank's for recompiled DLL Josh, that was fast.
And, thank's for the help Lumooja, i'm gonna go try this.
-
Awesome, thank's for posting bug report.
Lol, yea a bug fix day.
-
Oh ok, do you know if Josh is going to fix this ?
I've been trying to get vehicles going for awhile now,
and i'd prefer to use c/c++ for vehicles.
Thank's.
-
Thank's for that info Lumooja, i'll try to alter the header to return TTire then.
-
Hi BigB,
i can't get the vehicle to work in c/c++ either, look's like you are running into the same problems as me.
Try changing
EntityType(chasis,2);
to
EntityType(chasis,1);
The last working vehicle example in C, was in LE 2.24 it can be found here:
http://forum.leadwerks.com/viewtopic.php?f=2&t=3761&p=33322&hilit=vehicle#p33322
It was ported to C API by pushedx, maybe it will help you.
-
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.
-
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.
-
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.
-
That video was cool, can't wait to try this.
thank's Niosop
-
Also, if i run this code,
if (LEO::Keyboard::I****(KEY_Q)) {
SetGlobalString("mode", "DESIGN_MODE");
SetGlobalString("quit", "true");
}
it switches back to my other character controller.
-
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.
-
Ok i put
SetGlobalString("mode", "DESIGN_MODE");
by mistake, changed it to
SetGlobalString("mode", "GAME_MODE");
but when that is executed, the character just disappears, still trying.
-
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.
-
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.
Leadwerks Wars
in General Discussion
Posted
I agree with Rick on this, oh, and this is a great idea Josh.
Also, don't forget about Grenades..