|
Max range or the range it teleports?
- Untitled Trigger 002
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set BlinkHT = (Last created hashtable)
- Untitled Trigger 001
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Blink
- Actions
- Set u = (Triggering unit)
- Set p1 = (Position of u)
- Set p2 = (Target point of ability being cast)
- Set r = (Angle from p1 to p2)
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p2)
- Custom script: set udg_p2 = null
- -------- ---------------------------------------- --------
- Set p2 = (p1 offset by (10.00 x (Real((Intelligence of u (Include bonuses))))) towards r degrees)
- -------- ---------------------------------------- --------
- Custom script: call SetUnitX(udg_u, GetLocationX(udg_p2))
- Custom script: call SetUnitY(udg_u, GetLocationY(udg_p2))
- -------- ---------------------------------------- --------
- Custom script: set udg_id = GetHandleId(udg_u)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (0 is stored as a Handle of id in BlinkHT) Equal to False
- Then - Actions
- Custom script: set udg_tmr = CreateTimer()
- Custom script: call SaveTimerHandle(udg_BlinkHT, udg_id, 0, udg_tmr)
- Custom script: call SaveUnitHandle(udg_BlinkHT, GetHandleId(udg_tmr), 0, udg_u)
- Trigger - Add to Untitled Trigger 003 <gen> the event (Time - tmr expires)
- Else - Actions
- Custom script: set udg_tmr = LoadTimerHandle(udg_BlinkHT, udg_id, 0)
- -------- ---------------------------------------- --------
- Custom script: call SaveLocationHandle(udg_BlinkHT, GetHandleId(udg_tmr), 1, udg_p2)
- Countdown Timer - Start tmr as a One-shot timer that will expire in 0.00 seconds
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p1)
- Custom script: set udg_p1 = null
- Untitled Trigger 003
- Events
- Conditions
- Actions
- Custom script: set udg_u = LoadUnitHandle(udg_BlinkHT, GetHandleId(GetExpiredTimer()), 0)
- Custom script: set udg_p1 = LoadLocationHandle(udg_BlinkHT, GetHandleId(GetExpiredTimer()), 1)
- -------- ---------------------------------------- --------
- Special Effect - Create a special effect at p1 using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
- Special Effect - Destroy (Last created special effect)
- -------- ---------------------------------------- --------
- Custom script: call SetUnitX(udg_u, GetLocationX(udg_p2))
- Custom script: call SetUnitY(udg_u, GetLocationY(udg_p2))
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p1)
- Custom script: set udg_p1 = null
Delete Art - Area Effect from Blink in object editor.
There might be some issues, so it could be better to base this on Channel ability.
No. The range is set to certain value, it's not dynamic like you want, so you can't change it any other way, except creating new level. That, however, is more problematic for a smooth gameplay than "meaty" trigger.
Max range or the range it teleports?
- Untitled Trigger 002
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set BlinkHT = (Last created hashtable)
- Untitled Trigger 001
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Blink
- Actions
- Set u = (Triggering unit)
- Set p1 = (Position of u)
- Set p2 = (Target point of ability being cast)
- Set r = (Angle from p1 to p2)
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p2)
- Custom script: set udg_p2 = null
- -------- ---------------------------------------- --------
- Set p2 = (p1 offset by (10.00 x (Real((Intelligence of u (Include bonuses))))) towards r degrees)
- -------- ---------------------------------------- --------
- Custom script: call SetUnitX(udg_u, GetLocationX(udg_p2))
- Custom script: call SetUnitY(udg_u, GetLocationY(udg_p2))
- -------- ---------------------------------------- --------
- Custom script: set udg_id = GetHandleId(udg_u)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (0 is stored as a Handle of id in BlinkHT) Equal to False
- Then - Actions
- Custom script: set udg_tmr = CreateTimer()
- Custom script: call SaveTimerHandle(udg_BlinkHT, udg_id, 0, udg_tmr)
- Custom script: call SaveUnitHandle(udg_BlinkHT, GetHandleId(udg_tmr), 0, udg_u)
- Trigger - Add to Untitled Trigger 003 <gen> the event (Time - tmr expires)
- Else - Actions
- Custom script: set udg_tmr = LoadTimerHandle(udg_BlinkHT, udg_id, 0)
- -------- ---------------------------------------- --------
- Custom script: call SaveLocationHandle(udg_BlinkHT, GetHandleId(udg_tmr), 1, udg_p2)
- Countdown Timer - Start tmr as a One-shot timer that will expire in 0.00 seconds
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p1)
- Custom script: set udg_p1 = null
- Untitled Trigger 003
- Events
- Conditions
- Actions
- Custom script: set udg_u = LoadUnitHandle(udg_BlinkHT, GetHandleId(GetExpiredTimer()), 0)
- Custom script: set udg_p1 = LoadLocationHandle(udg_BlinkHT, GetHandleId(GetExpiredTimer()), 1)
- -------- ---------------------------------------- --------
- Special Effect - Create a special effect at p1 using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
- Special Effect - Destroy (Last created special effect)
- -------- ---------------------------------------- --------
- Custom script: call SetUnitX(udg_u, GetLocationX(udg_p2))
- Custom script: call SetUnitY(udg_u, GetLocationY(udg_p2))
- -------- ---------------------------------------- --------
- Custom script: call RemoveLocation(udg_p1)
- Custom script: set udg_p1 = null
Delete Art - Area Effect from Blink in object editor.
There might be some issues, so it could be better to base this on Channel ability.
ThanksCheck the map again, I updated it.
I shall try it, thanksthen make the "blink" spell be able to have a max range of 99999999999 in the editor,
then just check if the distance between the target point and the caster's location is within the range given by the intelligence of the caster, if not then just teleport him on the point determined by the max distance based on int...
Sim error?Or you can use SimError right when the unit cast, distance > INT
I'm giving suggestion to Maker to implement a system called SimError which stands for Simulated Error.
Leak points? Why save? What would happen?This won't work that well imo.
First, you leak points. You will need to save those location into variable.
That 0,01 second wait does not delay the trigger by 0,01 second, because if you have wait under 0,27, the wait time is random and not exact.
(also you have set a specific unit to play its animation and you move caster back to its position if the distance between caster and target point is way too long)
Maker said:A better solution is to make the unit blink to max distance if the clicked distance is farther away than max distance. Coincidental or not, it works that way in the map I posted.
Like how blink works, and its really better off that way...