Alice Community  

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

Reply
 
Thread Tools Display Modes
Last Thing... Variable wont show proper value
Old
docsaintly
Guest
 
Status:
Posts: n/a
Angry Last Thing... Variable wont show proper value - 09-29-2009, 11:27 PM

Ergh, I get very frustrated with alice because I already know how to program and constantly feel that it makes simple tasks very difficult if you don't know where the button is...

I have code that runs through a counter, and this works fine. It increments the counter, and moves the proper object in the index. It even updates a textobject's .text to a string version of the value (only when i do a "When score changes, do 3d text set text to 'Score: ' joined with score as a string"

I'm trying to output the number of objects the user missed (10 - score). But, whenever i try to use the score variable from within the world.my first method area, it !!WILL NOT!! show its proper value and always shows it as 0. Even though I can watch it in the window increasing in value. Is there some magical word I have to say to get it to finalize the variable and recognize that it's changed even though EVERYTHING else already sees this!?

Sorry for the frustration, but it's annoying that I spent 2 hours on a simple task that I could be working on databases and feel more accomplished.

And sorry for not posting my world, the teacher says not to share work with others and i'm not sure if this would violate that.
   
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 09-30-2009, 01:12 AM

Actually, I find it indescribably honorable of you to follow your teacher's directions and resist the urge to ask others to complete your work for you. Many, many people have joined the forums simply because they wanted someone to do their homework for them, and apparently, you aren't one of those people. Kudos.

As far as your question goes, I really have no idea why on earth your world isn't working. Based on your description, I wrote a world myself to try to duplicate your situation, and my world worked perfectly (I've posted it below if you'd like to review it).
Attached Files
File Type: a2w clickObject.a2w (231.9 KB, 20 views)
   
Reply With Quote
My idiocy got the better of me
Old
docsaintly
Guest
 
Status:
Posts: n/a
Talking My idiocy got the better of me - 09-30-2009, 10:37 PM

x2495iiii, Thank you very much for the warm response. After reflecting on it overnight I felt bad for getting angry and posting the message in that manner.

It turns out, that the problem was right in front of my face (I still don't think it should be a problem though).

The counter objects were in the "my first method" object. It's still curious though that certain things could read its value and others couldn't. Yet right as I type that I realize that it makes perfect sense because the items that work are the ones in events that are called during the method. And the ones that don't work are probably called after the "my first method" is over and the data has been "forgotten".

I also liked the "While Mouse is pressed on ..." I couldn't figure out why my objects had such a delayed reaction time, until I finally notice i had to click AND let go quickly for it to capture it. You were apparently far too familiar with this.

The clickCheck was also very eloquent, I probably would have spent my time trying to drag and drop variables in places that wouldn't accept it.

Again, I really appreciate your help, you have made my week much easier!
   
Reply With Quote
hey, x2495iiii
Old
DumDum203
Guest
 
Status:
Posts: n/a
Question hey, x2495iiii - 10-03-2009, 12:55 AM

i found a glitch in your example. you can click each ball multiple times, and come out with better than 100%

my fix was: in the clickCheck, under the increment function,

wait([the duration in the main method]-target distance to cone)

I'd post it, but i only changed one thing. From what i've tested, this seems to work. what do you think?
   
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 10-25-2009, 01:14 AM

Yeah that is true, I didn't test for glitches like that, good catch. I was trying to make it quick and simple. Good idea for the fix as well.


(')>
   
Reply With Quote
Old
Chris101b
Senior Member
 
Chris101b's Avatar
 
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 10-25-2009, 04:42 AM

I get messages from people all the time on youtube asking me to make their projects for them. It's hysterical! They say that they will pay me 20 dollars a project through pay pal. I tell them that I can help them figure it out, but I can't make it for them. I usually never get a response back lol.


I am nowhere and everywhere at the same time.

www.facebook.com/chris101b
Xbox Live GT: Chris101b
Youtube: (You guessed it) www.youtube.com/chris101b
   
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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.