In official max help reference shipped with 3dsmax exist nice "How to" topic. Search for "MAXScript FAQ >
How do I change the text in a Text Shape dynamically?".
Quote:Normally, the text of a Text shape is not animatable. The resulting mesh will be
evaluated once at the beginning of the rendering and will not change as it is
considered static (not changing over time). A workaround is to assign a script
controller to a property of the text shape which will do two things: tell the
renderer that the text shape is animated and thus requires reevaluation on each frame, and set the actual text in the text property.
WARNING!
Changing the text object's text property in anything other than a controller applied to the text object can lead to a renderer crash!
Also there is a good 'how to' example with
dependsOn expression:
b=
box name:"ControlBox" wirecolor:bluet=
text name:"ControlledText" wirecolor:redt.baseobject.renderable=
truet.kerning.controller=
float_script()scrpt=
"dependsOn $'"+b.name+
"';$'"+t.name+
"'.text=$'"+b.name+
"'.height as string\n0"t.kerning.controller.script=scrpt
animate on at time 100 b.height*=
2max tool zoomextents all
playAnimation()As you see, there assigned script to kerning controller of the text shape. By right click over text shape and choose
Dope Sheet open Track View and double click over
Kerning to see script controller dialog. There you can add/edit expressions. Also have options/buttons to
Save,
Load,
Debug,
Evaluete, and this is more friendly environment for beginner scripters. On the left side are variable options. You can create new or use existing (there 4 already defined) variables.
And there is some simple example from me, that use default
F variable to make a frame counter animation:
-- check if exist and create new shape if notif not isValidNode $Text01 then (t =
text name:"Text01" wirecolor:yellow)
-- make renderable end change size to 10t.baseobject.renderable =
true;t.size =
10-- assign script controller to object kerningt.kerning.controller=
float_script()-- define expression and assign itexpr =
"$Text01.text=F as string\n0"t.kerning.controller.script = expr
playAnimation() -- test resultP.S. - final note about 0 (zero) in the end of expression.
It's used to define the end of script.