3dmm.com

3dmm Chatroom: Daily meetings at 11pm GMT (6pm EST)
Go Back   3dmm.com > 3D Movie Maker > 3DMM Chat
User Name
Password
Register Site Rules FAQ Members List

Reply
 
Thread Tools Display Modes
Old 09-02-2004, 04:19 AM   #1
Aaron Haynes
Senior Member
Aaron Haynes's Avatar
Join Date: Dec 2001
Posts: 15,125
3dmmap Script Editing Tutorial

Just thought this might come in handy for those who know 3dmmap but feel hesitant about playing around with script editing and whatnot.

This explains how to edit the number of pixels an object moves with the mvleft, mvright, mvup, and mvdown commands in 3dmmap. It also explains how to use SceneEd, an external script that allows you to move an object a certain number of pixels each frame over a specified amount of frames, making panning and zooming a piece of cake. Since hand animation with characters is tricky enough, anything that makes the ultra-precise animation associated with camerawork easier is more than welcome in my book.

Quote:
-----------------------
Script Editing Tutorial
-----------------------

Basically, what you're doing is editing the scripts that tell the movement commands in 3DMMAP (mvleft, mvright, mvup, mvdown) what to do. When you open wasd.asx in C:\Program Files\3dmmap\Scripts, you'll see a set of simple commands for each direction of movement. The important thing here is the "Slide" command.

Sub MvLeft
DefaultKey 65
mouseup
wait
MouseDown
Wait
Slide -3 0
wait
mouseup
wait
End Sub

You'll see two numbers, one is a zero and the other is a whole number (-3 in the example above), either positive or negative. Don't ever change the sign of the whole number, and don't change the zero, cause these are the coordinates that tell it which way to move.

Increase or decrease the whole number to change the number of pixels that the object will move when you use the key this command is bound to. A general rule to keep in mind is to not go above 100, but I never go beyond 60, personally. You can always press the button more times, after all.

When you save the changes to the script, you'll have to close 3dmmap and reopen it for them to take effect. That's all there is to it.

-------------------------------
SceneEd script editing tutorial
-------------------------------

First off, get the SceneEd script from here: http://www.lockntoad.com/utilities/sceneed.zip. There are three script file here: ani1, ani5, and frm10. ani1 is pretty much useless; if you're really interested in learning how it works, check the documentation included in the .zip file. Otherwise, copy ani5 and frm10 into your Scripts directory in C:\Program Files\3dmmap.

frm10 behaves exactly like wasd -- you change the whole number value in the slide line to tell 3dmmap how many pixels to move the object. But frm10 works in conjunction with ani5 to also tell it how many frames to make it move that amount of pixels.

Sub AniRight5
DefaultKey 76
Call AniRight1
Call AniRight1
Call AniRight1
Call AniRight1
Call AniRight1
End Sub

Notice that Call AniRight1 is repeated five times. This moves the object the number of pixels specified in frm10 over five frames. Copy the Call AniRight1 line as many times as needed to increase the number of frames you want the object to pan to the right. As with the slide in frm10, don't exceed about 50 or you'll start having problems; you can always press the button again.

Something to keep in mind is that 3dmmap is very sensitive, and sometimes the command will accidentally execute twice. So if you had Call AniRight1 copied 20 times, it'll move it over 40 frames, and leave a gap on frame 20, where the object doesn't move for one frame. This is a major pain in the ass, so pay attention if the object moves too many frames; you'll have to hold shift and hold the Resume Last Action command in 3DMM to cancel the movement on the object and start over. Another thing to keep in mind is that if you have a bunch of objects onscreen, it's probably a good idea to make the object move in another scene and then copy it back into the scene you're working on. 3dmmap might get confused and grab the wrong object by mistake, and that could screw up your whole scene. Pay close attention to what you're doing and save before making an object pan or zoom.

Once you know what you're doing:
Some good things to keep in mind

• If the script accidentally grabs another object by mistake midway through and starts moving it along and completely screws up your pan, you won't be able to undo it. If you're panning something over 40 frames, that's 40 seperate commands executed in a row, so you can only undo the last one. If you're worried about this, two things that'll help:
1. Save your movie every time you're about to use a sceneed script, so you can re-load if you need to.
2. Make sure the object is big enough and rotated so the hand tool won't get confused and miss it during the animation path.

• If there are already a ton of objects in a scene, the sceneed script may lag and get out of time, grabbing the wrong objects, skipping frames, dragging things incorrectly, etc. Pan all of your objects first, then use them to build your scene. Create a seperate blank scene to pan them in, then copy them back over if you need to.

• Remember to finish scenes before moving on. If you forget the changes you made to a sceneed script and need to add an actor to a scene later, it won't pan right and you'll have to do it manually. This sucks noodles, so pan everything first and build your scene second.

