A quick tip for Torsion users
by Richard Ranft · in Torque 3D Beginner · 07/21/2014 (6:57 am) · 5 replies
If you add Java-doc comments before your functions and methods Torsion will display them in a pop-up when you hover over the function/method elsewhere in the editor:
It might work in other tools as well. And as an added bonus you can probably run doxygen against it to make html docs of your scripts.
/// <summary> /// Finds the highest attribute and returns the global attribute index: /// $Stat::Strength = 0; /// $Stat::Dexterity = 1; /// $Stat::Constitution = 2; /// $Stat::Intelligence = 3; /// $Stat::Wisdom = 4; /// $Stat::Charisma = 5; /// </summary> /// <param name="character">Character data object.</param> /// <return>Highest attribute index.</return>It's pretty handy.
It might work in other tools as well. And as an added bonus you can probably run doxygen against it to make html docs of your scripts.
About the author
I was a soldier, then a computer technician, an electrician, a technical writer, game programmer, and now software test/tools developer. I've been a hobbyist programmer since the age of 13.
#2
All is required is to use either /// or
07/21/2014 (8:02 am)
Torsion just displays the entire comment block above declarations as-is without any documentation style processing before hand. Note that all TorqueScript APIs are documented in doxygen style not C#/Java. So if you want consistency and guaranteed to be processed by doxygen then use doxygen doc style.All is required is to use either /// or
/** * */comment styles for Torsion to display them up as tool tips.
#3
07/21/2014 (12:08 pm)
Thanks for the clarification Nathan!
#4
07/21/2014 (3:08 pm)
Good to see old school D&D stats in your example :D Although those are some low rolls :P
#5
07/21/2014 (5:48 pm)
LOL - Actually, working on a Torque adaptation of d20 Modern in my spare time....
Associate Simon Love
Thanks, Richard!