Math action bug
Math action bug
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.
- juliocpaes
- Posts: 1263
- Joined: Mon Feb 14, 2011 12:07 am
- Location: Madrigal - Brazil
- Contact:
Re: Math action bug
already to figure out what was wrong with your script ?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.
Re: Math action bug
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
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.
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.
- juliocpaes
- Posts: 1263
- Joined: Mon Feb 14, 2011 12:07 am
- Location: Madrigal - Brazil
- Contact:
Re: Math action bug
@ hmp
but in "edit map aciton" you set "initially active" ? which you are to use "expiration mode" ?
but in "edit map aciton" you set "initially active" ? which you are to use "expiration mode" ?
Re: Math action bug
Julio, that is not the actual script, it was just to show the parameter in question defaults to integer type.
Re: Math action bug
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
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.