HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger spell help needed

02-13-2008, 10:56 PM#1
Quetz4545
I'm trying to create a spell that allows a person to grapple to the target point, for those of you that play DotA think of it like meat hook only it grapples the caster to the target location

. At the moment, its using a dumb event/condition, but they work well enough to be able to test the actions section of the trigger. Anyways, heres the trigger.

Trigger:
Untitled Trigger 002 Copy Copy
Collapse Events
Unit - A unit Is issued an order targeting a point
Collapse Conditions
(Issued order) Equal to Orc Witch Doctor - Sentry Ward
Collapse Actions
Set LightningGrappleCaster = (Position of (Triggering unit))
Set LightningGrappleTarget = (Target point of issued order)
Set LightningGrappleCasterUnit = (Triggering unit)
Set lightninggrappledistance = (Integer((Distance between LightningGrappleCaster and LightningGrappleTarget)))
For each (Integer A) from 1 to 25, do (Set LightningGrapplePoints[(Integer A)] = ((Position of LightningGrappleCasterUnit) offset by (((Real((Integer A))) / (Real(25))) x (Real(lightninggrappledistance))) towards (Angle from LightningGrappleCaster to LightningGrappleTarget) degrees))
Collapse For each (Integer A) from 1 to 25, do (Actions)
Collapse Loop - Actions
Set LightningGrapplePoints[(Integer A)] = (LightningGrappleCaster offset by (((Real((Integer A))) / 25.00) x (Real(lightninggrappledistance))) towards (Facing of LightningGrappleCasterUnit) degrees)
Special Effect - Create a special effect at LightningGrapplePoints[(Integer A)] using Abilities\Spells\Orc\LightningBolt\LightningBoltMissile.mdl
Set LightningGrappleFX[(Integer A)] = (Last created special effect)
Collapse For each (Integer A) from 1 to 25, do (Actions)
Collapse Loop - Actions
Unit - Move LightningGrappleCasterUnit instantly to LightningGrapplePoints[(Integer A)]
Special Effect - Destroy LightningGrappleFX[(Integer A)]
Wait 0.01 seconds

With what is above, it works perfectly. The SFX appears and are destroyed, unit is transported, etc....

Only thing is, it is wayyyyyy too slow...and 0.01 is the lowest waiting period i can put in....i've sat here thinking about it for nearly an hour straight, and i cant think of anything that would preserve the 'smoothness' of the while still having it complete in a reasonable amount of time... any suggestions would be appreciated.

thanks in advance
02-14-2008, 02:08 AM#2
Vexorian
You would then need to use a timer, not just waits.

And learn to use [trigger] tags please.
02-14-2008, 03:19 AM#3
Quetz4545
Fixed my original post. And i'm not sure what you mean, an expiration timer? I'm going to have to say that I'm missing something that should be obvious, because I don't see what you mean...
02-14-2008, 04:36 AM#4
Jazradel
Waits are extremely inaccurate at small values.

You need to have another trigger, which runs every 0.01 seconds (0.04 is fast enough probably) with the same actions as your loop.
02-14-2008, 02:40 PM#5
Themerion
Actually, you can set a wait to 0 seconds. It will then wait for ~0.2s.

As you said, you need a timer which runs over and over again. Timers are accurate.
02-14-2008, 04:44 PM#6
Quetz4545
Trigger:
LightningGrapple
Collapse Events
Unit - A unit Is issued an order targeting a point
Collapse Conditions
(Issued order) Equal to Orc Witch Doctor - Sentry Ward
Collapse Actions
Set LightningGrappleCaster = (Position of (Triggering unit))
Set LightningGrappleTarget = (Target point of issued order)
Set LightningGrappleCasterUnit = (Triggering unit)
Set lightninggrappledistance = (Integer((Distance between LightningGrappleCaster and LightningGrappleTarget)))
For each (Integer A) from 1 to 25, do (Set LightningGrapplePoints[(Integer A)] = ((Position of LightningGrappleCasterUnit) offset by (((Real((Integer A))) / (Real(25))) x (Real(lightninggrappledistance))) towards (Angle from LightningGrappleCaster to LightningGrappleTarget) degrees))
Set GrappleMovement = True
Set LightningGrappleLinkNumber = 1
Collapse For each (Integer A) from 1 to 25, do (Actions)
Collapse Loop - Actions
Set LightningGrapplePoints[(Integer A)] = (LightningGrappleCaster offset by (((Real((Integer A))) / 25.00) x (Real(lightninggrappledistance))) towards (Facing of LightningGrappleCasterUnit) degrees)
Special Effect - Create a special effect at LightningGrapplePoints[(Integer A)] using Abilities\Spells\Orc\LightningBolt\LightningBoltMissile.mdl
Set LightningGrappleFX[(Integer A)] = (Last created special effect)
Trigger:
LightningGrappleMove
Collapse Events
Time - LightningGrappleTimer expires
Collapse Conditions
GrappleMovement Equal to True
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
LightningGrappleLinkNumber Equal to 25
Collapse Then - Actions
Set LightningGrappleLinkNumber = 1
Set GrappleMovement = False
Collapse Else - Actions
Unit - Move LightningGrappleCasterUnit instantly to LightningGrapplePoints[LightningGrappleLinkNumber]
Special Effect - Destroy LightningGrappleFX[LightningGrappleLinkNumber]
Set LightningGrappleLinkNumber = (LightningGrappleLinkNumber + 1)

Got it working with the above two triggers. Thank you all for your help, it looks fantastic now.