Page 1 of 1

directional_shout

Posted: Tue Oct 01, 2013 1:39 am
by Castler
While looking at borrowing directional_shout.lua's particle effects for my module, I noticed that ToME's version is a bit off (asymmetrical and a bit skewed). This is particularly obvious if you use a spread 90 (for a 180° arc total) and a distortion_factor of 0. There are a couple of bugs that cause this:
  • Starting the for loop at 1 instead of 0 or 5 then iterating by 5 means that it stops at 71° (for example) when it should stop at 75°. The fix is to start iterating at 5 (or at 0 and merge in the special case for the first point in each arc).
  • Subtracting 90° from the direction of the shout, determining the starting point, then adding 90° causes the starting point to be skewed. The fix is to not adjust the angle by 90.
The attached update for directional_shout.lua fixes this. It also changes the interpretation of the spread parameter to be the entire arc rather than from the direction to one end of the arc; this should make its meaning match engine.Target's code_angle (which is where it'll probably be used).

Re: directional_shout

Posted: Wed Oct 02, 2013 9:39 pm
by darkgod
Thanks :)