Alice Community  

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

Reply
 
Thread Tools Display Modes
Error message help
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default Error message help - 07-20-2009, 10:29 PM

As much as I hate to admit it, I'm kind of stumped as to how to deal with this error.

Error message:
"Error during simulation.

Alice version: 2.2 9/1/2008
os.name: Windows XP
os.version: 5.1
os.arch: x86
java.vm.name: Java HotSpot(TM) Client VM
java.vm.version: 10.0-b22
user.dir: C:\Documents and Settings\Sims Only\Desktop\Alice and Web\Alice 2.2\Required

Throwable that caused the error:
java.lang.ArrayIndexOutOfBoundsException: 1
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:51)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.ForEachToget her$RuntimeForEachTogether.childUpdate(ForEachToge ther.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
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.response.DoTogether$R untimeDoTogether.update(DoTogether.java:68)
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.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
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:225)
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$9.run(AuthoringTool.java:703)
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.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.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 java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.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:5158)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:243)
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.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown 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)"


I think the error was caused by the fact that there are times when more than one ship can be within the distance needed for the collision with the bullet to be registered. However, there are several bugs I've noticed:

-Sometimes, the ship will automatically go to the left or to the right, without any keys pressed
-Bullet collisions go unregistered
-Enemy squadrons fail to regenerate
-Bomb animation loops repeatedly

If you can help with the bugs, go ahead and take a look. I had hoped to get this game up and running without having to post unfinished versions, as I have with ALL of my other projects, but sadly, here it is...
Attached Files
File Type: a2w SpaceGameThing.a2w (2.06 MB, 13 views)


(')>
   
Reply With Quote
Old
satovey
Guest
 
Status:
Posts: n/a
Default 07-20-2009, 10:55 PM

Quote:
Originally Posted by x2495iiii View Post

Throwable that caused the error:
java.lang.ArrayIndexOutOfBoundsException: 1
java is telling you that you are accessing an array beyond it's index.

Lets say that the array has two elements: array[0] and array[1].
If you try to access array[2] you
will get the above diagnostic.

the following messages are pointing you to the location where the error in the code exists.

Quote:
Originally Posted by x2495iiii View Post
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childPrologueIfNecessary(DoInOrder. java:51)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:97)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.childUpdate(DoInOrder.java:57)
at edu.cmu.cs.stage3.alice.core.response.ForEachToget her$RuntimeForEachTogether.childUpdate(ForEachToge ther.java:68)
at edu.cmu.cs.stage3.alice.core.response.DoInOrder$Ru ntimeDoInOrder.update(DoInOrder.java:98)
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.response.DoTogether$R untimeDoTogether.update(DoTogether.java:68)
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.response.CallToUserDe finedResponse$RuntimeCallToUserDefinedResponse.upd ate(CallToUserDefinedResponse.java:86)
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:225)
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$9.run(AuthoringTool.java:703)
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.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.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 java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.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:5158)
at edu.cmu.cs.stage3.alice.authoringtool.Actions$15.a ctionPerformed(Actions.java:243)
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.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown 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)"


I think the error was caused by the fact that there are times when more than one ship can be within the distance needed for the collision with the bullet to be registered. However, there are several bugs I've noticed:

-Sometimes, the ship will automatically go to the left or to the right, without any keys pressed
-Bullet collisions go unregistered
-Enemy squadrons fail to regenerate
-Bomb animation loops repeatedly

If you can help with the bugs, go ahead and take a look. I had hoped to get this game up and running without having to post unfinished versions, as I have with ALL of my other projects, but sadly, here it is...
It appears that the array is being called
within a loop and that loop continues to iterate even though the index to the array is out of bounds.

You might want to add the following:
If it is a while loop then the loop
should test the size of the array.

while(index !> array.length)

In this way, the loop will exit once
index is greater than the length of
the array.

Hope that helps. I'll check back tomorrow and see.
   
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 07-20-2009, 11:08 PM

There aren't any methods like that in my world, though. The only array (list, actually) referenced is the enemies list, which doesn't have any index references, it has a

