Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   alice poses (http://www.alice.org/community/showthread.php?t=3910)

thibauld 02-11-2010 04:52 AM

alice poses
 
hey,

im making a game where i throw a couple of dice and they land on a random side.Im trying to make alice recognize what iv have trown, and i tried useing poses, but everytime i do something with poses and start the game or save it, alice crashes and my save is lost, losing a lot of work everytime. im tring to do it with 1 dice first, so i set dice1 to how it is standing --> dice1 set pose dice1.pose1. then i use if statements to determine what ive trown by comparing this pose to other poses i made earlier of the dice of all sides, but it keeps crashing everytime i play it after that. what am i doing wrong?

x2495iiii 02-11-2010 09:23 AM

You may be triggering a world-stopping error.

Could you post your world so I can take a look at it?

jediaction 02-11-2010 09:28 AM

I would do a random number variable. Lke 1-6, then put 6 dummys inthe eaxct same place. Then make each one of those 6 chances and make the die stand up on that one side.

jediaction 02-11-2010 09:28 AM

did it help

thibauld 02-12-2010 04:36 AM

my game
 
1 Attachment(s)
Hey all,

here is my game so far. there is a lot of text in dutch though, but that isnt really important for the game. The '# points' world method is where I tried using the poses. You can skip the opening with enter. im aware that i used MUCH more code than needed :P

if you press k now after the intro you will get an 'error during simulation' error.

thibauld 02-12-2010 04:38 AM

[QUOTE=jediaction;16768]did it help[/QUOTE]

hmm, you method would require much less code and work, but i already got what i have now and im too proud to delete that xD

thibauld 02-15-2010 05:48 AM

poses
 
1 Attachment(s)
Also, could someone please explain a bit about poses in Alice, since I am trying to understand them but things still wont work...:confused:

Also, I watched a couple of other treads and thought it might be usefull if i posted the error i get here. please help me:

Error during simulation.


Alice version: 2.2 6/10/2009

Throwable that caused the error:
java.lang.NullPointerException
at edu.cmu.cs.stage3.alice.core.response.PoseAnimation$RuntimePoseAnimation.prologue(PoseAnimation.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$RuntimeDoInOrder.childPrologueIfNecessary(DoInOrder.java:52)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$RuntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDefinedResponse$RuntimeCallToUserDefinedResponse.update(CallToUserDefinedResponse.java:86)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$RuntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$RuntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.behavior.TriggerBehavior.internalSchedule(TriggerBehavior.java:69)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Behavior.java:226)
at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehaviors(Sandbox.java:70)
at edu.cmu.cs.stage3.alice.core.World.scheduleBehaviors(World.java:444)
at edu.cmu.cs.stage3.alice.core.World.schedule(World.java:486)
at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.schedule(DefaultClock.java:99)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringTool$7.run(AuthoringTool.java:702)
at edu.cmu.cs.stage3.alice.authoringtool.util.DefaultScheduler.simulateOnce(DefaultScheduler.java:115)
at edu.cmu.cs.stage3.alice.authoringtool.util.DefaultScheduler.run(DefaultScheduler.java:76)
at edu.cmu.cs.stage3.scheduler.AbstractScheduler.run(AbstractScheduler.java:45)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at edu.cmu.cs.stage3.swing.DialogManager.showModalDialog(DialogManager.java:60)
at edu.cmu.cs.stage3.swing.DialogManager.showDialog(DialogManager.java:128)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringTool.play(AuthoringTool.java:5159)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.actionPerformed(Actions.java:168)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

thibauld 02-17-2010 03:57 PM

ehm could someone pls help me? x2495iiii asked for the game but hasnt said anything since

jediaction 02-17-2010 04:08 PM

[QUOTE=thibauld;16822]hmm, you method would require much less code and work, but i already got what i have now and im too proud to delete that xD[/QUOTE]


Alright then

x2495iiii 02-17-2010 04:24 PM

K, well, here's my input.

You can't use poses to make the dice objects set themselves so that a certain side is facing upwards. Poses deal with the placement and orientation of subparts, not the object itself.

I'd recommend using something other than poses, like dummy objects or the dice's orientation in the world, to develop a series of if/else if statements which check each dice to determine which side is facing the camera.


All times are GMT -5. The time now is 02:10 AM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.