home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
MISC3D
/
EEDEMO
/
EEDEMO.DOC
< prev
next >
Wrap
Text File
|
1993-08-12
|
3KB
|
78 lines
EEDEMO v0.1
Notes on first version:
Only one BOB file per world allowed. Just include a line like this:
bobscript filename
filename is the name of the BOB program. It must have the extension ".bob",
but do not specify the extension in the wld file.
The "main" function is executed immediately after compilation. It
really is just for initialization, since most BOB procedures will
be called in response to an event.(such as a timer, or a mouseclick)
All variables have to be inside a function. To make a variable Global,
just initialize it in "main".
To associate a function with an Object, you must first "name"
the object in the wld. Then call the ScheduleTask function in BOB.
ScheduleTask takes 4 parameters:
a BOB object or 0
the name of an object from the WLD file
the name of a BOB function to call
how often to call this function(the period)
tsk = ScheduleTask(0,"ball", "ballfunc", 30); // gets called every 30
// frames or so
In this example, your BOB file should contain a function named
"ballfunc", and your .WLD file should contain an Object named "ball".
Note the first parameter - 0. If you do not use a BOB class object
be sure to pass a 0 for this param.
If you want to delete a task, you must have saved the task handle
returned by ScheduleTask. Then use it in a call to DeleteTask:
DeleteTask(tsk);
A task can Delete itself, and re-Schedule itself.
This doesn't affect the object, just the task associated with it.
Deleting the object is another story altogether... one thats not
yet implemented.
For a better, more Object-Oriented approach, see the example TASKCLS.BOB
So, what do you do in these BOB procs that are called by Tasks? Right
now, these are the only functions implemented:
Moveto(x,y,z); //move to absolute position
Move(dx,dy,dz); //move relative to current position
Rotate(dx,dy,dz); //rotate relative to current rotation
these work on the "current" object only. So this limits tasks to manipulating
one object at a time. I don't like this, and i'm going to change it soon...
MoveCamera(dx,dy,dz); //move camera position relative
TurnCamera(dx,dy,dz); //turn camera relative to current view rotation
RefreshDisplay(); //Refreshes display. useful for repeated operations
EventLoop(); //also refreshes display. collects user input.
GetArea(); //returns name of area the Camera is currently in.
PopMsg(msg); //pops a message up in a box
GetKey(); //returns next keypress
I'm still working on better examples. Different methods. Truly
object-oriented Objects... but there's only so much time in a day...
If you have any suggestions, complaints, or whatever, I'd be happy to hear
from you.
Eric Elliott
72427,716