2 registered members (TipmyPip, 1 invisible),
18,699
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267782
05/26/09 08:29
05/26/09 08:29
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
put the line reset(player,POLYGON); into the tanks main action, just before its while loop.
Also, turn off (temporarily) any shaders the tank may be using.
4600 polies isnt very big... Roughly how big is the MDL file itself? 1 meg, 5 meg, 25 meg, 50meg, etc.
Maybe its got a loose un-attached vertex somewhere below ground level... Run it, hit F11 twice and look at the Blue bounding-box. Does it penetrate the ground by much ?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Pointer troubles: Need Help
[Re: EvilSOB]
#267792
05/26/09 09:29
05/26/09 09:29
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
OP
Member
|
OP
Member
Joined: May 2009
Posts: 258
Chicago
|
It's roughly 20mb.
I tried placing it inside of a big cube, and making it passable, and even invisible, and still had the same problem.
My modeler told me he wasn't done with the model, and that it has some unfinished faces. I'm not sure if that could be the root of this problem. Doesn't seem like it should be.
Maybe the model is scaled too small? I really can't think of much on this one...
EDIT:
No, I take that back. The cube really wasn't working right. It looks like it's the terrain or something. I've never seen this happen on any other level/project. It's starting to annoy me, lol.
Last edited by Jaeger; 05/26/09 10:14.
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267803
05/26/09 10:52
05/26/09 10:52
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
OP
Member
|
OP
Member
Joined: May 2009
Posts: 258
Chicago
|
No, it's not the level, and not the model. So that leaves one culprit. The code. I made a simple "ground" out of a block in WED, and applied default texture. Then I put a regular old cube in as an entity, and made a bare bones action for it using the following:
#include<default.c>
#include<acknex.h>
var cam_distance = -300;
ENTITY* tank_box;
VECTOR NULLVECTOR;
VECTOR vAhead;
vAhead.y = 0;
vAhead.x = 0;
VECTOR torque;
torque.x = 0;
torque.y = 0;
action tank_controls()
{
player = me;
c_setminmax(me);
phent_settype(my,PH_RIGID,PH_BOX);
phent_setmass(my,100,PH_BOX);
phent_setfriction(my,77);
phent_setelasticity(my,1,25);
phent_setdamping(my,7,100);
phent_setgroup(me,2);
while(1)
{
camera.x = player.x + cam_distance * cos (camera.pan) * cos (camera.tilt);
camera.y = player.y + cam_distance * sin (camera.pan) * cos (camera.tilt);
camera.z = player.z + 50 * cos (camera.tilt);
camera.tilt = player.tilt;
camera.pan = player.pan;
while(key_cuu || key_cud)
{
vec_set(vAhead,vector((key_cuu-key_cud)*50000,0,0)); //feed keyboard into engine.
vec_rotate(vAhead, player.pan); //rotates by pan,tilt,roll ALL at the same time...
phent_addforcelocal(player,vAhead,NULLVECTOR,my.x); // Now apply physics force in the directions it is facing....
camera.x = player.x + cam_distance * cos (camera.pan) * cos (camera.tilt);
camera.y = player.y + cam_distance * sin (camera.pan) * cos (camera.tilt);
camera.z = player.z + 10 * cos (camera.tilt);
camera.tilt = player.tilt;
camera.pan = player.pan;
if(!key_cul || !key_cur)
{
torque.z = (key_cul - key_cur) * 50;
phent_addtorquelocal(player,torque);
}
wait(1);
}
if(!key_cul || !key_cur)
{
torque.z = (key_cul - key_cur) * 50;
phent_addtorquelocal(player,torque);
}
wait(1);
}
}
function main()
{
video_mode = 8;
shadow_stencil= ON;
video_screen = 1;
mouse_mode = 0;
wait(1);
fps_min = 30;
fps_max = 120;
//load level "Das Sandbox"...
level_load("whywontwork.wmb");
wait(2);
// Gravity
//ph_setgravity(vector(0,0,-500));
wait(2);
// Create sky
ent_createlayer("skycube+6.tga", SKY | CUBE | VISIBLE, 0); // Create a black backdrop for the level.
wait(2);
// create player/tank entity
//tank_box = ent_create("tankbox.mdl", vector(-225,-848,700), tank_controls);
wait(3);
wait(1);
}
Still having the same problem. It won't allow movement unless you're going parallel to the world's x or y axis. I have no idea why. Tried removing gravity, friction, damping, everything. No luck. And I don't understand how the same concept works to shoot bullets in the right direction, but won't work to just push around a simple cube. Extremely frustrating. I hope someone will try the test I did and see if you have any luck. Thanks for everything, guys!
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267930
05/26/09 21:47
05/26/09 21:47
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK, Im back and ready to test.
But I need to know scales...
What size is the tank approx. Length/width/height in quants. How big is your level/terrain/groundplane. Length/width in quants.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Pointer troubles: Need Help
[Re: EvilSOB]
#267948
05/27/09 00:07
05/27/09 00:07
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
OP
Member
|
OP
Member
Joined: May 2009
Posts: 258
Chicago
|
Ok, I'm back now too. I've tried several scales. Most recently, I just tried gigantic scale. What I'm seeing is that there is actually nothing blocking the movement. The forces I'm applying are not in the proper direction. The forces are going in some wacky directions. I was able to move the huge block in any direction, just never the direction I intended, lol. SO it appears the problem is lying in vector rotate, or something similar. I also tried doing away with the "player" pointer, and just using me/my. Didn't seem to make a difference.
The giant scale I'm using now is a flat level block that's 4x4 in the largest grid squares in WED, and the cube I'm pushing around is approx 125x75 quants. But I've even tried tiny scale, and medium scale. So I really think the problem is that force is applied in the wrong direction, or maybe to wrong point of the cube. When I use torque to spin it around, I can move in all kinds of directions. Just never the right one, heheh.
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267949
05/27/09 00:12
05/27/09 00:12
|
Joined: May 2009
Posts: 258 Chicago
Jaeger
OP
Member
|
OP
Member
Joined: May 2009
Posts: 258
Chicago
|
By George, I think I've got it! 
vec_set(vAhead,vector((key_cuu-key_cud)*50000,0,0)); //feed keyboard into engine.
phent_addforcelocal(me,vAhead,NULLVECTOR,my.pan); // Now apply physics force in the directions it is facing....
Lol, I also noticed in the above code I posted, I was using if(!key_cul | !key_cur) for torque, instead of the normal way. Ironically, that actually works, because pressing one key turns its value to 1, thus causing the torque vector to become a positive or negative integer.  But I am going to fix that. Just thought it was funny that I did the torque wrong, yet it still worked.
Last edited by Jaeger; 05/27/09 00:24.
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267951
05/27/09 00:27
05/27/09 00:27
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Ive just discovered you should be able to use phent_addcentralforce (me, vAhead); instead of phent_addforcelocal(me,vAhead,NULLVECTOR,my.pan); I dont see how its working, because, from the manual, phent_addforcelocal only has THREE parameters phent_addforcelocal(ENTITY* entity,VECTOR* vForce,VECTOR* vPos ); and yours has four !?! Can you, just for my sanity, please try vec_set(vAhead,vector((key_cuu-key_cud)*50000,0,0)); //feed keyboard into engine.
vec_rotate(vAhead, my.pan); //rotate force to face tank direction
phent_addcentralforce(me, vAhead); // Now apply physics force in the directions it is facing....
Please?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Pointer troubles: Need Help
[Re: Jaeger]
#267956
05/27/09 00:59
05/27/09 00:59
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Me too. I would test your code myself now, and I will do later. But because Im at work, and GAME codeing isnt my job, I cant test anything with any significant graphical displays, as I am surrounded by hawk-like eyes, monitoring the TYPE of work I am currently doing....
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|