| 05-17-2007, 11:04 PM | #2 |
First of all, is the maximum cast range 10,000? Or is it an infinite cast range with only a 10,000 of maximum teleport range? Either way, what you're trying to do can be solved instead with simple math, instead of a loop. There is a nice function called "ModuloReal" that can come in handy here, spitting out a remainder. Lets say you cast the teleport exactly '905' distance, you can save that as a variable. Lets say the distance is known as 'dist'. Because ModuloReal spits out the remainder of a division, you can use: ModuloReal( 'dist', 400 ), 400 being your intervals, and then an R2I( 905 / 400 ) to get your whole value of 2. Now you have the data to know that you need a total of '2' teleports, with a "leftover" range of ModuloReal( 905, 400 ) which will return 105 ( 905 - 800 ). For a recap on what you've done so far, now you have avoided using your loop that you can't go out of, as well as made your loop which was originally long extremely short. You have found out you have a total of 2 teleportations. If you don't need to do anything with the remainder, then you don't even need to use "ModuloReal" instead you can just to R2I( 'dist', 400 ) and it will return how many teleportations you will need. Example: R2I( 905 / 400 )... 905 / 400 = 2.xxxx ... What R2I does it simply take off the decimals, without any rounding. I believe that is how it works, but I may be wrong. I know there -is- a way of taking off the decimals though without any rounding. If you don't infact need the remaining value, and cast range may only be factors of 400, then you only need to do the R2I function. ------------------------------------- Now, for your other issue. You want the unit to diverge from the "straight line" to give it a little bit of a cosmetic randomness. What you could do is move the unit with the line, then every time you do that add a little bit of an offset, without changing any of the variables involved with the line calculations. This is a hard thing to explain seeing as how I'm not a teacher, and my education only extends to that of AP Calculus. Message me when you get this message and I can give you better advice, it would be useful if you had MSN or something, because its far easier than chatting every few hours. |
| 05-18-2007, 11:25 AM | #3 |
waits are your problem. Wait causes trigger to stop and let other triggers run for the supplied wait time, well when it comes back to process your trigger the current spell data (current target, current ability etc )has been overwritten by newer spells. Target point of spell being cast is no longer the same as when it started. disable the waits and the destroy effect actions, see if that works. then well work on replacing them with better methods. |
| 05-19-2007, 10:29 PM | #4 |
If you "Destroy Effect" immediately after creating it, in your case, it is going to play the effect as you want. Since the animation for "Infernal Birth" is somewhat of a constant animation, it doesn't matter how long it is "alive" for. DestroyEffect simply runs the death animation of an effect and then removes it. The death animation in "Infernal Birth" situation is simply its animation. Put your effects into 'Special Effect' variables so that you may reference them even after your Wait calls. |
| 05-20-2007, 03:00 AM | #5 |
For the first spell, simply do this: Distance between start and end points / 400, set that to a real. For each Integer A from 1 to YourInteger move him 400 distance.. etc.. So it looks something like this Set RealInteger = Distance between position of triggering unt and position of target point of ability being cast / 400 For each integer a 1 to real(RealInteger) do (actions) The second one; First, use a variable for the point. Using a wait clear 'target point of ability being cast'. Second, any object which has 1 animation (in the we unit previewer, you cant scroll through animations) can be destroyed as soon as it is created and still display itself. So it looks something like this: Trigger: ![]() Set Unit = Triggering Unit![]() Set TempPoint = Target Point of Ability being Cast![]() Special Effect - Create a special effect at (TempPoint) using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl![]() Special Effect - Destroy (Last created special effect)![]() Wait 1.00 seconds![]() Special Effect - Create a special effect at (TempPoint) using Units\Demon\Infernal\InfernalBirth.mdl![]() Special Effect - Destroy (Last created special effect)![]() Wait 0.50 seconds![]() Unit - Cause (Unit) to damage circular area after 0.00 seconds of radius 200.00 at (TempPoint), dealing 70.00 damage of attack type Chaos and damage type Normal![]() Unit - Cause (Unit) to damage circular area after 0.00 seconds of radius 75.00 at (TempPoint), dealing 40.00 damage of attack type Chaos and damage type Normal![]() Unit - Cause (Unit) to damage circular area after 0.00 seconds of radius 40.00 at (TempPoint), dealing 100.00 damage of attack type Chaos and damage type NormalEdit: I was actually making this exact spell today. A meteor lands exactly .8 seconds after it is created; I suggest using that wait instead. |
