Strange Issue Concerning the textNumber Function
Posted: Wed Aug 01, 2012 6:29 pm
I ran into a strange issue while using the textNumber function and an even stranger workaround that I accidentally discovered and do not understand.
I have the following function defined in my Global code:
The following is my mouse down event (on another actor) that calls the above function.
On mouse down, the animation changes as expected, but the value of the number does not. It remains at 0 (the default value).
However, the number changes as expected if I add a comment above the function call in the mouse down event. The complete code within the mouse down event with which the number value changes properly is as follows:
I had inserted the comment to check whether the code worked without the function call (and it did). I commented it out thereafter and noticed the code worked after I re-added the textNumber line of code the function call. Upon removing the comment, the code ceased to function as expected once again.
I have no idea why the above occurs and why a comment affects the way the code functions, but I'd sure like to find out.
I have the following function defined in my Global code:
- Code: Select all
void displayRowsMarket () {
Market_Row_1_Qty.textNumber=10;
ChangeAnimation("Market_Row_2", "Market_R_Power_Grey", FORWARD);
}
The following is my mouse down event (on another actor) that calls the above function.
- Code: Select all
displayRowsMarket();
On mouse down, the animation changes as expected, but the value of the number does not. It remains at 0 (the default value).
However, the number changes as expected if I add a comment above the function call in the mouse down event. The complete code within the mouse down event with which the number value changes properly is as follows:
- Code: Select all
//Market_Row_1_Qty.textNumber=30;
displayRowsMarket(costHandgun);
I had inserted the comment to check whether the code worked without the function call (and it did). I commented it out thereafter and noticed the code worked after I re-added the textNumber line of code the function call. Upon removing the comment, the code ceased to function as expected once again.
I have no idea why the above occurs and why a comment affects the way the code functions, but I'd sure like to find out.