This content has been marked as final. Show 14 replies
I am surprised. I was able to move a character only until 13 :)
If you mind post questions individually, obviosly before usiang the search menu. Search for collision for example.
Ok I can do simple things like evenmmake a cursor but boundaries I've seen lots of tutorials for but what sucks is they have a couple billion scripts and I only want 1 SIMPLE BOUNDARE SCRIPT!!!!!!!!!!!!!!!!!!!
Ok I can do simple things like even mmake a cursor but boundaries I've seen lots of tutorials for but what sucks is they have a couple billion scripts and I only want 1 SIMPLE BOUNDARE SCRIPT!!!!!!!!!!!!!!!!!!!
Welcome to the world of Director. Hope you stay with it for many years to come.
I'm impressed to hear you're 11 and already doing some complex things with the
program. I have tutorials at:
and a set or resources/links at:
The above URL links to all the best Director sites on the web and other useful
If you have specific questions on how to do things, you can post here or in other
forums. I have links to the all the various forums in my resources page.
I wish you all the best with your Director journey.
Director Lecturer / Consultant
Here's a simple approach to 2D collision. When a sprite moves inside a second sprite's boundary [the rectangle that surrounds the sprite] you can test that as a collision. (There are other ways to test this - but let's start with a simple one.) When you do this you simply create a behavior script (make sure behavior is the script type in the property inspector - it will have the little daisy gear in the thumbnail view) and then in that behavior script type something like this...
pTarget = ---- now here you can type the channel number of the target sprite
on exitFrame (me)
if sprite(me.spriteNum).loc.inside(sprite(pTarget).rect) then
of course in practice you'll want to try to identify target sprites dynamically - one common way is to make targets 1 position away from the thing you expect will hit them. Or if you know for example that you want to check 1 projectile against a series of possible targets - you could repeat through a range of targets. You could also turn it around. This script is designed to go on the projectile, but you could just change the reference to me.spriteNum (that is a way to say the channel number of the sprite this script is attached to) to refer instead to the target. Then each target could get a copy of the script attached to them.
Since you are just starting to learn, I'd recommend reading Gary Rozenzwieg's book. See if you can find an old copy of Tab Julius' "lingo" (probably the best lingo text ever written and still applicable (though much of the code is probably depricated) and if you want something more recent you could read Dean's book. There are a ton of good ones out there to get you going.
The only other reccomendation I have for you is this. Before you go to far... learn about some basic programming concepts.
variable assignment, sequence, events and list structures. This will really, really help make everything clearer.
-- hope your journey goes well,
I have a 3D software called 3D canvas PRO! But how do you export a file in Shockwave 3D if anyone knows?
Oops Just realized you were asking about collision in 3D. Well that's much simpler isn't it.
Okay: there are several ways to do it. Here's a simple one. The collision of one body against another in 3D space is often easily detectable based on the very simple question of distance between the position of one object and the position of a second object. That's how Podz works for example.
The script simply polls the distance between objects. The key is only asking for the stuff you need (strip out models and things you don't care about - so you don't waste time finding collisions between buildings for example.) So in the distance model you are determining if a 3D model is within n distance of some other model.
on exitFrame (me) -- in practice you'll want to have a main script that gets called and has multiple states
repeat with targetModelNum = 2 to 100
if member("3DWorld").model(1).transform.position.distanceTo(member("3DWorld").model \ [targetModelNum].transform.position < 1.0 then -- mind the line break here
I wrote a tutorial four doug on projectile firing that uses the built in director collision method.
You could also use Havok, or if you want to learn to do collision by the math, Paul discusses mesh triangle to point based collision math in his book Director's Third Dimension.
> I wrote a tutorial four doug on projectile firing that uses the built in
> director collision method.
And I have some 3D tutorials (right colum)
Cover using Havok, collison detection using collision modifier and collison using
Director Lecturer / Consultant
> Hi everyone,
> I have a 3D software called 3D canvas PRO! But how do you export a file in Shockwave 3D if anyone knows?
I haven't used 3D Canvas Pro, but looking it up at:
it does list Shockwave 3D (w3d) as a format it exports to.
So, from the File pulldown menu, there's probably an Export option. When you chose that, a dialog box should
appear with a list of the various formats. Browse to find Shockwave 3D (w3d)
Director Lecturer / Consultant
I am having a navigating probem! The problem is when the character moves around the area when he is turning lets say left he cannot go up and left at the same time. But I also do not know how the mouse can do a look turn. How do you do that stuff. I already can make a cursor and a charact that can navigate with killable enemies but the navigation engine would be harder for a player! Even If i made the turning of the character fast, well it just would not seem right for a game like that unless I added unkillable teamates type of game I guess it would be suitable and OK but I still want a advanced style cause I already know flash and how to hack it but with Director I prefer my own stuff anyways! I really need to know a good navigation style.
To do a proper 'mouselook' with director, you need to use an xtra which will allow you to reset the mouse's position. The technique goes like this:
* When the game starts, set the mouse pos to the centre of the screen
--- then, each frame: ---
* Read the distance of the mouse to the centre of the screen
* Use the horizontal and vertical distance to rotate your viewpoint
* Reset the mouse position back to the centre, ready for a new measurement next frame
The reason you have to keep resetting the mouse position is that, if you don't, the cursor will reach the edge of the screen and stop, preventing you from turning further.
There's a free non-shockwave-safe xtra that can do it, here:
(see the 'setMouse' xtra)
There's a shockwave-safe one here, but not free:
(see 'enhancer' xtra, or 'move cursor' xtra)
I have a few navigation (and collision) demos here:
Very simple - arrow keys to rotate & move the box:
Same controls, but controlling a first-person cam, and includes collision with walls:
FPS mouse control without an xtra - not the same as 'real' mouselook though, click and hold on the viewport to walk, drag left right to rotate, up/down = forward & back:
hope these help!
Alright everyone I figured out how to turn and move at the same time myself using the software but I still need to know something. I know how to use the mouse to look turn now! (already did a long time ago though) But a problem. I need something to bring the mouse in the middle of the screen every 1.5 seconds! If anyone knows how to do this please tell me. I mean, I did figure out most of the stuff myself as a matter of fact.