View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Questions on Fall 2003 Milestone 4

"Your guide should walk the user through that help topic one step at a time."

What exactly does this entail? I know our next milestone is the demonstration engine, so this can't be the complete thing, but how much functionality should our Guide have in relation to this?

Jeff's response:
For this milestone walking the user through the help topic one step at a time means walking them through the text instructions one step at a time. So your interface starts out showing Step 1 of the instructions, and when the user clicks the Next button (or whatever), you show him Step 2, etc.

Is there a way to save the heirarchy of an actor so we dont have to redo it each time we initiate our Avatar?

Jeff's response:
That depends. How are you creating your Actor? Out of separate models that you're then arranging into a hierarchy via becomeChildOf:?

Yes, we are pulling a model in from a .3DS file, then using becomeChildeOf: to set the heirarchy.

Jeff's response:
Unfortunately there's no easy way to save that hierarchy. I didn't have time to write a "saveActorAs:" method while at Disney...

Where should we place our mdl files so that it will load up properly on the TA's computer? should we just put it in the same folder as our squeak executable?

And also, it seems a lot of the objects provided in that zip either don't show up when I add them or they show up without any time of skin (just solid white model). Is this a known problem or is it probably something wrong with my setup (It's happening on multiple computers)?

> Justin Coffman

To get the textures do something like:
model part setTexture: '<texture filename>'
model setColor: white
(this color is an overlay so you can basically tint the model w/ any color)

supposedly mdl's autoload their textures though

Richard Bailey

Yeah, as far as I remember they all loaded with textures just fine (the mdls). But why use those when you can make your own? ;-)

Jason Whitehurst

Jeff's response:
Presume that the TAs will place your models (make sure to include everything, including the .mdl, .vfb, and .bmp if you're using a .mdl file) in the same directory as the image.

What models are you having trouble with that show up without a texture? I've heard there are some, but I haven't poked too hard to see what's going on. If you have a specific one I'll take a look.

Not that it matters, I have it all figured out now, but if you are interested. The chicken doesn't load up at all... it loads in the model's hierarchy and assigns coordinates but nothing appears and going to actor info displays nothing. The F15 and a few others come in just fine but they are a solid white, as if the texture file (which is there just fine) is absent or something.

> Justin Coffman

Is there a function that can force the other events to wait while I'm updating the timer of one particular event? I've tried to update the timer for one of the idle behaviors of the 3D charactor, but the other event would not wait for the updating, and executing themselves instead. I've tried the wait function, but no luck so far!

Hang Yin

Hey Hang,
Try using "Scheduler tick". I think that may do it for you if you want an animation to happen before the next line of code. Also, if you just want the animation to go to the final state, that is just update the vectors without interpolating, try using duration: rightNow instead of duration: 0.

Let me know if either of those solutions help.


I'm having the same troubles, could you elaborate on using Scheduler tick?

Matt Peter

The "scheduler tick" tells the scheduler to go ahead and tick once. This usually means that if there is an animation in the scheduler waiting to be run, it will begin that animation. However, this doesn't sound to me like the answer to the original question. To make an animation not run in the scheduler, you can do "scheduler pause" (or "scheduler reset"). So then, you might pause, update timer, and resume.

Kris Kemper

Jeff's response:
Careful using scheduler reset; it clears all animations, actions, alarms, and resets the scheduler time to zero. scheduler pause and scheduler resume should be what you need.

FYI: bunny wait: 4 creates a wait animation, it doesn't make the bunny wait.

How do I make the cameraWindow stop moving? You would think "cameraWindow stop" would do it, but it does not. Anyone have a suggestion? Thanks.
Kris Kemper

I figured it out. When you tell the cameraWindow to move, it creates an animation. So, I used a variable to get a handle on the anaimation, and just told it to stop.
Kris Kemper

Jeff's response:
The following should also work:

(scheduler getAnimationsFor: cameraWindow) do: [:anim | anim stop].

Of course, that will slam all animations on the camera.

what other kinds of animation styles are there besides "gently?" that seems to be the default for most things & i wanna experiment with different effects.
Anne Gurley

Jeff's response:
The built-in styles are:

You can also create your own. Those styles are local variables pointing to blocks that access the class methods of WonderlandStyle.

Do we have to actually have methods pause, resume, activate? The way I have it working now only requires one simple method that kind of causes a sort of loop. It seems to work fine. I was just wondering if the TA's will be looking for specific methods.
Also what does it mean: "the Guide will never execute one until the user issues the resume command."
Andrew Parsons

Jeff's response:
Yes, you actually have to provide those methods. You need the activate method so that we (and eventually your users) can trigger the idle behaviors to see what amusing things your Guide does. You need the pause and resume methods so that (a) an idle behavior doesn't accidentally start while your Guide is showing the user how to do something and (b) the user can stop the idle behaviors if (s)he gets tired of them.

One = idle behavior. I rephrased that bullet to hopefully make it clearer: Pause the idle behavior mechanism, so that the Guide will not execute another idle behavior until the user issues the resume command.

How about an M4 extension? =)

