Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Bugs and Troubleshooting (http://www.alice.org/community/forumdisplay.php?f=18)
-   -   Interesting error. (http://www.alice.org/community/showthread.php?t=6959)

legolizard 07-19-2011 10:08 AM

Interesting error.
 
Okay so I am making a game, and one of the events I'm using is the "When mouse is clicked on something do something" event. I am also using the "object under mouse cursor" function as a parameter for the method that I am running. However the event does not always respond, personnified it sometimes says "Sure whatever you like," while other times it says, "No no method for you!":p:p But really I have no clue as to why this is happening and thus have no idea as to how to [I]fix[/I] it.:(:confused: Now one thing I tried was to delete the event entirely and add a fresh one and to then replace the method. However, when I try to insert the "object under mouse cursor" as a parameter I get an error that makes no sense. This is the error:

[CODE]Error encountered while responding to popup menu item.


Alice version: 2.2 02/10/2011

Throwable that caused the error:
java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at edu.cmu.cs.stage3.alice.core.RenderTarget.pick(RenderTarget.java:80)
at edu.cmu.cs.stage3.alice.core.question.PickQuestion.getValue(PickQuestion.java:52)
at edu.cmu.cs.stage3.alice.core.Property.evaluateIfNecessary(Property.java:380)
at edu.cmu.cs.stage3.alice.core.Property.getValue(Property.java:407)
at edu.cmu.cs.stage3.alice.core.Variable.getValue(Variable.java:35)
at edu.cmu.cs.stage3.alice.authoringtool.util.ChildChangeUndoableRedoable.getLogString(ChildChangeUndoableRedoable.java:107)
at edu.cmu.cs.stage3.alice.authoringtool.util.ChangeLogger.pushUndoableRedoable(ChangeLogger.java:33)
at edu.cmu.cs.stage3.alice.authoringtool.MainUndoRedoStack.push(MainUndoRedoStack.java:148)
at edu.cmu.cs.stage3.alice.authoringtool.MainUndoRedoStack.childrenChanged(MainUndoRedoStack.java:232)
at edu.cmu.cs.stage3.alice.core.Element.onChildrenChange(Element.java:1010)
at edu.cmu.cs.stage3.alice.core.Element.insertChildAt(Element.java:1051)
at edu.cmu.cs.stage3.alice.core.Element.addChild(Element.java:1055)
at edu.cmu.cs.stage3.alice.authoringtool.viewcontroller.PropertyViewController$9$1.run(PropertyViewController.java:1326)
at edu.cmu.cs.stage3.alice.authoringtool.util.PopupMenuItemActionListener.actionPerformed(PopupMenuUtilities.java:2641)
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.AbstractButton.doClick(Unknown Source)
at edu.cmu.cs.stage3.alice.authoringtool.util.AliceMenuItemUI$MouseInputHandler.mouseReleased(AliceMenuItemUI.java:48)
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.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(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)

[/CODE]

The main reason as to why this makes little sense is because I rarely even [I]use[/I] the undo/redo buttons, on occasion I do but not habitually. Any help would be greatly appreciated.:)

ElectricKirby 07-19-2011 04:35 PM

Alice does that sometimes. Just remake the method.

legolizard 07-19-2011 05:00 PM

I have. My biggest problem is not the error, although something is definitely wrong there, but it is the fact that Alice seems to destroy the event entirely and does not respond at all. This is what happens: Imagine a menu screen with two buttons a options button and a start button. You go and click on the option button Alice runs a method to determine the object you clicked on based on the "object under mouse cursor" function then acts accordingly. Then you want to go back to the main menu so click a "Back" button Alice runs the same method and again acts accordingly. This is when it gets annoying. Now lets say you want to go back to the options menu, and so click the options button again. Alice simply does [I]not[/I] react anymore and it is really bugging me, because I have read read and re-read all the code maybe fifteen times and everything [I]should[/I] be okay. Thanks for replying though; do you have any other ideas as to why this is happening?:)


All times are GMT -5. The time now is 04:48 AM.

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