Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Thread Tools Display Modes
Could this be a bug? (Alice 2.3)
Junior Member
Status: Offline
Posts: 7
Join Date: Jan 2013
Location: Kapolei, Hawaii
Question Could this be a bug? (Alice 2.3) - 04-15-2013, 07:22 PM

I'm working on a simple targeting system for a game, but I've run into a problem. In an If/Else statement, I haved 2 lines of code in the True part, but only 1 line executes.

What makes it even more confusing is the offending line DOES execute when targeting one particular object, but none of the others.

This inconsistancy makes no sense to me. If the statement is True, BOTH lines should execute every time. If there is a problem with the way I coded it, then neither line should execute. The fact that 1 True line executes and the other doesn't defies logic. Add to that the fact that both lines do work on only one particular target and it just makes no sense whatsoever!

I even showed this to my professor and he was stumped.

So... any Alice gurus here that like a challenge?

Bascally, the code looks at a list of potential targets and checks if the aiming device is pointed at anything on the list. If it is, it returns True, and what was supposed to happen was the targeting reticle (dot) would turn red, and the ring around it would turn green.

This did not work, except on the last item in the list. So to check if it was a problem with the list, I made it so that the target itself would turn red (instead of the reticle) and THAT WORKED!???

Every target turns red when the aiming device passes over it, but the aiming device itself will only change color on the last target in the list. Since both commands are located in the same place in the code (True) I can not figure out why it's not working.

Thanks to any and all who can help with this.
Attached Files
File Type: a2w targeting_test.a2w (4.39 MB, 15 views)
Reply With Quote
Senior Member
sfunk's Avatar
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 04-15-2013, 08:30 PM

Well you should have asked the person that you copied this code from, which is me lol And to answer your question, when using the all together statement, it tends to be finicky, meaning it isn't perfect, it will more than likely just use whatever the first item is in your list when trying to run a looping method like you are trying to do in your project. But is it a glitch, No, not really. Just a programming issue, you could always try to set up another function that will check the same thing as before but have it only control your reticle, might work. Other than that, just keep messing around with it.

Oh and try to give people credit when you use something of theirs, It's just common courtesy.

If you are stuck on a project, check out the tutorials I made here at this link:

There are lots of tutorials on it so far, including some youtube videos, check it out


Go to my youtube channel to check out my alice 2.2 tutorials I have there..
Reply With Quote

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 ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.