Alice Community  

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

Reply
 
Thread Tools Display Modes
Variables & 3D text
Old
rocki
Guest
 
Status:
Posts: n/a
Default Variables & 3D text - 09-04-2008, 01:32 PM

Is it possible to display the value of a numeric variable using 3D text? If yes, how is it done?

Thanks
j rocki
   
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 01-15-2010, 12:05 PM

It is. Go to the functions tab of the world and scroll down until you find "what as a string." Now, insert a "Set text to" method for your 3d text and use default string as the text value. Then, drag the "what as string" function over that text value, then select your number variable from the popup menu. Your 3d text should now be displaying the value of your variable in double form (with a decimal and a zero attached to the end. This can't be fixed, but most don't mind).


(')>
   
Reply With Quote
Yes it can!
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default Yes it can! - 01-23-2010, 04:20 PM

The decimal at the end actually can be fixed, although the solution is everything but conventional. instead of just putting your variable in the "What as string" function, drag the "Random number" function into it. Set your number as the minimum and maximum attributes. Set integer onlyto true. this is the only known way to counteract the issue.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
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 01-23-2010, 10:38 PM

It didn't seem to work for me. Any chance you could post a world with a working example?


(')>
   
Reply With Quote
Sure!
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default Sure! - 01-28-2010, 04:33 PM

I added a function to the world that does this! It will retain the decimal on numbers that need it, while getting rid of it on integers! Floating point! It gives a string, and you definitely don't want to do any math on the output, even though it's possible to make the output a number. It outputs true! Anyway, here's the world:

Float.a2w


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
mjswdr
Guest
 
Status:
Posts: n/a
Default 09-08-2010, 04:38 PM

Quote:
Originally Posted by zonedabone View Post
I added a function to the world that does this! It will retain the decimal on numbers that need it, while getting rid of it on integers! Floating point! It gives a string, and you definitely don't want to do any math on the output, even though it's possible to make the output a number. It outputs true! Anyway, here's the world:
There is actually a much easier way if you want ONLY AN INTEGER every time. Put a "set text to" function and in that put a "what as a string" function, and then inside that put a "int a as a string" function (from the very bottom of the advanced math list), and put your variable where a is. Note that if you are using something like this for a score for a game or whatnot you have to set the text every time the variable changes.
   
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.