Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
alice poses
Old
thibauld
Guest
 
Status:
Posts: n/a
Exclamation alice poses - 02-11-2010, 04:52 AM

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?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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?


(')>
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 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.


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 02-11-2010, 09:28 AM

did it help


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
my game
Old
thibauld
Guest
 
Status:
Posts: n/a
Default my game - 02-12-2010, 04:36 AM

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.
Attached Files
File Type: a2w tienduizenden_v4c.a2w (1.02 MB, 7 views)

Last edited by thibauld; 02-12-2010 at 04:53 AM.
   
Reply With Quote
Old
thibauld
Guest
 
Status:
Posts: n/a
Exclamation 02-12-2010, 04:38 AM

Quote:
Originally Posted by jediaction View Post
did it help
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

Last edited by thibauld; 02-13-2010 at 11:54 AM.
   
Reply With Quote
poses
Old
thibauld
Guest
 
Status:
Posts: n/a
Question poses - 02-15-2010, 05:48 AM

Also, could someone please explain a bit about poses in Alice, since I am trying to understand them but things still wont work...

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.PoseAnimatio n$RuntimePoseAnimation.prologue(PoseAnimation.java :68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:52)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
at edu.cmu.cs.stage3.alice.core.behavior.TriggerBehav ior.internalSchedule(TriggerBehavior.java:69)
at edu.cmu.cs.stage3.alice.core.Behavior.schedule(Beh avior.java:226)
at edu.cmu.cs.stage3.alice.core.Sandbox.scheduleBehav iors(Sandbox.java:70)
at edu.cmu.cs.stage3.alice.core.World.scheduleBehavio rs(World.java:444)
at edu.cmu.cs.stage3.alice.core.World.schedule(World. java:486)
at edu.cmu.cs.stage3.alice.core.clock.DefaultClock.sc hedule(DefaultClock.java:99)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l$7.run(AuthoringTool.java:702)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.simulateOnce(DefaultScheduler.java:115)
at edu.cmu.cs.stage3.alice.authoringtool.util.Default Scheduler.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.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(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.showModalDia log(DialogManager.java:60)
at edu.cmu.cs.stage3.swing.DialogManager.showDialog(D ialogManager.java:128)
at edu.cmu.cs.stage3.alice.authoringtool.AuthoringToo l.play(AuthoringTool.java:5159)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:168)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown 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.mouseRe leased(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(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn 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.pumpOneEventForHierar chy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Attached Files
File Type: a2w tienduizenden_v4c.a2w (1.11 MB, 3 views)

Last edited by thibauld; 02-15-2010 at 05:56 AM.
   
Reply With Quote
Old
thibauld
Guest
 
Status:
Posts: n/a
Default 02-17-2010, 03:57 PM

ehm could someone pls help me? x2495iiii asked for the game but hasnt said anything since
   
Reply With Quote
Old
jediaction
Senior Member
 
jediaction's Avatar
 
Status: Offline
Posts: 5,064
Join Date: Jul 2009
Location: Bel Air, Maryland
Default 02-17-2010, 04:08 PM

Quote:
Originally Posted by thibauld View Post
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

Alright then


Website: www.salokingames.com
FaceBook: www.facebook.com/SalokinGames
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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.


(')>
   
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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