• 🏆 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!

JASS Jump spell request

Status
Not open for further replies.
Level 8
Joined
Jul 25, 2009
Messages
194
Hi I'm looking for a jump spell that allows the unit to cast spells and attack while in mid air but cannot change direction or distance so he cant change the target point of the jump.

Can anyone make the spell? I heard its only possible in jass so i cant make it
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The mechanics of your spell is a contradiction, why ?
Okay, here it is,

When we are doing "charge-like" spell or "move-to-target-position" kind of spell, not instant spell, but moving the unit to that location, we need either this action;
  • Unit - Move Caster instantly to TempLoc2
Or this function;
call SetUnitX(udg_Caster, GetLocationX(udg_TempLoc2))
call SetUnitY(udg_Caster, GetLocationY(udg_TempLoc2))

When we want to move unit and can receive orders at a time, we use the second method, the SetUnitX/Y, because that function does not interrupt orders, compared to MoveUnit function, you can't do anything at all (can't receive any other orders)

So next, you want that unit to move + receive orders + can't change direction.
Since we have accomplished the move + receive orders, we only need to do something about "can't change direction".

Now, if you want unit that won't be able to change their direction while moving, you're gonna have to issue a 'Stop' order to that unit per interval;
  • Untitled Trigger 004
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit - Order Caster to Stop
This way, that unit won't be able to change directions no matter how fast you order it to Move.

Since you have issued that unit a 'Stop' order, how do you expect that unit to receive an order to cast spell or attack ?
And if you removed the 'Stop' order method, Player can order that unit to move to any directions he want while during the spell and can cause the unit to end up at different location.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Yeah I think I've got the solution.
Just set the unit's movement speed to 0 in Trigger Editor but first, go to Gameplay Constants > Tick the box "Use Custom Gameplay Constants" > Change the "Movement - Unit Speed - Minimum" to 0.

This way, the unit won't be able to move at all (meaning it can't be ordered to move to change direction), but still can attack/cast spell.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You said not to change direction ?
Change Direction = Change Distance

What actually do you want ??????

If you want it to move the unit a bit, set the movement speed to 50 ~ 100, this will make the unit to move a bit, causing changes in direction/distance.
 
Status
Not open for further replies.
Top