Math action bug

A forum for discussing map making ideas and problems for the Myth series.

Moderator: Doobie

Math action bug

Postby hmp » Mon Feb 22, 2016 3:38 pm

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.
hmp
 
Posts: 49
Joined: Fri Dec 14, 2007 3:00 am

Re: Math action bug

Postby juliocpaes » Sun Mar 13, 2016 5:36 pm

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 ?
User avatar
juliocpaes
 
Posts: 1177
Joined: Mon Feb 14, 2011 12:07 am
Location: Madrigal - Brazil

Re: Math action bug

Postby Myrd » Wed Apr 06, 2016 11:14 pm

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?
Myrd
Site Admin
 
Posts: 3678
Joined: Fri Mar 19, 2004 10:17 pm

Re: Math action bug

Postby hmp » Thu Apr 07, 2016 1:09 am

Here you go

https://dl.dropboxusercontent.com/u/1503243/Myth%20Plugins/2016/math%20action%20bug%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
hmp
 
Posts: 49
Joined: Fri Dec 14, 2007 3:00 am

Re: Math action bug

Postby juliocpaes » Thu Apr 07, 2016 7:04 am

@ hmp

but in "edit map aciton" you set "initially active" ? which you are to use "expiration mode" ?
User avatar
juliocpaes
 
Posts: 1177
Joined: Mon Feb 14, 2011 12:07 am
Location: Madrigal - Brazil

Re: Math action bug

Postby hmp » Thu Apr 07, 2016 5:51 pm

Julio, that is not the actual script, it was just to show the parameter in question defaults to integer type.
hmp
 
Posts: 49
Joined: Fri Dec 14, 2007 3:00 am

Re: Math action bug

Postby Myrd » Thu Apr 07, 2016 7:28 pm

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.
Myrd
Site Admin
 
Posts: 3678
Joined: Fri Mar 19, 2004 10:17 pm

Re: Math action bug

Postby hmp » Sat Apr 09, 2016 6:28 pm

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.
hmp
 
Posts: 49
Joined: Fri Dec 14, 2007 3:00 am


Return to Map Making Support

Who is online

Users browsing this forum: No registered users and 1 guest