Jeff's response:
Nope, sorry. =)

In order to get the avatar to not be moved around it's not ... respondWith: ... to: leftMouseClick as it says in the blue book, try the following:
avatar respondWith: [:event | nil.] to: 'leftMouseDown'.

where avatar is an instance of the WonderlandActor

Richard Bailey

I'm trying to get a window to move along the screen with the avatar. What I've done is something like this:
(Note: w is the wonderland)


[(scheduler getAnimationsFor: cameraWindow) isEmpty] whileTrue:
[sysWin position: (cameraWindow position)].

Of course since I'm posting here this doesn't work. Infact it freezes my squeak session. I'm guessing what happens is that the animation doesn't occur while this while loop is occuring so the animation never finishes and nothing happens (this is a poor explanation but you get the idea). Anyone know a good hint on how to move the Window with the Avatar by using a drag command or something? (aka use the black house in the halo for this but the black house requires mouse events from what I can tell)

Christian Adam

Jeff's response:
One way you could try to do this (insert standard disclaimer about how this is a way, not the way) is to use both an animation and an action. For example:

avatar move: direction distance: someDist duration: X
avatar doEachFrame: [ sysWin position: (cameraWindowPosition) ] for: X

doEachFrame:for: executes the provided block each frame for the specified duration. If you give both commands the same duration then the avatar should move and the system window should go with it. Note that the latter command returns an Action, not an Animation, so you can't stick it in a doInOrder or doTogether.

Jorge Lage
Take a look at the do: command, it is really cool.

It returns an animation and you can pass stuff to execute, so you could do something like:

wonderlad doInOrder: {anim1. avatar do: [.......]}.

Christian Adam
We don't move the avatar when he moves across the screen. We turn him then move the cameraWindow then turn him back once he gets there. So neither of the above will work with our code. It seems like there should be a way to move a window with the cameraWindow but I haven't found a way yet. Is the way we are doing it a problem? Seems to me like it's the best way to move the avatar around the screen. The problem though is getting a window to move with the cameraWindow. Sorry for not making this clear last post.

Jeff's response:
So replace avatar with cameraWindow as follows:

cameraWindow move: direction distance: someDist duration: X
avatar doEachFrame: [ sysWin position: (cameraWindowPosition) ] for: X

Alternately you can animate the motion of any arbitrary morph by creating a RelativeAnimation and plugging in the appropriate parameters. Take a look at how WonderlandMorph implements move:.

Jorge Lage

You can try:

cameraMorph addMorph: myMorph.
avatar moveTo: position.
(That will attach the morph to the avatar, so if the avatar moves
it will move the attached morph with it)

If you don't want the morph attached anymore:
cameraMorph self world addMorph: myMorph.
(this works because a morph is only allowed to have one owner)

Christian Adam

Thanks alot for the help from both of you. Got it working now due to that.

When I activate an animation outside the Wonderland script editor, the method 'turn:turns:duration:style:' gives me this: "Squeak could not determine the style to use to turn thing because Error: your style function did not take exactly 2 parameters."


Elisha Waugh

Jeff's response:
Ah, that's probably because the style functions gently, abruptly, endGently, and beginGently are local to the Wonderland. Something like this should work:

namespace := w getNamespace
bunny := namespace at: 'bunny'
gently := namespace at: 'gently'
bunny turn: #left turns: 2 duration: 4 style: gently

That's presuming you're trying to use one of the built-in style functions. If you're trying to create your own, make sure you're handing it a block that expects 2 arguments.

Link to this Page