Page 1 of 1

Math action bug

Posted: Mon Feb 22, 2016 3:38 pm
by hmp
The "Result Fraction" parameter in the Math action is supposed to store the output as a fraction, but actually seems to store it as an integer. It's not too much of a problem since you can still store the result as a fraction in another action, but it was giving me a headache trying to figure out what was wrong with my script.

Re: Math action bug

Posted: Sun Mar 13, 2016 5:36 pm
by juliocpaes
hmp wrote:The "Result Fraction" parameter in the Math action is supposed to store the output as a fraction, but actually seems to store it as an integer. It's not too much of a problem since you can still store the result as a fraction in another action, but it was giving me a headache trying to figure out what was wrong with my script.
already to figure out what was wrong with your script ?

Re: Math action bug

Posted: Wed Apr 06, 2016 11:14 pm
by Myrd
I looked at the code and it seems like it should work. Could you provide a test map where you're seeing it not working?

Re: Math action bug

Posted: Thu Apr 07, 2016 1:09 am
by hmp
Here you go

https://dl.dropboxusercontent.com/u/150 ... 20test.zip

There are two sets of map actions set up - one for the right trow and the other for the left. Both should set their health fractions to 0.7, however the one on the right does not, it sets it to 0 (or almost). The difference is the one on the right uses result fraction (refx) and the actions for the left one place the result in a different action using destination action identifier and destination parameter.

You can also look in loathing and see that the parameter type for result fraction/refx is "integer" instead of "fixed".

Also I think when I first discovered this I tried manually changing it from integer to fixed and it still didn't work.

Image

Re: Math action bug

Posted: Thu Apr 07, 2016 7:04 am
by juliocpaes
@ hmp

but in "edit map aciton" you set "initially active" ? which you are to use "expiration mode" ?

Re: Math action bug

Posted: Thu Apr 07, 2016 5:51 pm
by hmp
Julio, that is not the actual script, it was just to show the parameter in question defaults to integer type.

Re: Math action bug

Posted: Thu Apr 07, 2016 7:28 pm
by Myrd
Ah. I think it's a problem with the Loathing default. The code indeed tries to use the type of the field to set the value, so if the field type is integer, it will set it as integer. I *think* changing the field type to fixed will work correctly. The fix should be in the template tags for that field.

Re: Math action bug

Posted: Sat Apr 09, 2016 6:28 pm
by hmp
Ok thanks, I changed the template file and made it into an addon so it is fixed by default, changing it manually seems to work too, although I could swear I tried that before without success.