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 / Adding DarkMatter Animation to Dungeon

Author
Message
badkneecap
10
Years of Service
User Offline
Joined: 21st Jun 2010
Location:
Posted: 8th Jul 2010 22:10
I'm playing around with the Huge dungeon example and I came across a problem. I tried to take a simple animation from DarkMatter and add it to my dungeon. I added this code:



If I put it before the "autocamera off" statement, it works. If I put it after, it doesn't show up. However, if I comment out that line, then my dungeon map doesn't work. What do I have to change to get this to work with my dungeon?
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Jul 2010 02:05
Hello,

Put the autocam off at the top of your program (before you load objects and such). In doing so, your camera will default to position (0,0,0) . When you load objects in, they also default to position (0,0,0). If you can't see them, that usually means the camera is right on top of them (in the same exact spot) or the object is too small.

Try just backing the camera up a little bit by adding the line

position camera 0,0,-10

after your loop object command

The autocam on command positions the camera a little bit away from the last object loaded and the the camera faces it so it can be seen. This can be useful sometimes for testing and taking a look at a mewly loaded object, but for in game play you will want to control the position of the camera yourself and not have it automatically positioned by DarkBASIC.

Enjoy your day.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jul 2010 12:30
What you could also do is like Latch said, but get the object's size and add that to the distance the camera should be positioned:

position camera 0,0,object size z(object)*2

TheComet

Login to post a reply

Server time is: 2020-08-13 18:35:18
Your offset time is: 2020-08-13 18:35:18