For all items from world.enemies together
if item_from_world.enemies(the list) is within x width of bump(bullet)
then (explosion, ship and bullet disappear, enemies left decremented)
else
(do nothing)


(')>
   
Reply With Quote
I didn't get your error message
Old
satovey
Guest
 
Status:
Posts: n/a
Default I didn't get your error message - 07-20-2009, 11:10 PM

I didn't get the error message that you posted. What did you do to get it?
   
Reply With Quote
Old
satovey
Guest
 
Status:
Posts: n/a
Default 07-20-2009, 11:14 PM

Quote:
Originally Posted by x2495iiii View Post
There aren't any methods like that in my world, though. The only array (list, actually) referenced is the enemies list, which doesn't have any index references, it has a

For all items from world.enemies together
if item_from_world.enemies(the list) is within x width of bump(bullet)
then (explosion, ship and bullet disappear, enemies left decremented)
else
(do nothing)
Your error may be coming from the Alice source itself. This would indicate a bug, especially since I didn't have the error come up on my system.

Here is what is in my error councole.

Alice version: 2.2 6/10/2009

*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****

If your using Alice 3, then I'd say it's a bug.

Last edited by satovey; 07-20-2009 at 11:17 PM. Reason: adding erro counsol stuff
   
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 07-21-2009, 12:13 AM

Nope. I'm using 2.2, same as you. I'll try it in Alice 2.0, though.

Oh, to trigger the error, I simply pressed the Fire button (Space Bar) to fire at some of the ships, while using the Arrow Keys to make the ship dodge the incoming enemy fire.

What SHOULD happen is whenever the bullet touches one of the ships, it blows up. This should happen until the squadron of enemies is completely destroyed. Then, when 10 have been eliminated, the boss ship should come in, cloak, then basically behave the same as an enemy, but with the ability to endure 20 shots before exploding.


(')>

Last edited by x2495iiii; 07-21-2009 at 12:19 AM.
   
Reply With Quote
Old
Veryuhbull
Guest
 
Status:
Posts: n/a
Default 07-21-2009, 11:42 AM

Quote:
Originally Posted by x2495iiii View Post
Nope. I'm using 2.2, same as you. I'll try it in Alice 2.0, though.

Oh, to trigger the error, I simply pressed the Fire button (Space Bar) to fire at some of the ships, while using the Arrow Keys to make the ship dodge the incoming enemy fire.

What SHOULD happen is whenever the bullet touches one of the ships, it blows up. This should happen until the squadron of enemies is completely destroyed. Then, when 10 have been eliminated, the boss ship should come in, cloak, then basically behave the same as an enemy, but with the ability to endure 20 shots before exploding.
Maybe the error has to do with when you are pressing two key commands at once while the game is trying to process varibles as well. I have had the same problem before and I fixed it by adjusting the controls to a point where the error went away.
I don't see how to fix it in this case.

By the way brilliant idea for a game.
   
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 07-22-2009, 01:39 AM

The program didn't work in any of the versions of Alice, so I'll try muddling with the controls next. The problem is that I'm in the same boat as you: no idea how to solve the problem. The movement and attack methods are already in two completely different methods and called by two completely different events, so there should be no conflict.

Glad you like it. Did you get to the boss fight? I worked very hard on that part. The evasive patterns, the attacks, the way the shield flickers, even the explosion at the end.


(')>

Last edited by x2495iiii; 07-23-2009 at 12:04 PM.
   
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 07-23-2009, 12:04 PM

I haven't gotten any results yet as far as altering the controls go. Does anyone have any ideas or suggestions?


(')>
   
Reply With Quote
Old
Veryuhbull
Guest
 
Status:
Posts: n/a
Default 07-23-2009, 01:23 PM

further review of your game:
the whole thing moves way to fast for me. I slowed it down and played it. The enemies wouldn't die when i shot them after an amount of time. I could never finish a level because of this. Are the patterns supposed to be random? (one pattern becomes impossible after the things go underground.) Some shots from the enemies became unavoidable on occasion because they came from the side. I only had an error several times and it happened when I smashed the fire button a ton. (this may have no connection)
   
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.