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 Professional Discussion / I can't get "loop object" to work

Author
Message
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 02:38
For some reason i just can't get any model to animate on db pro, the models worked perfect in the old DB but won't work at all in DB pro. So to test dbpro i loaded one of the models from the room demoand tried to make it animate but that didn't work either!

please help! im so close to finishing a demo!
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 24th Sep 2002 03:09
I would say that if you can't get the supplied animated models to animate then there is probably something up with the code that's trying to do so (especially if the demo code works okay for you). It may well be something really simple that you overlooked. Might be worth pasting some code here to see?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 24th Sep 2002 19:25
well there shouldn't be anything wrong with the code since all you have to do is load a model and in the main loop tell the 3d model to animate (well that's how it works in db) anyway, here's the code:



When the menu comes up just press space and the game should load, you might need to change some things cause you don't have the files but it should work fine.

Press "M" to see the small cinematic

Feel free to use the code but please don't nick story line.

thanks
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 25th Sep 2002 22:34
Can some1 please test the code to see if the loop object works or if it works in general?

Cheers
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 25th Sep 2002 23:30
Yes! I'v got it to work more or less! if i specify a start and end animation it don't work for some reason. It's really strange. Also append object don't work, it just crashes when i run the exe.
Zero
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 26th Sep 2002 18:53
I think I know why it doesn't work. You have that loop object command in a loop! In db#1 it didn't care if you tried to loop object when it's already looping.. it just ignored it. BUT in DBPro it starts all over again when faced with a loop objet command.. is the animation jurky and starts again after one frame has passed? I'm not home right now so I couldn't test your code. Try to replace the loop object command with this one: "if object looping(nbr)=0 then loop object(nbr, paramaters here)".

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 26th Sep 2002 22:18
Thanks Zero! It works! I still cant get append object to work though, oh well...

Thanks again
Overdroid
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 28th Sep 2002 11:44
I have the same issue and I was wondering if you were able to get a partial animation to play, for example the following code does not animate:



However if I change the animation command to play object 1 or loop object 1, it plays the entire animation. I can't get the command to play just part of the animation.

"Talk is cheap because supply exceeds demand."
- Unknown.
Chenak
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 28th Sep 2002 14:39
Zero has figured it out, instead of just "loop object" type in "if object looping(objno)=0 then loop object objno,0,24"

Also the speed maximum setting for "set object speed" is only 100 (I think)

Thanks
Overdroid
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 28th Sep 2002 15:45
Hmm,
Tried the code and still got the same effect. Also, I've noticed in the room demo the dbteam added the command set object speed 1,12000. I suppose it might be a typo, but the model doesn't seem to move incorrectly, also I get about the correct animation speed with 2000. I came up with this number after playing around with different values.

I think it's definitely a bug. If I use the format loop object 1, 10 - the whole animation plays (but shouldn't it start from 10?).

If I use the format loop object 1 - the whole animation plays.


If I put two values into the command loop object 1, 10, 40 - no animation at all.

"Talk is cheap because supply exceeds demand."
- Unknown.
Overdroid
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 28th Sep 2002 15:58
AHA! I figured it out.
The animation frames in DBP are WAY different than the animation frames in my modeling program. If I set the animation command to loop object 1,0,5000 I see a small part of the animation (about 10 frames). Weird. The same thing happens with any of animated models included with DBP.

If you look at the room demo code you'll see that all the frame values are multiplied by the heroframe# variable, which is = total object frames(1)/200.0.

Interesting.

"Talk is cheap because supply exceeds demand."
- Unknown.
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 28th Sep 2002 17:55
Is object looping() working for you guys? Cos I tried it a while ago and it seemed to stay locked at 1 even when you stopped the object.
Overdroid
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location:
Posted: 29th Sep 2002 01:22
Yes, it seems to be working for me now. You need to recalibrate the frames based on how many frames DBP says an object has. For example if you use total object frames() to find the frame count of the miko.x object from the camera demo you get 153,920 frames. The text description of the animations says 480 frames.

I'm wondering if this is going to change in a future patch since if I code based on how it works now it won't be compatible with future versions.

Also I wonder if the set object speed command will change since as it works now you need to put some pretty high numbers in there to make it work, but the help file states you shouldn't put in any #'s greater than 100.

Hmmm.

"Talk is cheap because supply exceeds demand."
- Unknown.

Login to post a reply

Server time is: 2024-04-18 13:22:26
Your offset time is: 2024-04-18 13:22:26