Problematic triggers

WayTooShort

New Member
Reaction score
4
I have a sliding part in my map, and players are supposed to be able to cast spells while sliding. What I have is:

1.) A slide trigger that moves the unit every 0.03 seconds with SetUnitPosition.
2.) A trigger that detects when unit is issued a spell order and turns on trigger 3 and turns off trigger 1.
3.) A trigger that works as trigger 1 but uses SetUnitX and SetUnitY instead of SetUnitPosition.

In case you didn't know: moving with SetUnitPosition interrupts the unit's current orders, SetUnitX/Y doesn't interrupt them.

Problem: When unit is ordered to cast a spell at something out of the cast range, it is forced to walk until it can cast the spell. This makes the sliding really bugged, since SetUnitX/Y doesn't interrupt the move order. And I can't use SetUnitPosition either, since then the unit wouldn't cast the spell.

What can I do?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
when the order is given check whether the distance between the units position and the target point of the issued order is within the range or not.
if it is do as you did already, if its not, well thats up to you.
you might want to make some error message telling the player the target is out of range and not allowing the cast to happen. the most simpliest solution still effective.
 

WayTooShort

New Member
Reaction score
4
I already thought of an error message, but that doesn't really help. And I have around 100 spells with different ranges on different levels, so it wouldn't really be that simple. But thanks anyways.

Any other solutions? Would there be a way to make unit try to cast the spell without moving to the cast range?
 

vypur85

Hibernate
Reaction score
803
> Would there be a way to make unit try...

Why would you want the unit to be able to cast the spell if the range isn't right? The unit shouldn't be able to cast.

Try setting the unit's movement speed to 0 during sliding. It should give a better fix. Make sure you have you minimum unit speed set to 0 in Gameplay Constant.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I already thought of an error message, but that doesn't really help. And I have around 100 spells with different ranges on different levels, so it wouldn't really be that simple. But thanks anyways.

Any other solutions? Would there be a way to make unit try to cast the spell without moving to the cast range?

do all these abilities have sounds set? if not you can use the sound path of an abilityto insert information to it.
you hold down "shift" then you left-click the sound path data and you can enter any string you want. for example the string "800".

via triggers you can get the sound path specified for an ability, save it as a string, convert it to a real and voila you got your cast range for the spell.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top