HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Series of problems.

05-17-2007, 10:09 PM#1
Centreri
First of all, I'm working on a spell that allows you to teleport to a destination 10000 units away in a series of up to 25 mini-teleportations of range 400 each. For this, I made a variable array with 36 values (might add more). First 12 are distance from unit to target for each of 12 players - next twelve is distance / 25, and next 12 is number of teleportations needed. I set up a trigger that - one second.

Trigger:
Teleportation Burst
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Teleportation Burst
Collapse Actions
Set TeleportationBurst[(Player number of (Triggering player))] = (Integer((Distance between (Position of (Triggering unit)) and (Target point of ability being cast))))
Collapse For each (Integer A) from 1 to 25, do (Actions)
Collapse Loop - Actions
Set TeleportationBurst[((Player number of (Triggering player)) + 12)] = (TeleportationBurst[(Player number of (Triggering player))] / (Integer A))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player number of (Triggering player)) + 12) Less than or equal to 1100
((Player number of (Triggering player)) + 12) Greater than or equal to 600
Collapse Then - Actions
Set TeleportationBurst[((Player number of (Triggering player)) + 24)] = (Integer A)
Else - Actions
As you can see, I'm planning on having the loop determine how many teleportations are needed based on distance. However, once the conditions are met in the loop, I want to break out of the loop, and I haven't found an action for that - is there a custom script 'break;' that can do that, or anything? I'm also hoping, for this trigger, to create an offset for each teleportation. In other words, every mini-blink is aimed 10-50 units perpendicular to the direct path from unit to destination, and the line is refreshed after every blink. How would I go about doing that?


Second of all, I'm having trouble with the simplest trigger in the world - a basic meteor spell.

Trigger:
Meteor
Collapse Events
Unit - A unit Finishes casting an ability
Collapse Conditions
(Ability being cast) Equal to Meteor
Collapse Actions
Special Effect - Create a special effect at (Target point of ability being cast) using Abilities\Spells\Human\FlameStrike\FlameStrikeTarget.mdl
Wait 1.00 seconds
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at (Target point of ability being cast) using Units\Demon\Infernal\InfernalBirth.mdl
Wait 0.50 seconds
Special Effect - Destroy (Last created special effect)
Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 200.00 at (Target point of ability being cast), dealing 70.00 damage of attack type Chaos and damage type Normal
Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 75.00 at (Target point of ability being cast), dealing 40.00 damage of attack type Chaos and damage type Normal
Unit - Cause (Casting unit) to damage circular area after 0.00 seconds of radius 40.00 at (Target point of ability being cast), dealing 100.00 damage of attack type Chaos and damage type Normal
I'm using Channel as the base ability.
Follow through time: 0. Options: Visible, Targeting Image, Physical Spell, Unique Cast. Target Type: Point Target.

This spell is supposed to wait 1 second, during which the flamestrike prelude appears in target area, and another second, during which a meteor is falling from the sky (inferno), and then deal damage. It doesn't do anything. Before I think I remember the flamestrike prelude working, but Inferno animation didn't work even then. Or the damage.
05-17-2007, 11:04 PM#2
xombie
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
hobo
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
xombie
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
Dil999
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 Normal

Edit: I was actually making this exact spell today. A meteor lands exactly .8 seconds after it is created; I suggest using that wait instead.