• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Blink distance based upon Intelligence?

Status
Not open for further replies.
Level 4
Joined
Sep 6, 2010
Messages
100
How would I make the range of the ability "Blink" (teleport one) be based upon the value of Intelligence?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
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.
 

Attachments

  • Blink (1).w3x
    14.6 KB · Views: 56
Last edited:
Level 4
Joined
Sep 6, 2010
Messages
100
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.

Max range it will teleport.
Boy, that trigger looks very meaty...
Isn't there a way to just modify a field of data of an Object? Like the teleport max range in Blink?
 
Level 25
Joined
Sep 26, 2009
Messages
2,387
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.
 
Level 4
Joined
Sep 6, 2010
Messages
100
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.

:(
I'll figure something out tomorrow; I'm done for today :vw_sleep:
 
Level 4
Joined
Sep 6, 2010
Messages
100
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.

I just tested the map out, and it teleports the hero based on the intelligence, but I wanted the intelligence to effect the maximum distance possible to teleport to.
 
Last edited:
then 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...
 
Level 4
Joined
Sep 6, 2010
Messages
100
Check the map again, I updated it.
Thanks

then 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...
I shall try it, thanks

Or you can use SimError right when the unit cast, distance > INT
Sim error?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I'm giving suggestion to Maker to implement a system called SimError which stands for Simulated Error.
It allows you to "produce an error"-like message just like the one Blizzard's default error message such as Not enough gold, etc.

By implementing this system, when your Caster casts to a distance greater than your INT, call this system with a message something like "Distance greater than INT" or something.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I'm giving suggestion to Maker to implement a system called SimError which stands for Simulated Error.

That might not be the best solution. As one can not easily see the max range. Let's say the max range is 600. Not very easy to tell if you're clicking at 590 or 610 distance away. You would be constantly clicking about 550 distance away just to avoid the error message. That is annoying. 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.

Imagine that you are in a tight spot, about to die and you try to blink away in panic. You click somewhere on the edge of your screen, far away. Would you prefer to get an error message or Blink as far away as your ability allows?
 
Level 4
Joined
Sep 6, 2010
Messages
100
  • Disassemble 000000000000
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Disassemble
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of Shadow 0002 <gen>) and (Target point of ability being cast)) Less than or equal to (4.00 x (Real((Intelligence of Shadow 0002 <gen> (Include bonuses)))))
        • Then - Actions
          • Wait 0.01 seconds
          • Animation - Play Shadow 0002 <gen>'s Spell Slam animation
          • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\Feedback\SpellBreakerAttack.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Sound - Play Error <gen>
          • Unit - Move (Triggering unit) instantly to (Position of (Triggering unit))
This works nicely.

EDIT: Turns out there were some errors... fixed them though. ^
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,387
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)
 
Level 4
Joined
Sep 6, 2010
Messages
100
This won't work that well imo.
First, you leak points. You will need to save those location into variable.
Leak points? Why save? What would happen?

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.

I'm not looking for exactness at that line, for some reason, the animation won't play unless I put a wait function before the animation :/

(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)

Only that caster will use the spell.
Have you got any better ideas on how to disable the spell?
 
Last edited:
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...

@Aero - adding a circle, hmmm... It should be shown when you're still choosing the target point of the spell, but that is not possible in wc3, since there is no event handler for that...

@OP: just use Maker's spell...
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Like how blink works, and its really better off that way...

Not true, if you aim over max range wc3 blink will set you to 80% of max range in normal cases.

@offtopic: any interesting threads worth looking at while I was gone the last 6 months^^?
 
Level 4
Joined
Sep 6, 2010
Messages
100
Maker's trigger is better than mine, I'm not denying that, but it's too large; if I wanna change something later on I'll have a hard time since it wasn't me who thought it up, and because of how large it is.
 
Status
Not open for further replies.
Top