• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell-Cast Window

Status
Not open for further replies.
Level 23
Joined
Oct 12, 2008
Messages
1,783
Is there a way to modify the angle window in which a unit can cast a targeted spell?

By default, a unit need not fully turn in the direction the ability it is casting.
(ie. A Tauren Cheiftain can cast Shockwave without having to fully turn to face the cast point of shockwave.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
The angle is about 11.5°, hardcoded and applies also to attacking, so no chance. But as always in wc3, there are workarounds.

For example there is the point targeted ability Reveal, which does not interrupt orders and also not care for that angle.

The following is quite specific and only works if your casting point and time is both 0. You have to evaluate this for your map though, also some small hardcode and trigger messups possible:
When unit is ordered to cast, use SetUnitX/Y to set it to a position where the angle is in those 11.5°. Use a 0.0 timer and when it runs out set the unit back to the old position. This is enough for the unit to start casting.

Or you just catch the order and then order a dummy unit to cast the real ability. This will ofc not consider cast point and cast times and has some other little problems.

Units with base movementspeed 0 and rooted units (with the rooted ability having DataC=0) do not use this angle. A fancy solution with adding a root ability to a unit for a short time wont be of any use though, too many problems.

Another method one could try is that the unit you are commanding is not the one actually selected but a dummy in the shadows is. This is very limited in its use though, as you get problems with command shifting, mirroring the UI, etc.
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
The angle is about 11.5°, hardcoded and applies also to attacking, so no chance. But as always in wc3, there are workarounds.

Thanks, that's all I really needed to know.
Im not trying to allow units to cast from wider angles but instead the reverse, hence none of those solutions work.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
The Lich apparently is able to cast Frost Nova at any angle.

No he's not and its unrelated to backswing point. The reason some units can seemingly cast when not facing the target is an optical illusion. The facing of the model is not equal to the actual facing of the unit.
 
Level 12
Joined
Nov 3, 2013
Messages
989
"Art - Propulsion Window (degrees) (Real)
Maximum angle that a unit/hero can launch a projectile before it needs to physically turn itself towards a target."

Maybe only for auto attacks
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
"Art - Propulsion Window (degrees) (Real)
Maximum angle that a unit/hero can launch a projectile before it needs to physically turn itself towards a target."

Maybe only for auto attacks

Quite sure that doesn't work, it doesn't matter whether you set it to 180 or 1, the unit still turns more or less the same.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Propulsion Window is not related to attacking or spellcasting but to running. It determines at which angle difference to the target point a unit starts running (if running is required to fulfil the command). 180° means the unit will right start to run and 0° means it will never run, so disabling its movement. Therefore most units have a propWin of ~60°.
So, what is the cause?
The change of actual facing of the unit is dependent only on the turn rate. The change of the visual part is dependant on the turn rate and orientation interpolation mainly. Mind that GetUnitFacing() returns the visual part, so for many triggered spells the visual part makes a big difference.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
This might be interesting as bonus info:

Orientation Interpolation graphs from 0 to 8
 

Attachments

  • OrientationInterpolationGraphs.jpg
    OrientationInterpolationGraphs.jpg
    93 KB · Views: 174
  • Like
Reactions: Kam
Status
Not open for further replies.
Top