I thought to report it.
I needed a new Input in my Script and made this:
[NinjaScriptProperty]
[Range(.0, int.MaxValue)]
[Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
public int FCloseat
{ get; set; }
I compiled it and made a test run , with value +4, in Analyser and I noticed I made a mistake as it had to be a double and so changed it to:
[NinjaScriptProperty]
[Range(-10.0, double.MaxValue)]
[Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
public double FCloseat
{ get; set; }
I test again and I have the same Results, so as my Script is very complicated, over 7000 lines, I first thought I made a mistake somewhere and run my debugs
I debugged it to the point of having the line:
Print(Time[0] +" FCloseat is "+FCloseat);
what I first found rediculus, but you never know and the Result was:
02.12.2020 18:05:00 FCloseat is 0
So I thought I made a mistake in declaration and worked again on the Input, but I could do whatever I wanted it didn't worked so after a while I decided to remove it
completely and I made a private double FCloseat on top of the Script and initialized it with 4. Compiled all good Print is 4, I remove the private douple and copy in again
the whole block of:
[NinjaScriptProperty]
[Range(-10.0, double.MaxValue)]
[Display(Name="FCloseat", Description="-4 to 4", Order=212, GroupName="Parameters")]
public double FCloseat
{ get; set; }
and I didn't made any change since I deleted it and complied it again, test run and print is:
02.12.2020 18:05:00 FCloseat is 4
So I made a further test and declared a new input double and print was as it should (4), if I made a new Int input, compile and change it then to double, compile again and
run it it shows zero again.
So my conclusion is that the Analyser is keeping it as a "int" as long its not gonna be removed, or I guess the Analyser is closed and reopen again.
As I found it very frustrating loosing some time on this I thought I post it...
Comment