Game Development Community

Bug: Intellisense alters stored values

by Robert Blanchet Jr. · in Torsion · 04/08/2008 (4:41 pm) · 2 replies

When debugging scripts and a break-point triggers, if you highlight a statement of torque script and put the mouse cursor over it to get the tooltip, Torsion will evaluate the highlighted line and give you the value. So for instance, if I highlight 2+3 while debugging Torsion's tooltip will say something like: "2+3: 5".

However, when Torsion does this evaluation it will also affect the value stored in a variable. So for instance, if I have a line that reads: "%test++;" and use Torsions tooltip it will actually store the evaluation back into the %test variable even though that particular line of TorqueScript has not be executed.

#1
04/08/2008 (5:16 pm)
That is a known issue, but not something we are planning on changing.

Running an eval is the only way Torsion can evaluate anything, so sometimes you can accidently do things like this ( similarly, if you type "quit()" in the watch window, it will close your game ). But there isn't much Torsion can do to stop you.

To combat this issue Torsion only tries to evaluate single variables when you hover the mouse ( without any highlighting ). And if you double click it only highlights the variable and excludes any '++'. This prevents you from accidently asking torsion to evaluate code that could change something.

However, if you drag-select the entire %var++ and hover over it, well, it will evaluate what you told it to.
#2
04/08/2008 (11:47 pm)
Yea... its a weird known issue.

I'd be glad to hear any ideas you have to make it behave better Robert.