i've read around the forums and for several topics similar to this but none quite helped me enough so that i could fix the problem. I'm working on an fps and i animated my gun to give the appearance of walking(by moving it back and forth). I use the code "append object "run", total object frames(1) +1" and when i compile it DBP gives me and error that says,"cannot append to the object at line 26" I dont know why it would say that unless i'm animating wrong, or converting wrong(i animate it in 3ds max and then export it in .3ds format and then convert that to .x using another program)
here's my code...
Rem Project: first fps
Rem Created: 7/7/2005 10:24:07 PM
Rem ***** Main Source File *****
remstart
////////////////////////////////////////
"first fps"
by: gpex
started: 7/07/05, 10:25 p.m.
completed:
////////////////////////////////////////
remend
`sets up the screen
set display mode 1280,1024,32
position camera 0,0,-1000
`loads up the media
load image "floor02.bmp",2
load image "crasshair.bmp",4
load object "tester.x",2
load object "armsandgun.x",1
`heres the append object command!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
append object "run.x",1,total object frames(1) +1
make object triangle 3,0,0,0,0,0,0,0,0,0
make mesh from object 1,3
perform checklist for object limbs 3
limb1# = checklist quantity()
perform checklist for object limbs 1
limb2# = checklist quantity()
limb# = limb1# + limb2#
add limb 3,limb#,1
OFFSET LIMB 3,Limb#,10,0,20
glue object to limb 1,3,limb#
`textures abd positions the media
position object 2,0,-200,90
texture object 2,2
`misc...
hide mouse
`start main loop
do
if object playing(1) then stop object 1
sprite 1,640,512,4
`gets the mousex & y coordinates
lookx# = mousex()
looky# = mousey()
`if mousex moves then increase lookx variable by eight and wrap it to keep it within range
if mousemovex() > 0
inc lookx#
lookx# = wrapvalue(lookx#)
endif
`if mousey moves then increase looky variable by eight and wrap it to keep it within range
if mousemovey() > 0
inc looky#
looky# = wrapvalue(looky#)
endif
strafe1# = lookx# - 90
if keystate(17) = 1 then movez# = newzvalue(movez#,lookx#,-3) : movex# = newxvalue(movex#,lookx#,-3)
if keystate(31) = 1 then movez# = newzvalue(movez#,lookx#,3) : movex# = newxvalue(movex#,lookx#,3)
if keystate(30) = 1 then movez# = newzvalue(movez#,strafe1#,-2) : movex# = newxvalue(movex#,strafe1#,-2)
if keystate(32) = 1 then movez# = newzvalue(movez#,strafe1#,2) : movex# = newxvalue(movex#,strafe1#,2)
if mouseclick() = 1
play object 1
endif
clookx# = lookx# + 180
`update camera
yrotate camera clookx#
xrotate camera looky#
position camera movex#,movey#,movez#
position object 3,movex#,movey#,movez#
yrotate object 3,lookx#
xrotate object 3,-looky#
gunx# = limb position x(3,limb#)
guny# = limb position y(3,limb#)
gunz# = limb position z(3,limb#)
gunz# = gunz# - 5
guny# = guny# - 18
gunx# = gunx# - 15
`update object
position object 1,gunx#,guny#,gunz#
loop
any help would be great.
-gpex-