- Joined
- Feb 6, 2008
- Messages
- 166
I have a couple questions, since I haven't done this before:
How do people generally go about moving projectiles for MUI spells?
Right now, I'm using a hashtable to store the location of the caster, as well as the location's X and Y coordinates and a time value. Then it starts a periodic trigger that increments the time (by 0.03 seconds), and then sets the projectile's X and Y coordinates equal to the caster's X and Y plus the results from the parametric space-curves.
Long story short, the four projectiles move like this:
I would also have to use tangents to set their facing angle parallel to the direction of travel.
Is there a better way to do this? The part of me studying for an applied math minor is saying "No, this is how it's done," while the computer science major in me is saying, "There's clearly a better way to code it. You're just not seeing it."
About the spell itself, the caster will cast a "Channel" dummy skill, Instant (No Target), and a trigger will detect the start of its "empty" effect. The trigger will release four projectiles, which will sweep around for graphics purposes. Periodically, another trigger will find all valid targets within a gradually increasing radius not in the "already affected" unit group. This will prompt a trigger-casted, no-cast-time, no-cooldown, no-manacost, invisible Shadow Strike to be casted at each unit, and then add them to the "already affected" unit group.
What this will look like, is a caster that casts a spell in a similar manner as War Stomp or Fan of Knives. Instead, four projectiles will spiral outward in a counter-clockwise direction. At the same time, all enemy units within 600 range will be hit for initial damage and damage over time, starting from the closest units and ending with the furthest units.
Overall, what I'm asking is:
1. I'm new to using triggers to move projectile dummy units. Is this how people generally do it?
2. If so, did I do it right?
3. Is what I did an appropriate solution for the spell I had in mind?
How do people generally go about moving projectiles for MUI spells?
Right now, I'm using a hashtable to store the location of the caster, as well as the location's X and Y coordinates and a time value. Then it starts a periodic trigger that increments the time (by 0.03 seconds), and then sets the projectile's X and Y coordinates equal to the caster's X and Y plus the results from the parametric space-curves.
Long story short, the four projectiles move like this:
xprojectile,1=600tcos(6tpi)+xcaster
yprojectile,1=600tsin(6tpi)+ycaster
xprojectile,2=600tcos(6tpi + pi/2)+xcaster
yprojectile,2=600tsin(6tpi + pi/2)+ycaster
xprojectile,3=-600tcos(6tpi)+xcaster
yprojectile,3=-600tsin(6tpi)+ycaster
xprojectile,4=600tcos(6tpi + pi/2)+xcaster
yprojectile,4=600tsin(6tpi + pi/2)+ycaster
yprojectile,1=600tsin(6tpi)+ycaster
xprojectile,2=600tcos(6tpi + pi/2)+xcaster
yprojectile,2=600tsin(6tpi + pi/2)+ycaster
xprojectile,3=-600tcos(6tpi)+xcaster
yprojectile,3=-600tsin(6tpi)+ycaster
xprojectile,4=600tcos(6tpi + pi/2)+xcaster
yprojectile,4=600tsin(6tpi + pi/2)+ycaster
I would also have to use tangents to set their facing angle parallel to the direction of travel.
Is there a better way to do this? The part of me studying for an applied math minor is saying "No, this is how it's done," while the computer science major in me is saying, "There's clearly a better way to code it. You're just not seeing it."
About the spell itself, the caster will cast a "Channel" dummy skill, Instant (No Target), and a trigger will detect the start of its "empty" effect. The trigger will release four projectiles, which will sweep around for graphics purposes. Periodically, another trigger will find all valid targets within a gradually increasing radius not in the "already affected" unit group. This will prompt a trigger-casted, no-cast-time, no-cooldown, no-manacost, invisible Shadow Strike to be casted at each unit, and then add them to the "already affected" unit group.
What this will look like, is a caster that casts a spell in a similar manner as War Stomp or Fan of Knives. Instead, four projectiles will spiral outward in a counter-clockwise direction. At the same time, all enemy units within 600 range will be hit for initial damage and damage over time, starting from the closest units and ending with the furthest units.
Overall, what I'm asking is:
1. I'm new to using triggers to move projectile dummy units. Is this how people generally do it?
2. If so, did I do it right?
3. Is what I did an appropriate solution for the spell I had in mind?