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.

Newcomers DBPro Corner / .x file loads but no animation

Author
Message
Zazen
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location: J_ville Flusa
Posted: 26th Jun 2004 19:43
Hi everyone! I'm new to this forum & new to programming. I suppose this makes me a newbie of the worst kind. I'm posting this hoping someone can help me out. I'm working through a Curved Basic tutorial "Learn about object animation". I'm using DBP & DM2. The problem is my model loads, has texture but no animation. I recieve a frame rate 1-90 & total frame 104160. Because the total frame is over 100,00 it has been suggested I run my model through a program such as milkshape & export from there. It just seems to me this shouldn't be necessary seeing as DM2 was wrote to be used with DBP. But hey I'm a newbie & don't know it all yet. lol. But seriously I would appreciate any help on this. Code attached.
Kain
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: NJ, USA
Posted: 27th Jun 2004 00:37 Edited at: 27th Jun 2004 00:38
ok found the problem. Its not with the model but with the code you are using to play it:

sync on : sync rate 60
backdrop on
load object "Agent.x" ,1
load image "muzi.bmp" ,1
load image "renik.bmp" ,2
texture object 1,1,2
do
loop object 1,0,90
set object speed 1,50
set cursor 0,0
print object frame (1)
a = total object frames (1)
print a
loop object 1
sync
loop


This command should only be used once, but you have it in your loop. Therefor every loop, you are resetting the animation to 0 and starting it looping again (which doesn't ever give it a chance to advance any frames). You also are using the loop object command twice within your do loop, which will really mess things up. Try this simple fix and it should work:



sync on : sync rate 60
backdrop on
load object "Agent.x" ,1
load image "muzi.bmp" ,1
load image "renik.bmp" ,2
texture object 1,1,2
loop object 1,0,90
do
set object speed 1,50
set cursor 0,0
print object frame (1)
a = total object frames (1)
print a
sync
loop


Let me know if that fixes your problem.

Zazen
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location: J_ville Flusa
Posted: 27th Jun 2004 10:39
Kain, thanks for the help. I modified my code by dropping the loop object 1 but still no animation. I've tried play animation, loop animation, play object, modifying original code , whatever I thought might work but no go. If all else fails & I reach my wits end I'll find an animation that works, load it and see what happens. I've included the new code. All tho it's a subtle change. BTW I'm not really sure what is setting the animation to 0. Hey go easy on me I'm just learning to crawl. Thanks for your time & patience.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 27th Jun 2004 14:26
load an .x object eg:

load object "c:\program files\dark basic software\dark basic professional\media\models\colonel z\colz_run.X",1
pitch object up 1,90
fix object pivot 1

loop object 1
do

rem just rotates model so that you can see it walking from all angles
turn object left 1,0.01

loop


should load and play an object running, make sure the file you have used does have movement, it is posible to have objects with animation frames that do not move, this code was tested and works fine here, if you don`t have Pro then use a different path to the animated models in the classic install(darkbasic\media\models\animated), the pitch and fix object pivot commands where to orientate the model correctly (for some reason he`s lying on his face when you load him).

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.
Zazen
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location: J_ville Flusa
Posted: 1st Jul 2004 04:08 Edited at: 1st Jul 2004 04:31
Mentor you da stuff Baby! Agent is now doing what I expected. I learned a lot. Like how to enter path without cluttering up my machine, how to color backdrop (no more BSOD) lol, how to view object, & adjust speed of animation. But I have to ask two things;

1: Is this an ok way of learning code, read & run code, apply it to what I'm doing & modify code to understand & see results, plus ask questions?

2: Do you retain all this coding in your head or is there a reference I could peruse? Ok I'm sorry I just love that word peruse. Is there a book I can use for reference?
Seriously tho I do appreciate your help.

load object "C:\Program Files\DM2Browser\Media\Actors\Heros\Agent\Agent.x",1
color backdrop rgb (140,40,50)
pitch object up 1,90
fix object pivot 1
loop object 1
do
set object speed 1,5000
turn object right 1,0.10
loop
Zazen
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location: J_ville Flusa
Posted: 1st Jul 2004 04:40
Glad the forum is back up!

What is lost can never be saved.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 2nd Jul 2004 02:28
Yeah, I'm glad the forums are back too...

As for the other, the first question's answer is; "yes & no."

By that I mean, you read over and run the different examples until you get an idea of how each command works, then apply what you've learned to your current project. Often, you can also re-use the various functions of the examples, so you keep them around as tiny files for use with the #include <some file> command, which makes building your current program very fast and easy. So it's a combination of memory and saved code pieces, so you can get things done.

As for a book, there are a couple, the first is the manual that comes with DBC or Pro. There is also a book out on Dark Basic Programming itself (I forget the exact title) which is listed in the resources thread. (But someone will probably add it here for you to.)

And of course, there are LOTS of tutorials, plus the Code Base here on site of many people doing different things. So read on and feel free to poke around, you'll get lots of ideas here...

S.

Any truly great code should be indisguishable from magic.
Zazen
20
Years of Service
User Offline
Joined: 26th Jun 2004
Location: J_ville Flusa
Posted: 2nd Jul 2004 10:41
I'm using DBP as stated in the first post. I do have the Reference Manual & User Manual. The Reference Manual is a through & complete listing of command & function syntax. But no instruction whatsoever on using the code. It does comment on what each command will do but not how or where to insert them. As for the User Manual its full of bugs. I had to debug several examples & tutorials before they would even compile & run. The only book I have found so far is "Beginers Guide to DarkBasic Game Programming". Again I'm using DBP. When I try to run the code EHHH error yada so on.

Tutorials. Maybe its just me. I tried Binary Moon's. First I can't find Limit Rush to see my goal. Second it may not run in DBP any way. After I'm done here I will e-mail another forumite who I think has modified the code as needed. Third all I see is code. I tried running lesson 1 I get an error Cannot Load Matrix. Hmmmm. Right now I would like to concentrate on coding not debugging. I know, I know, all programs have bugs. But I just don't "see" how to use the tutorials yet.
Please do not think I'm being disrespectful. Just frustrated & too stubborn to give up.Thanks for listening & thanks for advice.

What is lost can never be saved.
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 2nd Jul 2004 19:02
Well, your experience sounds pretty much like mine then... but I'm not one to give up easily. I keep at it and at it until I get an idea of what's going on, using what other's have written as examples of what can be done. Perhaps sadly, I'm of the opinion this is the only way one can learn a new language -- just jump in with both feet and try it out!

For all my efforts though, I find I like the language... it's faster and easier to use than many of the other forms I've tried, some of which would scare ya half to death.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2024-09-22 15:25:23
Your offset time is: 2024-09-22 15:25:23