Jump to content

Controller


MrIslomaniac
 Share

Recommended Posts

did you set your model to scene?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

You have to set your models collision parameter in the editor as in the picture above .. double click the model in the scene and then under the physics tab set that model to "scene". Then save the scene.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

no, its not necessary. Hae you tried using game mode in the editor to walk on the model ?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Not much else I can suggest without the model, more information or example project.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

So the player will collide with the model when you postion it at/on the model, which suggests its a postioning error when you do that with code. The height issue with the controller is probably due to the changes of the position of the origin of the controller, when did you last update? check the fpscontroller.lua (Leadwerks SDK\scripts\games\) has this line:

 

--Position camera
camera:SetPositionf(controller.position.x,controller.position.y+1.7,controller.position.z,1)

 

The origin of the controller was moved from the centre to the bottom so you need to have the camera height set right.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Should do, make sure you position the controller over/at the model .. otherwise it has nothing to stand on.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

if you mean the starting height value for the position of the controler then you use PostionEntity as above the Vec3 is three values for that postion Vec3(x,y,z) ... the value for y (5.0 as above) sets the height.

 

Hello,

The changing co-ordinates PositionEntity only changes the place of start of my controller. But i want to do tall controller. I think that my controller is creeping. When i change co-ordinates and run the program, controller begin in high and then it returns...

Link to comment
Share on other sites

Sounds like you need to set the camera postion attched to the controller, try adding 1 to the value.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

post your code and I will take a look.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

#include "engine.h"

 

 

 

int main(int argc, char** argv)

{

 

Initialize();

RegisterAbstractPath("C:\Program Files");

 

//Create a graphics context

 

Graphics(800,600);

 

//Create a world

 

if (!CreateWorld()) {

MessageBoxA(0,"Error","Failed to create world.",0);

goto exitapp;

}

 

 

//Create a camera

TEntity cam=CreateCamera();

CameraClearColor(cam,Vec4(0,0,1,1));

PositionEntity(cam,Vec3(0,2,-10));

 

 

//Load a model

TModel scene=LoadModel("abstract::test2_estafet-1.gmf");

if (scene==0) {

MessageBoxA(0,"Error","Failed to load model.",0);

goto exitapp;

}

 

//ScaleEntity (scene, Vec3(10,10,10));

EntityType(scene,2);

//Create a light

 

TLight light=CreateDirectionalLight();

RotateEntity(light,Vec3(45,45,0));

 

//Create a render buffer

TBuffer buffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);

 

TController player=CreateController();

PositionEntity(player, Vec3(100.0, 100.0, 100.0));

EntityType(player,1);

SetBodyDamping(player,0.0);

SetBodyMass(player,1);

SetWorldGravity(Vec3(0,-20,0));

 

Collisions(1,2,true);

float move=0.0;

float strafe=0.0;

TVec3 camrotation=Vec3(0);

float mx=0;

float my=0;

 

HideMouse();

MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);

 

//Main loop

while(!KeyHit(KEY_ESCAPE)) {

 

//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(cam,camrotation);

 

//Player movement

move=KeyDown(KEY_W)-KeyDown(KEY_S);

strafe=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;

}

}

 

//Set controller input

UpdateController(player,camrotation.Y,move*20,strafe*20,jump,500.0f);

 

//Update the world

UpdateWorld();

 

//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);

PositionEntity(cam,camerapos);

 

//Render the scene

SetBuffer(buffer);

RenderWorld();

 

//Render lighting

SetBuffer(BackBuffer());

RenderLights(buffer);

 

//Swap the front and back buffer

Flip();

}

 

exitapp:

return Terminate();

}

Link to comment
Share on other sites

So what exactly is it NOT doing?

 

This line sets the controllers height, here example 2.0

 

TController player=CreateController(2.0); 

 

This sets the Cameras height, here example Y+1.75

 

camerapos.Y=Curve(playerpos.Y+1.75,camerapos.Y,2.0); 

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

you are better off using framework. Then simply place an atmosphere in your scene in the editor.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

There is, can you elaborate?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

really? thats elaboration?

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Details ..

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...