• Be sure you're not moving the mouse when you press the sceneed button!

• Keep shortcuts to ani5.ax2, frm10.ax2, and 3dmmap on your desktop so they're easy to get to. Or at least a shortcut to the Scripts directory. I dunno, it's probably easier to make edits when you're not in 640x480 like I always am.

• 3dmmap keypresses are ridiculously sensitive. Sometimes a script will accidentally execute twice. If your sceneed command seems to have gone twice the number of frames it should have, you have a problem, because it leaves a single frame of nonmovement in the middle and it won't look right. Edit your scripts so you have a large number of frames and can cut before the "hole" in the middle of the animation if this happens. Alternately, if you're using the sceneed command multiple times on an object, copy the object and paste it if sceneed goes bonkers. This isn't especially damaging if you're paying attention, just annoying.



Aaron Haynes is offline   Reply With Quote
Old 09-02-2004, 05:20 AM   #2
Fish Taco
Senior Member
Fish Taco's Avatar
Join Date: Aug 2002
Posts: 7,034
Awesome. I really hope this brings out more helpful scripts. We need them.
Fish Taco is offline   Reply With Quote
Old 09-02-2004, 10:41 AM   #3
Denny Betterman
Senior Member
Denny Betterman's Avatar
Join Date: Apr 2003
Posts: 3,531
I've tried and I can't think of any good scripts. Possible one that rotates an object exactly 45 degrees in given direction, but I'm not sure if rotation speed is independant of the size/type of object...

Other than that, only thing I can think of would be the equivalent of a keyboard shortcut to less used commands, like opening the actors window or something...I mean, doing almost everything in 3dmm on the keyboard would be interesting, but it's easier to use the mouse for most things that it's more convenient to just keep your hand there.


Denny Betterman is offline   Reply With Quote
Old 10-24-2004, 05:33 AM   #4
Beast
Senior Member
Beast's Avatar
Join Date: Feb 2003
Posts: 7,998
A good script for me would be down/up four on the object thing... with 200 piece characters its hard to find the piece I want.


Beast is offline   Reply With Quote
Old 10-24-2004, 06:13 AM   #5
Denny Betterman
Senior Member
Denny Betterman's Avatar
Join Date: Apr 2003
Posts: 3,531
Agreed, it would make it sooo much easier to browse various parts if you could just press, say, M and have it left click 4 times. Easiest script ever, I so lazy.

WHOA This is so awesome: Here's how to make it yourself:

1. Open Notepad (or wordpad or textpad or whatever you want, Notepad is quickest and easiest as far as I'm concerned)
2. Copy the following:
Code:
Sub QuadClick zclick zclick zclick zclick End Sub

3. Save as C:\Program Files\3dmmAP\Scripts\quadclick.ap2 (As long as that is where 3dmmap2 is installed, I doubt it would be much different)

4. Load 3dmmAp2
5. At the very bottom of the macro list should be QuadClick, click it.
6. Click 'Bind New Key' on the right.
7. Press the button you want to use for that function.

And voila! Whenever 3dmm is running you can press that button to instantly click the mouse wherever it is 4 times, and I DO mean instantly. Ha! This makes getting back through the font/actor/prop/color/etc. lists so much faster, I can' t believe I was soo lazy I couldn't even do THIS to help myself out.


Denny Betterman is offline   Reply With Quote
Old 11-07-2004, 08:06 PM   #6
Aaron Haynes
Senior Member
Aaron Haynes's Avatar
Join Date: Dec 2001
Posts: 15,125
bump


Aaron Haynes is offline   Reply With Quote
Old 02-21-2005, 10:18 PM   #7
Aaron Haynes
Senior Member
Aaron Haynes's Avatar
Join Date: Dec 2001
Posts: 15,125
bump.

It pains me how few people know how to use this. I'm not kidding when I say it cuts your movie making time down by 3/4, seriously.

Edit: That was not a dig at you, Eric


Aaron Haynes is offline   Reply With Quote
Old 02-21-2005, 10:23 PM   #8
HMC
Super Moderator

Join Date: Jan 2003
Posts: 8,715
You should be able to change how far an object will move depending on whether or not you hold shift or something. That'd be cool.


HMC is offline   Reply With Quote
Old 02-21-2005, 10:37 PM   #9
Air Rick
Senior Member
Air Rick's Avatar
Join Date: Oct 2001
Posts: 6,733
you, sir, are a god.
Air Rick is offline   Reply With Quote
Old 02-21-2005, 10:39 PM   #10
Aaron Haynes
Senior Member
Aaron Haynes's Avatar
Join Date: Dec 2001
Posts: 15,125
It doesn't take too long to change the script, but yeah, that would be nice. Or a console built into 3dmm that allows you to change it then and there, but you might as well be wishing for Maya or 3DSM by that point.


Aaron Haynes is offline   Reply With Quote
Old 02-21-2005, 10:57 PM   #11
Travis Wells
Senior Member
Travis Wells's Avatar
Join Date: Oct 2001
Posts: 11,147
Quote:
Originally posted by Aaron Haynes
It doesn't take too long to change the script, but yeah, that would be nice. Or a console built into 3dmm that allows you to change it then and there, but you might as well be wishing for Maya or 3DSM by that point.

Console! Very good idea. Alot of v3dmm stuff would be easier to test and debug if we had one.

Anyway, AP3 is going to be more of a programming language and less of a macro.

All that really means is you can do stuff like this:

Code:
def AniRight5(): if keys.control: movecount=5 elif keys.shift: movecount=1 else: movecount=10 for i in range(movecount): AniRight1() AniRight5.DefaultKey='J'

CONFUSING, EH?
Lemme break it down:
The def AniRight5() is the replacement for "Sub AniRight5", and the AniRight5.DefaultKey='J' line is the replacement for DefaultKey 76 (76 is the ascii code for J. You can still do 76 if you want.)

This stuff:
Code:
for i in range(movecount): AniRight1()

Means call AniRight1 a certain number of times. How many times? Well, whatever value movecount has. Movecount is set in this thingy:
Code:
if keys.control: movecount=5 elif keys.shift: movecount=1 else: movecount=10
It works like this:
Is control down? If so, set movecount to 5.
If not, check if shift is down. If it's down, set movecount to 1.
Otherwise set movecount to 10.

I know this is like 20 times more complex than AP2's scripting (which wasn't exactly simple...) but it's really not that bad, and it'll make alot of cool new stuff possible.
You can always wait for people like Aaron to figure it out and make them create scripts for you
Travis Wells is offline   Reply With Quote
Old 02-21-2005, 11:01 PM   #12
Aaron Haynes
Senior Member
Aaron Haynes's Avatar
Join Date: Dec 2001
Posts: 15,125
Ooooh, that is cool. I'd have fun with that.

