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 / Magic World - Help Tutorial

Author
Message
Necrym
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: Australia
Posted: 28th Mar 2003 10:02
Ok lotsa people seem to need this little help on magic-world world editor from
http://www.all-seeing-i.co.uk. A great piece of work from Robin King.

So i thought id just put up this little tut and file to help.

1. After you have installed magic world there is a loading routine supplied called magicload1-1.dba found in the subdirectory called loadfunction. Copy this file into your directory with your other main dba programs.

2. ok now we have to include this magicload1-1.dba function into our program so if your running standard DB then near the top of your code put an include statement in like so.

#include "magicload1-1.dba"

if your using DBProfessional then you include it by doing this instead, go to the side window in your editor and select FILES then browse to the magicload1-1.dba and add it in your list of included files. If your going to use magic world with DBP you will have to edit or rem out the 'make object static' commands in the the magicload1-1.dba before you can use it as these commands
are now redundent.

3. Ok, now we are ready to load a world. Make your world. Make sure you position the matrix to 0,0,0 coordinates, pretty it up with a few textures then and save it using the stand alone world menu option in Magic world. this will place all use textures,maps,objects used in a directory you name to whatever you want. For example: Level01

4. Copy that directory just created into your programs directory. So now you have in your program directory somthing like this for example.

MY-GAME DIRECTORY
mygame.dba
magicload1-1.dba
LEVEL01 DIRECTORY

5. Ok, lets load that example world. You load the world with this command.

MagicLoad("LEVEL01/level01.mwdb",1000,1,1000)

Now the command explained.
MagicLoad ("name of world", first image number, first matrix number, first object number)

"name of world" - place the directory and world name here.
first matrix number - usually 1 but you may wish to make special applications with starting
matrix at another number
first image number and first object number- any number you wish.
So why use 1000 as my first image number and first object number? - well this just keeps the first 1000 numbers free for uses in your program without clashes, you can use any numbers you wish just make sure you dont use those numbers elsewhere for object or bitmap numbers.

6. ok now if you have done all this so far we have the world loaded up - so what now. Well we want to walk on that matrix so in your main program loop you have to check for your groundheight. Do this by using the command as in the sample below.

x#=camera position x(1)
z#=camera position z(1)
y#=GET GROUND HEIGHT(Matrix Number,x#,z#)
position camera 1,x#,y#+10,z#

7. Thats all there is to it.

8. Muti Matrix worlds: If your going to use multiple matrix worlds get ground height command gets more difficult so this little function below makes it easier, it is also to be included into your program like before,as well.

function world_height(x#,y#,z#,firstmatrix,mat,matx#,matz#)
for a=firstmatrix to (firstmatrix+mat)-1
xx#=matrix position x(a)
zz#=matrix position z(a)
if x# > xx# and x# zz# and z#
Watch the bouncing cursor - now in 3d
Necrym
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: Australia
Posted: 28th Mar 2003 10:04
Here is the Multi-Matrix get WORLD_HEIGHT function for use with the above



Watch the bouncing cursor - now in 3d
Necrym
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: Australia
Posted: 28th Mar 2003 10:07
8. Muti Matrix worlds: If your going to use multiple matrix worlds get ground height
command gets more difficult so this little function below makes it easier, it is also
to be included into your program like before,as well.

The world_height function returns the ground height on multi matrix worlds and passes it to y#
Now we call this function instead of using the get ground height command by doing this.

x#=camera position x(1)
z#=camera position z(1)
y#=world_height(x#,y#,z#,firstmatrix,mat,matx#,matz#)
position camera 1,x#,y#+10,z#

ok lets explain this world_height functions useage.

x#,y#,z# = self explanitory
firstmatrix = usually 1 but you may wish to make special applications with starting
matrix at another number
mat = number of matrix in your multi matrix world
matx# = X size of matrix in your multi matrix world
matz# = Z size of matrix in your multi matrix world

Just make sure when you build your multi-matrix world that you keep all the matrix
the same size.

Hope this helps a few people out!
Regards Necrym

Watch the bouncing cursor - now in 3d

Login to post a reply

Server time is: 2024-11-24 07:58:11
Your offset time is: 2024-11-24 07:58:11