Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / My code isn't working.

Author
Message
Bloder
18
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 28th Dec 2007 22:30
I was trying to make an action game and i copied a code from the "How to make a 3d character walk" tutorial. I changed the name of the object to make it one of my own that I created in ac3d. Now here's the strange bit. Before, with their object it worked but with mine, it compiles fine but when I go to test it it says "The file on line 6 does not exist" or something like that anyway. Here's my web adress. http://wizardgang.googlepages.com/home
here's my code:
rem Position camera off center
POSITION CAMERA 0.0,0.0,-1000.0

rem Load 3D object and append walking data to it
LOAD OBJECT "Samuel Ki.x",1 : APPEND OBJECT "walk.x",1,100
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1

rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,10

rem Activate manual syncronization
SYNC ON

rem Begin loop
DO

rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-8.0
IF RIGHTKEY()=1 THEN a#=a#+8.0
a#=wrapvalue(a#)

rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,3) : z#=NEWZVALUE(z#,a#,3) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-3) : z#=NEWZVALUE(z#,a#,-3) : stage=1

rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,40
ENDIF
oldstage=stage
ENDIF

rem Update character position and angle
POSITION OBJECT 1,x#,0.0,z#
YROTATE OBJECT 1,a#

rem Refresh screen
SYNC

rem End loop
LOOP

http://wizardgang.googlepages.com/home
Bloder
18
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 28th Dec 2007 22:34
Here's the message: Runtime Error on line 6. File does not exist.

My file does exist!!!!!!!!!
manta01
17
Years of Service
User Offline
Joined: 20th Dec 2007
Location:
Posted: 29th Dec 2007 03:06
You need to place your objects in the directory where your code is. This is a common mistake I make alot too.
Thats probably the case, Since line 6 is your call to the files

Signature? Signature? we dont need no stupid Signatures.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 29th Dec 2007 10:10 Edited at: 29th Dec 2007 10:12
You load the object "samuel ki.x" right?
Now try not to append the object "walk.x". Now, it probably works, right?

If that`s the case, then your problem is clear:

You made the object "samuel ki.x" with ac3d, but you didn`t make the object "walk.x" with ac3d. When you append objects, they have to have the same amount of limbs, which isn`t the case here. If they did have the same amount of limbs, your object would look like the original object from the example when you walk.

To change it, you have to make an animation of your "samuel ki.x" with ac3d and call it "samuel walk.x" or something, so you have 2 objects identical, only one walks and the other one doesn`t move at all.

If thats not your problem, then write back. I`m free to help.


ps: You can highlight your code part of the post and click the button on the left at the top "code". Then it looks like this:




Oooooops!!! I accidentally formated drive c.
Bloder
18
Years of Service
User Offline
Joined: 24th Feb 2007
Location: Cyberspace
Posted: 29th Dec 2007 11:28
Thanks a lot! I'm going to animate my model now. I'll send you a picture of him.

Login to post a reply

Server time is: 2025-06-02 09:44:02
Your offset time is: 2025-06-02 09:44:02