But yeah, for people who don't like screwing around with code, me or Taco or someone would probably make an edit-free version. Be nice if we could put the commands in the 3DMM GUI somehow.


Aaron Haynes is offline   Reply With Quote
Old 02-21-2005, 11:03 PM   #13
Travis Wells
Senior Member
Travis Wells's Avatar
Join Date: Oct 2001
Posts: 11,147
I doubt it. The problem is v3dmm has no idea what 3dmm is currently doing. So it can't tell what the hell you are clicking on.

(Right click might be a good idea. Does 3dmm ever use it? I don't think so...)

Oh yeah, AP3 will automaticly convert your AP2 scripts to AP3, so any script you've written so far should still work in AP3.
Travis Wells is offline   Reply With Quote
Old 02-21-2005, 11:49 PM   #14
Denny Betterman
Senior Member
Denny Betterman's Avatar
Join Date: Apr 2003
Posts: 3,531
Nah, right click and middle mouse button are completely unknown to 3dmm, other than the open/save dialog box, I'm pretty darn sure of it.

I had an idea once, hoping that 3dmmap would be able to use variables, that a much more interactive Choose Your Own Adventure would be possible, say, by adding money and health via variables, y'know?

And then I got the idea of making an actual 3dmm game using 3dmmap and variables add-on, by, like, having everything in one frame, and just moving stuff with the keyboard and keeping track with variables--And then adding objects that do stuff per step like in some actual programling language, like, 3dmmap would move them around by themselves, and if variables are kept track of it could be possible to check collisions, that kind of thing, and and refreshing the level would just be reimporting the scene from another movie in the same folder or or or something cause you could see, like, Pacman doing this, like, moving an object just vertically around a board full of dots and yeah that's a heck of a lot of work. I'm a dreamer heh

Being able to get into 3dmm and its temp movies (if any) would make that a lot easier than trying to assault 3dmmap, possibly, though, however, y'know


Anyway, ap3 sounds good


Denny Betterman is offline   Reply With Quote
Old 02-22-2005, 12:19 AM   #15
Travis Wells
Senior Member
Travis Wells's Avatar
Join Date: Oct 2001
Posts: 11,147
Okies. I didn't think it used right click.

Nah, choose your own adventure won't be possible. (Variables are supported, so there's no reason you can't use them in your scripts)

I'm just not going to let movies/expansions anywhere near the scripting system. Too big a security hole.
Travis Wells is offline   Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Sig Police

Contact Us | RSS Feed | Top

Powered By ezboard Ver. 5.2
Copyright ©1999-2000 ezboard, Inc.
Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.