View Single Post
Posts: n/a
Default 09-18-2008, 12:59 PM

Re the variable problem - The basic problem is the scope of the test variable (CharacterPeaceStance). Since you have defined it as part of the world.stance method, it gets reset to the default value (true) every time the method completes. (I think if you actually printed it out from within the method, you would see that it does change - though that change doesn’t have any real effect on the rest of the program.) The solution is to define the test variable at the world level.

A second note - I find the use of the end option in the "While a key is pressed" event very risky - since you never actually know the timing for this test. When I did move the test variable to the world, I still got rather flaky results - though the variable and position would usually change. I'd recommend moving the "End" method call to the end of the methods called by the "During" part of the event.

Re the multiple object/list question - Thought that would be easy - but actually had quite a few problems, including a couple of total crashes. The attached seems to work, though I had trouble doing the same thing with a torus. One thing to watch is to make sure that the test is always made "as seen by" the current object from the list and you actually know what direction each object is facing (i.e., what direction is "front") - the defaults seem to be rather unpredictable. I also had much more luck making each command zero second duration than I did using the "For all together" command - not at all sure why. Once more, it's obvious Alice 2.0 and collision detection really isn't a great combination.
Attached Files
File Type: a2w Multiple Object Collision.a2w (241.0 KB, 98 views)
Reply With Quote