ok heres some snippets from my code i believe are of suspicion. im using the advanced terrain from demo 9 i believe, i finally got everything working, but my box is just bouncing like crazy and i cant make it act like a human would. psionics dwarf model is going to replace the box btw. ok please help me, maybe some anti depressants will help my box?
CODE SNIPPETS:
these are some of the globals in order
REM NEWTON GLOBALS
GLOBAL nBody
GLOBAL nStatic
REM CALL PREPERATION ROUTINES HERE
GOSUB prepareNewton
NDB_SetVector 0, -50, 0
NDB_SetStandardGravity
my object creation code for the one thats on crack
`make a temporary player object
REM CREATE NEWTON OBJECTS HERE
`BOX OBJECT
player = free_object()
make object box player, 5,5,5
position object player, 250, 17, 250
color object player, rgb(100,10,10)
`obj = object number, mass=2.0, effected by gravity and buoyancy,defaultmat
newtonCollisionForBox(player, 2000.0, 1, 1, nMatDefault)
REM TREE COLLISION
col = NDB_NewtonCreateTreeCollision( 101, 1 )
Body = NDB_NewtonCreateBody ( col )
heres the camera movement code for my box in full, its in a function
Ctrl_Plr_and_Cam:
`get keyboard input for movement
NDB_SetVector 1, 0.0, 5.0, 0.0
NDB_SetVector 2, 0.0, 0.0, 10.0
NDB_BodyAddForceLocal player
if scancode()=17 then NDB_BodyAddForceLocal player
NDB_SetVector 1, 0.0, -5.0, 0.0
NDB_SetVector 2, 0.0, 0.0, -10.0
NDB_BodyAddForceLocal player
if scancode()=31 then NDB_BodyaddForceLocal player
` Camera/mouse movement
ya1#=ya1#+mousemovex()*0.1
ya1#=wrapvalue(ya1#)
x1#=object position x(player)
y1#=object position y(player)
z1#=object position z(player)
`Manual camera movement contraols (A and D)
if scancode()=30 then ay1#=wrapvalue(ay1#+2)
if scancode()=32 then ay1#=wrapvalue(ay1#-2)
set camera to follow x1#,y1#,z1#,ay1#,15,7,10,1
rotate object player,0,ya1#,0
return
im really proud of that code snippet just above, it works really good and not to pat myself on the back but i haven't really seen any camera movement i like better.
but thats not the point... anywho you see ive called some subroutines and functions, these are the ones from cucumbers newton tutorial found here,
http://forum.thegamecreators.com/?m=forum_view&t=55741&b=6&p=0
if thats the problem (which it very well may be) please alert me.
thanks for your time, im actually kind of relieved my first forum go to on this project is actually for a somewhat humorous looking problem, i wish you guys could see this hahaha.