I have many useful python scripts, but I thought this one is simple and very practical. This will change a number to a string, without including the .0 bit (such as 2 instead of 2.0). This is useful for changing 3D text to display scores and stuff like that.
paste this python code into world script area:
Code:
import string
def stringit(numba):
numba = round(numba,0)
numbastring = `numba`
numbastring = string.replace(numbastring, ".0", "")
world.stringNo = numbastring
create a string world variable called world.stringNo
Then use the script in an Alice method by dragging in a script tile and writing
stringit(1) in it, with
1 being replaced with any number or variable.
Now when you give the script a number it will return the number as a string, without any decimal point or decimal places.
Go to
this website for more on python scripting in Alice.
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